Don't put struct bpf_aux_data there, either.
bpf_filter_with_aux_data() is an internal-only routine, and struct
bpf_aux_data is a data structure subject to change in the future; don't
make them public, so that we *can* change it in the future without
having to worry about breaking APIs or ABIs.
(Note to any upstream packager of libpcap: if you've made it public,
so that it's exported by a shared libary, that was a mistake, so undo
it.)
#include <pcap/pcap-inttypes.h>
#include "pcap-types.h"
-#include "varattrs.h"
#include "extract.h"
#define EXTRACT_SHORT EXTRACT_BE_U_2
#include <sys/time.h>
#endif /* _WIN32 */
-#include <pcap/bpf.h>
+#include <pcap-int.h>
#include <stdlib.h>
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.
+ */
+extern u_int bpf_filter_with_aux_data(const struct bpf_insn *pc,
+ const u_char *p, u_int wirelen, u_int buflen,
+ const struct bpf_aux_data *aux_data);
+
/*
* Internal interfaces for both "pcap_create()" and routines that
* open savefiles.
bpf_u_int32 k;
};
-/*
- * 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;
-};
-
/*
* Macros for insn array initializers.
*/
#if !defined(__NetBSD__) && !defined(__QNX__)
PCAP_API u_int bpf_filter(const struct bpf_insn *, const u_char *, u_int, u_int);
#endif
-extern u_int bpf_filter_with_aux_data(const struct bpf_insn *, const u_char *, u_int, u_int, const struct bpf_aux_data *);
PCAP_API int bpf_validate(const struct bpf_insn *f, int len);
PCAP_API char *bpf_image(const struct bpf_insn *, int);
PCAP_API void bpf_dump(const struct bpf_program *, int);