diff options
author | guy <guy> | 2003-03-08 09:21:37 +0000 |
---|---|---|
committer | guy <guy> | 2003-03-08 09:21:37 +0000 |
commit | d5c3be9ab662fcbe3a8ab0973b8d1a564279f171 (patch) | |
tree | 41fedbc1be66d2c3957eb1f6f1d503fa337f47d8 /pcap-bpf.h | |
parent | cb73be054975158e069d620c4bc8300c3fc9950c (diff) | |
download | libpcap-d5c3be9ab662fcbe3a8ab0973b8d1a564279f171.tar.gz |
FreeBSD also defines DLT_SLIP_BSDOS as 13 and DLT_PPP_BSDOS as 14, so we
define them that way on FreeBSD as well as NetBSD.
Diffstat (limited to 'pcap-bpf.h')
-rw-r--r-- | pcap-bpf.h | 38 |
1 files changed, 13 insertions, 25 deletions
@@ -37,7 +37,7 @@ * * @(#)bpf.h 7.1 (Berkeley) 5/7/91 * - * @(#) $Header: /tcpdump/master/libpcap/pcap-bpf.h,v 1.4 2003-03-08 09:13:39 guy Exp $ (LBL) + * @(#) $Header: /tcpdump/master/libpcap/pcap-bpf.h,v 1.5 2003-03-08 09:21:37 guy Exp $ (LBL) */ /* @@ -110,14 +110,8 @@ struct bpf_version { */ /* - * These are the types that are the same on all platforms; on other - * platforms, a <net/bpf.h> should be supplied that defines the additional - * DLT_* codes appropriately for that platform (the BSDs, for example, - * should not just pick up this version of "bpf.h"; they should also define - * the additional DLT_* codes used by their kernels, as well as the values - * defined here - and, if the values they use for particular DLT_ types - * differ from those here, they should use their values, not the ones - * here). + * These are the types that are the same on all platforms, and that + * have been defined by <net/bpf.h> for ages. */ #define DLT_NULL 0 /* no link-layer encapsulation */ #define DLT_EN10MB 1 /* Ethernet (10Mb) */ @@ -132,15 +126,16 @@ struct bpf_version { #define DLT_FDDI 10 /* FDDI */ /* - * These are values from the traditional libpcap "bpf.h". - * Ports of this to particular platforms should replace these definitions - * with the ones appropriate to that platform, if the values are - * different on that platform. + * These are types that are different on some platforms, and that + * have been defined by <net/bpf.h> for ages. We use #ifdefs to + * detect the BSDs that define them differently from the traditional + * libpcap <net/bpf.h> * * XXX - DLT_ATM_RFC1483 is 13 in BSD/OS, and DLT_RAW is 14 in BSD/OS, * but I don't know what the right #define is for BSD/OS. */ #define DLT_ATM_RFC1483 11 /* LLC/SNAP encapsulated atm */ + #ifdef __OpenBSD__ #define DLT_RAW 14 /* raw IP */ #else @@ -148,19 +143,12 @@ struct bpf_version { #endif /* - * These are values from BSD/OS's "bpf.h". - * These are not the same as the values from the traditional libpcap - * "bpf.h"; however, these values shouldn't be generated by any - * OS other than BSD/OS, so the correct values to use here are the - * BSD/OS values. - * - * Platforms that have already assigned these values to other - * DLT_ codes, however, should give these codes the values - * from that platform, so that programs that use these codes will - * continue to compile - even though they won't correctly read - * files of these types. + * Given that the only OS that currently generates BSD/OS SLIP or PPP + * is, well, BSD/OS, arguably everybody should have chosen its values + * for DLT_SLIP_BSDOS and DLT_PPP_BSDOS, which are 15 and 16, but they + * didn't. So it goes. */ -#ifdef __NetBSD__ +#if defined(__NetBSD__) || defined(__FreeBSD__) #ifndef DLT_SLIP_BSDOS #define DLT_SLIP_BSDOS 13 /* BSD/OS Serial Line IP */ #define DLT_PPP_BSDOS 14 /* BSD/OS Point-to-point Protocol */ |