summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEdoardo La Greca2025-07-12 19:14:26 +0200
committerEdoardo La Greca2025-07-12 19:14:26 +0200
commit9dc3f40ddbfd635b5e8cebe1c1748145b4384ed9 (patch)
treebe051d6abac141d3a940e0016e4d618df91a9749
parentc916a1c14813fbb96288b0c75efd29e01ee6a0df (diff)
tmp
-rw-r--r--src/main/kotlin/NinePConnection.kt57
-rw-r--r--src/main/kotlin/NinePTranslator.kt4
-rw-r--r--src/main/kotlin/SizedMessageField.kt12
3 files changed, 73 insertions, 0 deletions
diff --git a/src/main/kotlin/NinePConnection.kt b/src/main/kotlin/NinePConnection.kt
index ee9d5ba..86056eb 100644
--- a/src/main/kotlin/NinePConnection.kt
+++ b/src/main/kotlin/NinePConnection.kt
@@ -21,6 +21,11 @@ class NinePConnection(netPackTrans: NetworkPacketTransporter) : NinePTranslator
val npt: NetworkPacketTransporter = netPackTrans
/**
+ * Has the 9P connection been initialized yet?
+ */
+ private var hasBeenInitialized = false
+
+ /**
* Disconnect from the remote host,
*
* @throws IOException if an I/O error occurred while closing the socket.
@@ -76,5 +81,57 @@ class NinePConnection(netPackTrans: NetworkPacketTransporter) : NinePTranslator
)
}
+ override fun version() {
+ TODO("Not yet implemented")
+ }
+
+ override fun auth() {
+ TODO("Not yet implemented")
+ }
+
+ override fun flush() {
+ TODO("Not yet implemented")
+ }
+
+ override fun attach() {
+ TODO("Not yet implemented")
+ }
+
+ override fun walk(path: String) {
+ TODO("Not yet implemented")
+ }
+
+ override fun open(path: String) {
+ TODO("Not yet implemented")
+ }
+
+ override fun create(path: String) {
+ TODO("Not yet implemented")
+ }
+
+ override fun read(path: String) {
+ TODO("Not yet implemented")
+ }
+
+ override fun write(path: String) {
+ TODO("Not yet implemented")
+ }
+
+ override fun clunk(path: String) {
+ TODO("Not yet implemented")
+ }
+
+ override fun remove(path: String) {
+ TODO("Not yet implemented")
+ }
+
+ override fun stat(path: String) {
+ TODO("Not yet implemented")
+ }
+
+ override fun wstat(path: String) {
+ TODO("Not yet implemented")
+ }
+
// TODO: implement methods from NinePTranslator
} \ No newline at end of file
diff --git a/src/main/kotlin/NinePTranslator.kt b/src/main/kotlin/NinePTranslator.kt
index c976cd9..a4dab41 100644
--- a/src/main/kotlin/NinePTranslator.kt
+++ b/src/main/kotlin/NinePTranslator.kt
@@ -12,6 +12,10 @@ TODO:
interface NinePTranslator {
/**
* Negotiate protocol version.
+ *
+ * This must be the first message sent on the 9P connection and no other requests can be issued until a response has
+ * been received.
+ * Tag should be NOTAG ((ushort)~0)
*/
fun version()
diff --git a/src/main/kotlin/SizedMessageField.kt b/src/main/kotlin/SizedMessageField.kt
new file mode 100644
index 0000000..160bc48
--- /dev/null
+++ b/src/main/kotlin/SizedMessageField.kt
@@ -0,0 +1,12 @@
+import java.math.BigInteger
+import kotlin.math.floor
+
+class SizedMessageField(size: Int, value: BigInteger) {
+ init {
+ val requiredSize = value.
+ }
+
+ val size = size
+ val value = value
+
+} \ No newline at end of file