feat: added modified TCP packet parser

checksum generation code is different, to allow for
some sneaky tricks with regards to identifying the sparse
session but binding to the same port multiple times
This commit is contained in:
Andrew Rioux
2023-09-18 01:29:05 -04:00
parent 25948a17f4
commit e5f6c2aa7e
9 changed files with 137 additions and 21 deletions

View File

@@ -139,7 +139,9 @@ async fn handle_command(
use pcap_sys::packets::*;
let eth_pkt = eth.pkt();
let Layer3Pkt::IPv4Pkt(ip_pkt) = eth_pkt.get_layer3_pkt()?;
let Layer4Pkt::UDP(udp_pkt) = ip_pkt.get_layer4_packet()?;
let Layer4Pkt::UDP(udp_pkt) = ip_pkt.get_layer4_packet()? else {
todo!()
};
let source_port = udp_pkt.srcport();