summaryrefslogtreecommitdiffstats
path: root/solec.ksy
diff options
context:
space:
mode:
authorbt <bt@rctt.net>2026-03-14 23:11:15 +0100
committerbt <bt@rctt.net>2026-03-18 16:21:58 +0100
commit54ddec67c477a6fd73b0f623258c0849ba695b88 (patch)
tree3a34b67e62b8788f0611abc4f9f8cfe7954aae46 /solec.ksy
parent8932846aa4d29d59fd208f40bbfd44d1bb9cf1ff (diff)
downloadsolec-54ddec67c477a6fd73b0f623258c0849ba695b88.tar.gz
solec-54ddec67c477a6fd73b0f623258c0849ba695b88.zip
Basic server implementation
Diffstat (limited to 'solec.ksy')
-rw-r--r--solec.ksy55
1 files changed, 32 insertions, 23 deletions
diff --git a/solec.ksy b/solec.ksy
index e7c24e1..dcfcc11 100644
--- a/solec.ksy
+++ b/solec.ksy
@@ -3,15 +3,13 @@ meta:
file-extension: hex
endian: be
-doc: |
- SOLEC protocol uses big endian encoding. Frames uses type-length-value format.
-
+doc: SOLEC protocol
doc-ref: https://git.sr.ht/~rctt/solec/blob/main/solec.svg
seq:
- id: type_payload
type: u1
- enum: type
+ enum: payload_type
- id: len_payload
type: u2
- id: payload
@@ -19,20 +17,25 @@ seq:
type:
switch-on: type_payload
cases:
- 'type::handshake': handshake
- 'type::ping': ping
- 'type::pong': pong
- 'type::message': message
- 'type::test': test
+ 'payload_type::success': success
+ 'payload_type::error': error
+ 'payload_type::handshake': handshake
+ 'payload_type::auth': auth
+ 'payload_type::message': message
+ 'payload_type::test': test
enums:
- type:
- 0x01: handshake
- 0x02: ping
- 0x03: pong
- 0x04: message
+ payload_type:
+ 0x01: success
+ 0x02: error
+ 0x03: handshake
+ 0x04: auth
+ 0x05: message
0xFF: test
+ error_type:
+ 0x01: auth_failed
+
types:
string:
doc: UTF-8 encoded string.
@@ -52,6 +55,16 @@ types:
- id: payload
size: len_payload
+ success:
+ doc: Send from server if operation succeded.
+
+ error:
+ doc: Senf from server if operation failed.
+ seq:
+ - id: error_code
+ type: u1
+ enum: error_type
+
handshake:
doc: |
Handshake is sent by the client during connection initialization.
@@ -63,16 +76,12 @@ types:
- id: proto_ver_minor
type: u1
- ping:
- doc: Ping does not contain any payload.
-
- pong:
+ auth:
seq:
- - id: timestamp
- doc: |
- Timestamp is set just before sending the pong message. It can be used
- to meassure packet's travel time between server and client.
- type: u8
+ - id: name
+ type: string
+ - id: pass
+ type: string
message:
doc: |