pub fn inject(&mut self, data: &[u8]) -> Result<usize> {
        let ptr = data.as_ptr() as *const c_void;
        let ret = unsafe {
            pcap_inject(self.h, ptr, data.len() as size_t)
        };

        if ret < 0 {
            Err(PcapError::from_pcap(self.h))
        } else {
            Ok(ret as usize)
        }
    }
/// Inject a given raw packet.
Inject a given raw packet.
Inject a given raw packet .
pub fn inject(&mut self, data: &[u8]) -> Result<usize> {
        let ptr = data.as_ptr() as *const c_void;
        let ret = unsafe {
            pcap_inject(self.h, ptr, data.len() as size_t)
        };
        if ret < 0 {
            Err(PcapError::from_pcap(self.h))
        } else {
            Ok(ret as usize)
        }
    }
pub fn inject ( & mut self , data : & [ u8 ] ) -> Result < usize > { let ptr = data . as_ptr ( ) as * const c_void ; let ret = unsafe { pcap_inject ( self . h , ptr , data . len ( ) as size_t ) } ; if ret < 0 { Err ( PcapError :: from_pcap ( self . h ) ) } else { Ok ( ret as usize ) } }
Inject a given raw packet.
Inject a given raw packet .
&mut self
data
&[u8]
&mut self
data
&[u8]