summaryrefslogtreecommitdiffstats
path: root/solec.ksy
diff options
context:
space:
mode:
Diffstat (limited to 'solec.ksy')
-rw-r--r--solec.ksy59
1 files changed, 59 insertions, 0 deletions
diff --git a/solec.ksy b/solec.ksy
new file mode 100644
index 0000000..01c7481
--- /dev/null
+++ b/solec.ksy
@@ -0,0 +1,59 @@
+meta:
+ id: solec
+ file-extension: hex
+ endian: be
+
+enums:
+ type:
+ 0x01: handshake
+ 0x02: ping
+ 0x03: pong
+ 0x04: message
+ 0xFF: test
+
+seq:
+ - id: payload_type
+ type: u1
+ enum: type
+ - id: payload_length
+ type: u2
+ - id: payload
+ type:
+ switch-on: payload_type
+ cases:
+ 'type::test': test
+
+types:
+ string:
+ seq:
+ - id: len_payload
+ type: u2
+ - id: payload
+ type: str
+ size: len_payload
+ encoding: UTF-8
+ binary:
+ seq:
+ - id: len_payload
+ type: u2
+ - id: payload
+ size: len_payload
+ test:
+ seq:
+ - id: num1
+ type: u1
+ - id: time1
+ type: u8
+ - id: str1
+ type: string
+ - id: num2
+ type: u2
+ - id: bin1
+ type: binary
+ - id: num3
+ type: u4
+ - id: str2
+ type: string
+ - id: num4
+ type: u8
+