diff options
author | Damien Miller <djm@cvs.openbsd.org> | 2005-11-18 11:05:40 +0000 |
---|---|---|
committer | Damien Miller <djm@cvs.openbsd.org> | 2005-11-18 11:05:40 +0000 |
commit | b3d796352917fe2a0f9021b3d370e7fa278210f1 (patch) | |
tree | 0c943c5097ed32c71ced43194d854fcb75db9446 /lib/libpcap/pcap-int.h | |
parent | 237b9b47f2326dabd4a6bddc33123e3a52be6179 (diff) |
pull in the good bits of libpcap-0.9.4's API without the cross-platform
cruft. help from deraadt@, mpf@, jmc@; ok mpf@a
nb. this will break tcpdump unless it updated too
Diffstat (limited to 'lib/libpcap/pcap-int.h')
-rw-r--r-- | lib/libpcap/pcap-int.h | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/lib/libpcap/pcap-int.h b/lib/libpcap/pcap-int.h index a3997831619..e5d2e204b33 100644 --- a/lib/libpcap/pcap-int.h +++ b/lib/libpcap/pcap-int.h @@ -1,4 +1,4 @@ -/* $OpenBSD: pcap-int.h,v 1.9 2001/10/02 18:04:35 deraadt Exp $ */ +/* $OpenBSD: pcap-int.h,v 1.10 2005/11/18 11:05:39 djm Exp $ */ /* * Copyright (c) 1994, 1995, 1996 @@ -32,7 +32,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * @(#) $Header: /cvs/OpenBSD/src/lib/libpcap/pcap-int.h,v 1.9 2001/10/02 18:04:35 deraadt Exp $ (LBL) + * @(#) $Header: /cvs/OpenBSD/src/lib/libpcap/pcap-int.h,v 1.10 2005/11/18 11:05:39 djm Exp $ (LBL) */ #ifndef pcap_int_h @@ -73,6 +73,7 @@ struct pcap { int linktype; int tzoff; /* timezone offset */ int offset; /* offset for proper alignment */ + int break_loop; /* force break from packet-reading loop */ struct pcap_sf sf; struct pcap_md md; @@ -96,6 +97,12 @@ struct pcap { */ struct bpf_program fcode; + /* + * Datalink types supported on underlying fd + */ + int dlt_count; + u_int *dlt_list; + char errbuf[PCAP_ERRBUF_SIZE]; }; @@ -115,6 +122,14 @@ int yylex(void); #define min(a, b) ((a) > (b) ? (b) : (a)) #endif +/* Not all systems have IFF_LOOPBACK */ +#ifdef IFF_LOOPBACK +#define ISLOOPBACK(name, flags) ((flags) & IFF_LOOPBACK) +#else +#define ISLOOPBACK(name, flags) ((name)[0] == 'l' && (name)[1] == 'o' && \ + (isdigit((unsigned char)((name)[2])) || (name)[2] == '\0')) +#endif + /* XXX should these be in pcap.h? */ int pcap_offline_read(pcap_t *, int, pcap_handler, u_char *); int pcap_read(pcap_t *, int cnt, pcap_handler, u_char *); |