feat: added tcp

sorry Judah
This commit is contained in:
Andrew Rioux
2025-02-12 17:49:31 -05:00
parent e388b2eefa
commit f9ff9f266a
37 changed files with 1939 additions and 902 deletions

View File

@@ -78,6 +78,10 @@ impl<'a> EthernetPkt<'a> {
data: self.data.to_vec(),
}
}
pub fn raw(&self) -> &[u8] {
self.data
}
}
pub enum Layer3Pkt<'a> {
@@ -425,6 +429,10 @@ impl EthernetPacket {
pub fn pkt(&'_ self) -> EthernetPkt<'_> {
EthernetPkt { data: &self.data }
}
pub fn from_raw(data: Vec<u8>) -> EthernetPacket {
Self { data }
}
}
#[derive(Clone)]