Create module structure (#29)
Co-authored-by: Tobias Ottenweller <tobi@ottenweller.net> Reviewed-on: #29 Co-authored-by: mice_on_drugs <tobi@ottenweller.net> Co-committed-by: mice_on_drugs <tobi@ottenweller.net>
This commit is contained in:
@ -1,10 +1,11 @@
|
||||
use std::net::UdpSocket;
|
||||
use std::sync::mpsc;
|
||||
use std::thread::{self, JoinHandle};
|
||||
use hexhex::print_hex;
|
||||
use crate::proto::{UdpCoder, Coder};
|
||||
|
||||
mod proto;
|
||||
use hexhex::print_hex;
|
||||
use proto::DNSHeader;
|
||||
mod models;
|
||||
|
||||
fn listen() -> (
|
||||
JoinHandle<()>,
|
||||
@ -38,8 +39,8 @@ fn main() {
|
||||
|
||||
for msg in thread_udp_rx.iter() {
|
||||
print_hex(&msg);
|
||||
let hdr_struct = DNSHeader::from_udp_datagram(&msg).unwrap();
|
||||
dbg!(hdr_struct);
|
||||
let query = UdpCoder::decode(&msg).unwrap();
|
||||
dbg!(query);
|
||||
}
|
||||
|
||||
let _ = thread_udp.join();
|
||||
|
Reference in New Issue
Block a user