wip handling root request

This commit is contained in:
2026-01-13 02:32:48 +01:00
parent 8e279d9e24
commit 98fcc1a0b2
8 changed files with 356 additions and 219 deletions

View File

@@ -14,7 +14,7 @@ const OK: u8 = 128;
const ERROR: u8 = 129;
const HELLO: u8 = 1;
const HELLOREPLY: u8 = 130;
const ROOTREQUEST: u8 = 2;
pub const ROOTREQUEST: u8 = 2;
const ROOTREPLY: u8 = 131;
const DATUMREQUEST: u8 = 3;
const NODATUM: u8 = 133;
@@ -46,11 +46,11 @@ pub fn construct_message(
let signature = sign_message(crypto_pair, &message);
return Some(signature);
}
PING | OK => {
PING | OK | ROOTREQUEST => {
message.extend_from_slice(&0u16.to_be_bytes());
return Some(message);
}
ERROR | ROOTREQUEST | DATUMREQUEST => {
ERROR | DATUMREQUEST => {
message.extend_from_slice(&payload.len().to_be_bytes());
message.extend_from_slice(&payload);
return Some(message);