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:
2022-06-05 19:05:49 +02:00
committed by ddidderr
parent d1df76fc5e
commit 6f9e4e9d59
8 changed files with 560 additions and 634 deletions

View File

@ -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();