few crypto additions

This commit is contained in:
2025-07-25 16:04:48 +02:00
parent 3e736aaf45
commit 3e4f722b12
7 changed files with 416 additions and 7 deletions
+25
View File
@@ -3,7 +3,32 @@ pub async fn handle_request(
socket: std::sync::Arc<std::net::UdpSocket>,
src: core::net::SocketAddr,
data_len: usize,
server_key_pair: pea_2_pea::shared::crypto::KeyPair,
) {
#[cfg(target_endian = "little")]
buf.reverse();
match buf[0] {
x if x == pea_2_pea::ServerMethods::QUERY as u8 => {
#[cfg(debug_assertions)]
println!("QUERY method");
}
x if x == pea_2_pea::ServerMethods::GET as u8 => {
#[cfg(debug_assertions)]
println!("GET method");
}
x if x == pea_2_pea::ServerMethods::REGISTER as u8 => {
#[cfg(debug_assertions)]
println!("REGISTER method");
}
x if x == pea_2_pea::ServerMethods::HEARTBEAT as u8 => {
#[cfg(debug_assertions)]
println!("HEARTBEAT method");
}
_ => {
#[cfg(debug_assertions)]
println!("Unknown method");
return;
}
}
}