From 54ddec67c477a6fd73b0f623258c0849ba695b88 Mon Sep 17 00:00:00 2001 From: bt Date: Sat, 14 Mar 2026 23:11:15 +0100 Subject: Basic server implementation --- solec.ksy | 55 ++++++++++++++++++++++++++++++++----------------------- 1 file changed, 32 insertions(+), 23 deletions(-) (limited to 'solec.ksy') 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: | -- cgit v1.2.3