/// Compile a given filter string.
Compile a given filter string.
Compile a given filter string .
unsafe fn compile_filter(&mut self, f: &str) -> Result<bpf_program> {
        let _lock = self.pc.lock()
            .unwrap();
        let f_cstr = CString::new(f).unwrap();
        let f_ptr = f_cstr.as_ptr() as *const c_char;
        let mut prog = bpf_program::new();
        match pcap_compile(self.h, &mut prog, f_ptr, 0, 0) {
            0 => Ok(prog),
            _ => Err(PcapError::from_pcap(self.h))
        }
    }
unsafe fn compile_filter ( & mut self , f : & str ) -> Result < bpf_program > { let _lock = self . pc . lock ( ) . unwrap ( ) ; let f_cstr = CString :: new ( f ) . unwrap ( ) ; let f_ptr = f_cstr . as_ptr ( ) as * const c_char ; let mut prog = bpf_program :: new ( ) ; match pcap_compile ( self . h , & mut prog , f_ptr , 0 , 0 ) { 0 => Ok ( prog ) , _ => Err ( PcapError :: from_pcap ( self . h ) ) } }
Compile a given filter string.
Compile a given filter string .
&mut self
f
&str