rest of previous commit
This commit is contained in:
parent
49e3aa1a3a
commit
0235de2896
10
src/lib.rs
10
src/lib.rs
@ -65,4 +65,14 @@ pub enum RegisterRequestDataPositions {
|
||||
DATA = (SALT_AND_IV_SIZE + RegisterRequestDataPositions::IV as u8) as isize, // after this there will be id and sockaddr in string or encrypted form after
|
||||
}
|
||||
|
||||
#[allow(non_camel_case_types)]
|
||||
pub enum GetResponseDataPositions {
|
||||
ENCRYPTED = 1, // this feeld should be 0 if not encrypted
|
||||
ID_LEN = 2,
|
||||
NUM_OF_CLIENTS = 3,
|
||||
SALT = 4,
|
||||
CLIENTS = (SALT_AND_IV_SIZE + RegisterRequestDataPositions::SALT as u8) as isize,
|
||||
// after this there will be blocks of this sturcture: one byte size of sockaddr than there will be IV that is SALT_AND_IV_SIZE long and after that there will be sockaddr this repeats until the end of packet
|
||||
}
|
||||
|
||||
pub mod shared;
|
||||
|
@ -9,7 +9,7 @@ use rayon::prelude::*;
|
||||
use std::sync::Arc;
|
||||
use std::u8;
|
||||
pub async fn handle_request(
|
||||
mut buf: [u8; BUFFER_SIZE],
|
||||
buf: [u8; BUFFER_SIZE],
|
||||
socket: std::sync::Arc<std::net::UdpSocket>,
|
||||
src: core::net::SocketAddr,
|
||||
data_len: usize,
|
||||
|
@ -1,6 +1,7 @@
|
||||
use pea_2_pea::*;
|
||||
use std::sync::{Arc, atomic::Ordering};
|
||||
|
||||
#[derive(Clone)]
|
||||
#[readonly::make]
|
||||
pub struct Client {
|
||||
#[readonly]
|
||||
@ -19,7 +20,7 @@ impl Client {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone)]
|
||||
#[readonly::make]
|
||||
pub struct Registration {
|
||||
#[readonly]
|
||||
|
Loading…
x
Reference in New Issue
Block a user