feat: fleshed out handling a new connection
This commit is contained in:
@@ -328,7 +328,7 @@ impl<T: Activated> Interface<T> {
|
||||
|
||||
struct ListenHandler<'a, F>
|
||||
where
|
||||
F: Fn(&Interface<DevListening>, packets::EthernetPkt) -> error::Result<bool>,
|
||||
F: FnMut(&Interface<DevListening>, packets::EthernetPkt) -> error::Result<bool>,
|
||||
{
|
||||
packet_handler: F,
|
||||
break_on_fail: bool,
|
||||
@@ -344,14 +344,14 @@ impl<T: NotListening> Interface<T> {
|
||||
packet_count: i32,
|
||||
) -> (Option<error::Error>, i32)
|
||||
where
|
||||
F: Fn(&Interface<DevListening>, packets::EthernetPkt) -> error::Result<bool>,
|
||||
F: FnMut(&Interface<DevListening>, packets::EthernetPkt) -> error::Result<bool>,
|
||||
{
|
||||
unsafe extern "C" fn cback<F>(
|
||||
user: *mut libc::c_void,
|
||||
header: *const ffi::PktHeader,
|
||||
data: *const u8,
|
||||
) where
|
||||
F: Fn(&Interface<DevListening>, packets::EthernetPkt) -> error::Result<bool>,
|
||||
F: FnMut(&Interface<DevListening>, packets::EthernetPkt) -> error::Result<bool>,
|
||||
{
|
||||
let info = &mut *(user as *mut ListenHandler<F>);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user