implementation

This commit is contained in:
Tiago Batista Cardoso
2026-01-15 22:01:48 +01:00
committed by TIBERGHIEN corentin
parent 003d55bd75
commit 60145f279a
5 changed files with 181 additions and 95 deletions

View File

@@ -1,7 +1,4 @@
use crate::{
cryptographic_signature::{CryptographicSignature, sign_message},
server_communication::generate_id,
};
use crate::cryptographic_signature::{CryptographicSignature, sign_message};
const ID: usize = 4;
const TYPE: usize = 5;
@@ -9,18 +6,18 @@ const LENGTH: usize = 7;
const EXTENSIONS: usize = 4;
const SIGNATURE: usize = 64;
const PING: u8 = 0;
const OK: u8 = 128;
const ERROR: u8 = 129;
const HELLO: u8 = 1;
const HELLOREPLY: u8 = 130;
pub const ROOTREQUEST: u8 = 2;
const ROOTREPLY: u8 = 131;
const DATUMREQUEST: u8 = 3;
const NODATUM: u8 = 133;
const DATUM: u8 = 132;
const NATTRAVERSALREQUEST: u8 = 4;
const NATTRAVERSALREQUEST2: u8 = 5;
pub(crate) const PING: u8 = 0;
pub(crate) const OK: u8 = 128;
pub(crate) const ERROR: u8 = 129;
pub(crate) const HELLO: u8 = 1;
pub(crate) const HELLOREPLY: u8 = 130;
pub(crate) const ROOTREQUEST: u8 = 2;
pub(crate) const ROOTREPLY: u8 = 131;
pub(crate) const DATUMREQUEST: u8 = 3;
pub(crate) const NODATUM: u8 = 133;
pub(crate) const DATUM: u8 = 132;
pub(crate) const NATTRAVERSALREQUEST: u8 = 4;
pub(crate) const NATTRAVERSALREQUEST2: u8 = 5;
pub fn construct_message(
msgtype: u8,