]> The Tcpdump Group git mirrors - libpcap/blobdiff - pcap-int.h
Merge branch 'master' into breakloop_poll
[libpcap] / pcap-int.h
index 74cfa7bc3dae840645636a06464f2e833055da98..4bab336fb752a60ecb2acdc8f8f4261a7a3d83c9 100644 (file)
@@ -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);
@@ -481,6 +481,37 @@ int        add_addr_to_if(pcap_if_list_t *, const char *, bpf_u_int32,
 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.