feat: added basic structure around packet transfer

This commit is contained in:
Andrew Rioux
2023-09-25 23:24:37 -04:00
parent 867464f673
commit 0bda72491c
3 changed files with 154 additions and 16 deletions

View File

@@ -450,6 +450,18 @@ impl<T: Activated> InterfaceStream<T> {
pub fn sendpacket(&mut self, packet: packets::EthernetPkt) -> error::Result<()> {
self.inner.get_mut().interface.sendpacket(packet)
}
pub fn set_filter(
&mut self,
filter: &str,
optimize: bool,
mask: Option<u32>,
) -> error::Result<Box<ffi::BpfProgram>> {
self.inner
.get_mut()
.interface
.set_filter(filter, optimize, mask)
}
}
impl<T: Activated> Unpin for InterfaceStream<T> {}