made basic TCP connection to receive data

somewhat
This commit is contained in:
Andrew Rioux
2023-12-05 00:27:02 -05:00
parent 0bb2871568
commit 8c0ae083fe
13 changed files with 349 additions and 173 deletions

View File

@@ -138,7 +138,9 @@ async fn handle_command(
) -> anyhow::Result<()> {
use pcap_sys::packets::*;
let eth_pkt = eth.pkt();
let Layer3Pkt::IPv4Pkt(ip_pkt) = eth_pkt.get_layer3_pkt()?;
let Layer3Pkt::IPv4Pkt(ip_pkt) = eth_pkt.get_layer3_pkt()? else {
return Ok(());
};
let Layer4Pkt::UDP(udp_pkt) = ip_pkt.get_layer4_packet()? else {
todo!()
};