Struct dnstplib::processor::request::RequestProcesor
source · pub struct RequestProcesor {
message_channel: Option<Sender<NetworkMessagePtr>>,
domain_config: DomainConfig,
encryption_endpoint: String,
clients: Arc<Mutex<Clients>>,
}
Fields§
§message_channel: Option<Sender<NetworkMessagePtr>>
§domain_config: DomainConfig
§encryption_endpoint: String
§clients: Arc<Mutex<Clients>>
Implementations§
source§impl RequestProcesor
impl RequestProcesor
pub fn handle_upload_request( r: DNSMessage, _sending_channel: &Sender<NetworkMessagePtr>, clients: &Arc<Mutex<Clients>>, peer: SocketAddr, )
source§impl RequestProcesor
impl RequestProcesor
pub fn handle_download_request( r: DNSMessage, _sending_channel: &Sender<NetworkMessagePtr>, clients: &Arc<Mutex<Clients>>, peer: SocketAddr, )
source§impl RequestProcesor
impl RequestProcesor
pub fn new(domain_config: DomainConfig) -> RequestProcesor
sourcepub fn run(&mut self, sending_channel: Sender<NetworkMessagePtr>)
pub fn run(&mut self, sending_channel: Sender<NetworkMessagePtr>)
Spin a thread to process parsed DNS requests and respond as appropriate
sourcefn handle_dnstp_request(
r: DNSMessage,
sending_channel: &Sender<NetworkMessagePtr>,
clients: &Arc<Mutex<Clients>>,
peer: SocketAddr,
fq_key_endpoint: &String,
)
fn handle_dnstp_request( r: DNSMessage, sending_channel: &Sender<NetworkMessagePtr>, clients: &Arc<Mutex<Clients>>, peer: SocketAddr, fq_key_endpoint: &String, )
The message is trying to do some dnstp, work out whether it’s hello handshaking, uplaoding or downloading data and handoff the message to that workflow
sourcefn handle_encryption_handshake(
r: DNSMessage,
sending_channel: &Sender<NetworkMessagePtr>,
clients: &Arc<Mutex<Clients>>,
peer: SocketAddr,
)
fn handle_encryption_handshake( r: DNSMessage, sending_channel: &Sender<NetworkMessagePtr>, clients: &Arc<Mutex<Clients>>, peer: SocketAddr, )
Process a hello message from a new client with a public key and send the response.
Generate a key pair and repspond with the public key, generate the shared secret and store this in the connected clients.
pub fn get_message_channel(&mut self) -> Option<Sender<NetworkMessagePtr>>
pub fn send_protocol_error( error_code: RequestError, r: &DNSMessage, sending_channel: &Sender<NetworkMessagePtr>, )
Auto Trait Implementations§
impl Freeze for RequestProcesor
impl RefUnwindSafe for RequestProcesor
impl Send for RequestProcesor
impl Sync for RequestProcesor
impl Unpin for RequestProcesor
impl UnwindSafe for RequestProcesor
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more