diff options
author | Guy Harris <guy@alum.mit.edu> | 2018-09-14 15:48:41 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-09-14 15:48:41 -0700 |
commit | 2cf306cadde4c6ba5d7af299cd347aabdfe24cf7 (patch) | |
tree | ac8baace7470dac9dedd9b33fbaaaa3347e40f7b /pcap-int.h | |
parent | 5c8b13d3e87542527ed9a3a79fb0f9b2edb74df1 (diff) | |
parent | 72ee65e9a0dbc0ff8a91cdf24fb446de62429b94 (diff) |
Merge branch 'master' into breakloop_poll
Diffstat (limited to 'pcap-int.h')
-rw-r--r-- | pcap-int.h | 33 |
1 files changed, 32 insertions, 1 deletions
@@ -118,7 +118,7 @@ typedef int (*activate_op_t)(pcap_t *); typedef int (*can_set_rfmon_op_t)(pcap_t *); typedef int (*read_op_t)(pcap_t *, int cnt, pcap_handler, u_char *); typedef int (*next_packet_op_t)(pcap_t *, struct pcap_pkthdr *, u_char **); -typedef int (*inject_op_t)(pcap_t *, const void *, size_t); +typedef int (*inject_op_t)(pcap_t *, const void *, int); typedef void (*save_current_filter_op_t)(pcap_t *, const char *); typedef int (*setfilter_op_t)(pcap_t *, struct bpf_program *); typedef int (*setdirection_op_t)(pcap_t *, pcap_direction_t); @@ -482,6 +482,37 @@ pcap_t *pcap_open_offline_common(char *ebuf, size_t size); void sf_cleanup(pcap_t *p); /* + * Internal interfaces for doing user-mode filtering of packets and + * validating filter programs. + */ +/* + * Auxiliary data, for use when interpreting a filter intended for the + * Linux kernel when the kernel rejects the filter (requiring us to + * run it in userland). It contains VLAN tag information. + */ +struct bpf_aux_data { + u_short vlan_tag_present; + u_short vlan_tag; +}; + +/* + * Filtering routine that takes the auxiliary data as an additional + * argument. + */ +u_int pcap_filter_with_aux_data(const struct bpf_insn *, + const u_char *, u_int, u_int, const struct bpf_aux_data *); + +/* + * Filtering routine that doesn't. + */ +u_int pcap_filter(const struct bpf_insn *, const u_char *, u_int, u_int); + +/* + * Routine to validate a BPF program. + */ +int pcap_validate_filter(const struct bpf_insn *, int); + +/* * Internal interfaces for both "pcap_create()" and routines that * open savefiles. * |