From 34fc7212ef5cd746f9da442f5990678d74fc13d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tristan=20=F0=9F=85=B1=2E=20Kildaire?= <21629986@sun.ac.za> Date: Wed, 23 Sep 2020 10:33:19 +0200 Subject: [PATCH] Updated protocol --- protocol.md | 33 ++++++++++++++++++++++++++++++--- 1 file changed, 30 insertions(+), 3 deletions(-) diff --git a/protocol.md b/protocol.md index da6a500..1aa1933 100644 --- a/protocol.md +++ b/protocol.md @@ -1,7 +1,34 @@ dnet protocol specification =========================== --- Command listing -- +## Preamble + +Every command starts with a 1 byte code specifying the command. + +``` +|-- command (1 byte) --|-- dependant on command (n bytes) --| +``` + +## Command listing (client/server->server) + +1. `auth` - authenticate a new client +2. `link` - authenticate a new server + +## Client/Server types (server->server/client) + +1. `msg` - new message + +## Commands + +### `auth` + +``` +|-- 0 --|-- username (null-terminated) --|-- password (null-terminated)--| +``` + +### `link` + +``` +|-- 0 --|-- todo +``` -1. `auth` -2. `link` \ No newline at end of file