00001 #include <pcap.h> 00002 #include <pcap-bpf.h> 00003 #ifdef __cplusplus 00004 extern "C" { 00005 #endif 00006 typedef unsigned int (*bpf_run_t)(unsigned char *packet, unsigned int length); 00007 00008 typedef struct bpf_jit_t { 00009 bpf_run_t bpf_run; 00010 } bpf_jit_t; 00011 00012 bpf_jit_t *compile_program(struct bpf_insn insns[], int plen); 00013 void destroy_program(struct bpf_jit_t *bpf_jit); 00014 00015 #ifdef __cplusplus 00016 } 00017 #endif 00018