]> git.sur5r.net Git - freertos/blobdiff - FreeRTOS-Labs/Demo/FreeRTOS_IoT_Libraries/utilities/task_pool/WinPCap/pcap/bpf.h
Add the Labs projects provided in the V10.2.1_191129 zip file.
[freertos] / FreeRTOS-Labs / Demo / FreeRTOS_IoT_Libraries / utilities / task_pool / WinPCap / pcap / bpf.h
diff --git a/FreeRTOS-Labs/Demo/FreeRTOS_IoT_Libraries/utilities/task_pool/WinPCap/pcap/bpf.h b/FreeRTOS-Labs/Demo/FreeRTOS_IoT_Libraries/utilities/task_pool/WinPCap/pcap/bpf.h
new file mode 100644 (file)
index 0000000..b6d2596
--- /dev/null
@@ -0,0 +1,934 @@
+/*-\r
+ * Copyright (c) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997\r
+ *     The Regents of the University of California.  All rights reserved.\r
+ *\r
+ * This code is derived from the Stanford/CMU enet packet filter,\r
+ * (net/enet.c) distributed as part of 4.3BSD, and code contributed\r
+ * to Berkeley by Steven McCanne and Van Jacobson both of Lawrence \r
+ * Berkeley Laboratory.\r
+ *\r
+ * Redistribution and use in source and binary forms, with or without\r
+ * modification, are permitted provided that the following conditions\r
+ * are met:\r
+ * 1. Redistributions of source code must retain the above copyright\r
+ *    notice, this list of conditions and the following disclaimer.\r
+ * 2. Redistributions in binary form must reproduce the above copyright\r
+ *    notice, this list of conditions and the following disclaimer in the\r
+ *    documentation and/or other materials provided with the distribution.\r
+ * 3. All advertising materials mentioning features or use of this software\r
+ *    must display the following acknowledgement:\r
+ *      This product includes software developed by the University of\r
+ *      California, Berkeley and its contributors.\r
+ * 4. Neither the name of the University nor the names of its contributors\r
+ *    may be used to endorse or promote products derived from this software\r
+ *    without specific prior written permission.\r
+ *\r
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND\r
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\r
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\r
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE\r
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\r
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS\r
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\r
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\r
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY\r
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\r
+ * SUCH DAMAGE.\r
+ *\r
+ *      @(#)bpf.h       7.1 (Berkeley) 5/7/91\r
+ *\r
+ * @(#) $Header: /tcpdump/master/libpcap/pcap/bpf.h,v 1.19.2.8 2008-09-22 20:16:01 guy Exp $ (LBL)\r
+ */\r
+\r
+/*\r
+ * This is libpcap's cut-down version of bpf.h; it includes only\r
+ * the stuff needed for the code generator and the userland BPF\r
+ * interpreter, and the libpcap APIs for setting filters, etc..\r
+ *\r
+ * "pcap-bpf.c" will include the native OS version, as it deals with\r
+ * the OS's BPF implementation.\r
+ *\r
+ * XXX - should this all just be moved to "pcap.h"?\r
+ */\r
+\r
+#ifndef BPF_MAJOR_VERSION\r
+\r
+#ifdef __cplusplus\r
+extern "C" {\r
+#endif\r
+\r
+/* BSD style release date */\r
+#define BPF_RELEASE 199606\r
+\r
+#ifdef MSDOS /* must be 32-bit */\r
+typedef long          bpf_int32;\r
+typedef unsigned long bpf_u_int32;\r
+#else\r
+typedef        int bpf_int32;\r
+typedef        u_int bpf_u_int32;\r
+#endif\r
+\r
+/*\r
+ * Alignment macros.  BPF_WORDALIGN rounds up to the next \r
+ * even multiple of BPF_ALIGNMENT. \r
+ */\r
+#ifndef __NetBSD__\r
+#define BPF_ALIGNMENT sizeof(bpf_int32)\r
+#else\r
+#define BPF_ALIGNMENT sizeof(long)\r
+#endif\r
+#define BPF_WORDALIGN(x) (((x)+(BPF_ALIGNMENT-1))&~(BPF_ALIGNMENT-1))\r
+\r
+#define BPF_MAXBUFSIZE 0x8000\r
+#define BPF_MINBUFSIZE 32\r
+\r
+/*\r
+ * Structure for "pcap_compile()", "pcap_setfilter()", etc..\r
+ */\r
+struct bpf_program {\r
+       u_int bf_len;\r
+       struct bpf_insn *bf_insns;\r
+};\r
\r
+/*\r
+ * Struct return by BIOCVERSION.  This represents the version number of \r
+ * the filter language described by the instruction encodings below.\r
+ * bpf understands a program iff kernel_major == filter_major &&\r
+ * kernel_minor >= filter_minor, that is, if the value returned by the\r
+ * running kernel has the same major number and a minor number equal\r
+ * equal to or less than the filter being downloaded.  Otherwise, the\r
+ * results are undefined, meaning an error may be returned or packets\r
+ * may be accepted haphazardly.\r
+ * It has nothing to do with the source code version.\r
+ */\r
+struct bpf_version {\r
+       u_short bv_major;\r
+       u_short bv_minor;\r
+};\r
+/* Current version number of filter architecture. */\r
+#define BPF_MAJOR_VERSION 1\r
+#define BPF_MINOR_VERSION 1\r
+\r
+/*\r
+ * Data-link level type codes.\r
+ *\r
+ * Do *NOT* add new values to this list without asking\r
+ * "tcpdump-workers@lists.tcpdump.org" for a value.  Otherwise, you run\r
+ * the risk of using a value that's already being used for some other\r
+ * purpose, and of having tools that read libpcap-format captures not\r
+ * being able to handle captures with your new DLT_ value, with no hope\r
+ * that they will ever be changed to do so (as that would destroy their\r
+ * ability to read captures using that value for that other purpose).\r
+ */\r
+\r
+/*\r
+ * These are the types that are the same on all platforms, and that\r
+ * have been defined by <net/bpf.h> for ages.\r
+ */\r
+#define DLT_NULL       0       /* BSD loopback encapsulation */\r
+#define DLT_EN10MB     1       /* Ethernet (10Mb) */\r
+#define DLT_EN3MB      2       /* Experimental Ethernet (3Mb) */\r
+#define DLT_AX25       3       /* Amateur Radio AX.25 */\r
+#define DLT_PRONET     4       /* Proteon ProNET Token Ring */\r
+#define DLT_CHAOS      5       /* Chaos */\r
+#define DLT_IEEE802    6       /* 802.5 Token Ring */\r
+#define DLT_ARCNET     7       /* ARCNET, with BSD-style header */\r
+#define DLT_SLIP       8       /* Serial Line IP */\r
+#define DLT_PPP                9       /* Point-to-point Protocol */\r
+#define DLT_FDDI       10      /* FDDI */\r
+\r
+/*\r
+ * These are types that are different on some platforms, and that\r
+ * have been defined by <net/bpf.h> for ages.  We use #ifdefs to\r
+ * detect the BSDs that define them differently from the traditional\r
+ * libpcap <net/bpf.h>\r
+ *\r
+ * XXX - DLT_ATM_RFC1483 is 13 in BSD/OS, and DLT_RAW is 14 in BSD/OS,\r
+ * but I don't know what the right #define is for BSD/OS.\r
+ */\r
+#define DLT_ATM_RFC1483        11      /* LLC-encapsulated ATM */\r
+\r
+#ifdef __OpenBSD__\r
+#define DLT_RAW                14      /* raw IP */\r
+#else\r
+#define DLT_RAW                12      /* raw IP */\r
+#endif\r
+\r
+/*\r
+ * Given that the only OS that currently generates BSD/OS SLIP or PPP\r
+ * is, well, BSD/OS, arguably everybody should have chosen its values\r
+ * for DLT_SLIP_BSDOS and DLT_PPP_BSDOS, which are 15 and 16, but they\r
+ * didn't.  So it goes.\r
+ */\r
+#if defined(__NetBSD__) || defined(__FreeBSD__)\r
+#ifndef DLT_SLIP_BSDOS\r
+#define DLT_SLIP_BSDOS 13      /* BSD/OS Serial Line IP */\r
+#define DLT_PPP_BSDOS  14      /* BSD/OS Point-to-point Protocol */\r
+#endif\r
+#else\r
+#define DLT_SLIP_BSDOS 15      /* BSD/OS Serial Line IP */\r
+#define DLT_PPP_BSDOS  16      /* BSD/OS Point-to-point Protocol */\r
+#endif\r
+\r
+/*\r
+ * 17 is used for DLT_OLD_PFLOG in OpenBSD;\r
+ *     OBSOLETE: DLT_PFLOG is 117 in OpenBSD now as well. See below.\r
+ * 18 is used for DLT_PFSYNC in OpenBSD; don't use it for anything else.\r
+ */\r
+\r
+#define DLT_ATM_CLIP   19      /* Linux Classical-IP over ATM */\r
+\r
+/*\r
+ * Apparently Redback uses this for its SmartEdge 400/800.  I hope\r
+ * nobody else decided to use it, too.\r
+ */\r
+#define DLT_REDBACK_SMARTEDGE  32\r
+\r
+/*\r
+ * These values are defined by NetBSD; other platforms should refrain from\r
+ * using them for other purposes, so that NetBSD savefiles with link\r
+ * types of 50 or 51 can be read as this type on all platforms.\r
+ */\r
+#define DLT_PPP_SERIAL 50      /* PPP over serial with HDLC encapsulation */\r
+#define DLT_PPP_ETHER  51      /* PPP over Ethernet */\r
+\r
+/*\r
+ * The Axent Raptor firewall - now the Symantec Enterprise Firewall - uses\r
+ * a link-layer type of 99 for the tcpdump it supplies.  The link-layer\r
+ * header has 6 bytes of unknown data, something that appears to be an\r
+ * Ethernet type, and 36 bytes that appear to be 0 in at least one capture\r
+ * I've seen.\r
+ */\r
+#define DLT_SYMANTEC_FIREWALL  99\r
+\r
+/*\r
+ * Values between 100 and 103 are used in capture file headers as\r
+ * link-layer types corresponding to DLT_ types that differ\r
+ * between platforms; don't use those values for new DLT_ new types.\r
+ */\r
+\r
+/*\r
+ * This value was defined by libpcap 0.5; platforms that have defined\r
+ * it with a different value should define it here with that value -\r
+ * a link type of 104 in a save file will be mapped to DLT_C_HDLC,\r
+ * whatever value that happens to be, so programs will correctly\r
+ * handle files with that link type regardless of the value of\r
+ * DLT_C_HDLC.\r
+ *\r
+ * The name DLT_C_HDLC was used by BSD/OS; we use that name for source\r
+ * compatibility with programs written for BSD/OS.\r
+ *\r
+ * libpcap 0.5 defined it as DLT_CHDLC; we define DLT_CHDLC as well,\r
+ * for source compatibility with programs written for libpcap 0.5.\r
+ */\r
+#define DLT_C_HDLC     104     /* Cisco HDLC */\r
+#define DLT_CHDLC      DLT_C_HDLC\r
+\r
+#define DLT_IEEE802_11 105     /* IEEE 802.11 wireless */\r
+\r
+/*\r
+ * 106 is reserved for Linux Classical IP over ATM; it's like DLT_RAW,\r
+ * except when it isn't.  (I.e., sometimes it's just raw IP, and\r
+ * sometimes it isn't.)  We currently handle it as DLT_LINUX_SLL,\r
+ * so that we don't have to worry about the link-layer header.)\r
+ */\r
+\r
+/*\r
+ * Frame Relay; BSD/OS has a DLT_FR with a value of 11, but that collides\r
+ * with other values.\r
+ * DLT_FR and DLT_FRELAY packets start with the Q.922 Frame Relay header\r
+ * (DLCI, etc.).\r
+ */\r
+#define DLT_FRELAY     107\r
+\r
+/*\r
+ * OpenBSD DLT_LOOP, for loopback devices; it's like DLT_NULL, except\r
+ * that the AF_ type in the link-layer header is in network byte order.\r
+ *\r
+ * DLT_LOOP is 12 in OpenBSD, but that's DLT_RAW in other OSes, so\r
+ * we don't use 12 for it in OSes other than OpenBSD.\r
+ */\r
+#ifdef __OpenBSD__\r
+#define DLT_LOOP       12\r
+#else\r
+#define DLT_LOOP       108\r
+#endif\r
+\r
+/*\r
+ * Encapsulated packets for IPsec; DLT_ENC is 13 in OpenBSD, but that's\r
+ * DLT_SLIP_BSDOS in NetBSD, so we don't use 13 for it in OSes other\r
+ * than OpenBSD.\r
+ */\r
+#ifdef __OpenBSD__\r
+#define DLT_ENC                13\r
+#else\r
+#define DLT_ENC                109\r
+#endif\r
+\r
+/*\r
+ * Values between 110 and 112 are reserved for use in capture file headers\r
+ * as link-layer types corresponding to DLT_ types that might differ\r
+ * between platforms; don't use those values for new DLT_ types\r
+ * other than the corresponding DLT_ types.\r
+ */\r
+\r
+/*\r
+ * This is for Linux cooked sockets.\r
+ */\r
+#define DLT_LINUX_SLL  113\r
+\r
+/*\r
+ * Apple LocalTalk hardware.\r
+ */\r
+#define DLT_LTALK      114\r
+\r
+/*\r
+ * Acorn Econet.\r
+ */\r
+#define DLT_ECONET     115\r
+\r
+/*\r
+ * Reserved for use with OpenBSD ipfilter.\r
+ */\r
+#define DLT_IPFILTER   116\r
+\r
+/*\r
+ * OpenBSD DLT_PFLOG; DLT_PFLOG is 17 in OpenBSD, but that's DLT_LANE8023\r
+ * in SuSE 6.3, so we can't use 17 for it in capture-file headers.\r
+ *\r
+ * XXX: is there a conflict with DLT_PFSYNC 18 as well?\r
+ */\r
+#ifdef __OpenBSD__\r
+#define DLT_OLD_PFLOG  17\r
+#define DLT_PFSYNC     18\r
+#endif\r
+#define DLT_PFLOG      117\r
+\r
+/*\r
+ * Registered for Cisco-internal use.\r
+ */\r
+#define DLT_CISCO_IOS  118\r
+\r
+/*\r
+ * For 802.11 cards using the Prism II chips, with a link-layer\r
+ * header including Prism monitor mode information plus an 802.11\r
+ * header.\r
+ */\r
+#define DLT_PRISM_HEADER       119\r
+\r
+/*\r
+ * Reserved for Aironet 802.11 cards, with an Aironet link-layer header\r
+ * (see Doug Ambrisko's FreeBSD patches).\r
+ */\r
+#define DLT_AIRONET_HEADER     120\r
+\r
+/*\r
+ * Reserved for Siemens HiPath HDLC.\r
+ */\r
+#define DLT_HHDLC              121\r
+\r
+/*\r
+ * This is for RFC 2625 IP-over-Fibre Channel.\r
+ *\r
+ * This is not for use with raw Fibre Channel, where the link-layer\r
+ * header starts with a Fibre Channel frame header; it's for IP-over-FC,\r
+ * where the link-layer header starts with an RFC 2625 Network_Header\r
+ * field.\r
+ */\r
+#define DLT_IP_OVER_FC         122\r
+\r
+/*\r
+ * This is for Full Frontal ATM on Solaris with SunATM, with a\r
+ * pseudo-header followed by an AALn PDU.\r
+ *\r
+ * There may be other forms of Full Frontal ATM on other OSes,\r
+ * with different pseudo-headers.\r
+ *\r
+ * If ATM software returns a pseudo-header with VPI/VCI information\r
+ * (and, ideally, packet type information, e.g. signalling, ILMI,\r
+ * LANE, LLC-multiplexed traffic, etc.), it should not use\r
+ * DLT_ATM_RFC1483, but should get a new DLT_ value, so tcpdump\r
+ * and the like don't have to infer the presence or absence of a\r
+ * pseudo-header and the form of the pseudo-header.\r
+ */\r
+#define DLT_SUNATM             123     /* Solaris+SunATM */\r
+\r
+/* \r
+ * Reserved as per request from Kent Dahlgren <kent@praesum.com>\r
+ * for private use.\r
+ */\r
+#define DLT_RIO                 124     /* RapidIO */\r
+#define DLT_PCI_EXP             125     /* PCI Express */\r
+#define DLT_AURORA              126     /* Xilinx Aurora link layer */\r
+\r
+/*\r
+ * Header for 802.11 plus a number of bits of link-layer information\r
+ * including radio information, used by some recent BSD drivers as\r
+ * well as the madwifi Atheros driver for Linux.\r
+ */\r
+#define DLT_IEEE802_11_RADIO   127     /* 802.11 plus radiotap radio header */\r
+\r
+/*\r
+ * Reserved for the TZSP encapsulation, as per request from\r
+ * Chris Waters <chris.waters@networkchemistry.com>\r
+ * TZSP is a generic encapsulation for any other link type,\r
+ * which includes a means to include meta-information\r
+ * with the packet, e.g. signal strength and channel\r
+ * for 802.11 packets.\r
+ */\r
+#define DLT_TZSP                128     /* Tazmen Sniffer Protocol */\r
+\r
+/*\r
+ * BSD's ARCNET headers have the source host, destination host,\r
+ * and type at the beginning of the packet; that's what's handed\r
+ * up to userland via BPF.\r
+ *\r
+ * Linux's ARCNET headers, however, have a 2-byte offset field\r
+ * between the host IDs and the type; that's what's handed up\r
+ * to userland via PF_PACKET sockets.\r
+ *\r
+ * We therefore have to have separate DLT_ values for them.\r
+ */\r
+#define DLT_ARCNET_LINUX       129     /* ARCNET */\r
+\r
+/*\r
+ * Juniper-private data link types, as per request from\r
+ * Hannes Gredler <hannes@juniper.net>.  The DLT_s are used\r
+ * for passing on chassis-internal metainformation such as\r
+ * QOS profiles, etc..\r
+ */\r
+#define DLT_JUNIPER_MLPPP       130\r
+#define DLT_JUNIPER_MLFR        131\r
+#define DLT_JUNIPER_ES          132\r
+#define DLT_JUNIPER_GGSN        133\r
+#define DLT_JUNIPER_MFR         134\r
+#define DLT_JUNIPER_ATM2        135\r
+#define DLT_JUNIPER_SERVICES    136\r
+#define DLT_JUNIPER_ATM1        137\r
+\r
+/*\r
+ * Apple IP-over-IEEE 1394, as per a request from Dieter Siegmund\r
+ * <dieter@apple.com>.  The header that's presented is an Ethernet-like\r
+ * header:\r
+ *\r
+ *     #define FIREWIRE_EUI64_LEN      8\r
+ *     struct firewire_header {\r
+ *             u_char  firewire_dhost[FIREWIRE_EUI64_LEN];\r
+ *             u_char  firewire_shost[FIREWIRE_EUI64_LEN];\r
+ *             u_short firewire_type;\r
+ *     };\r
+ *\r
+ * with "firewire_type" being an Ethernet type value, rather than,\r
+ * for example, raw GASP frames being handed up.\r
+ */\r
+#define DLT_APPLE_IP_OVER_IEEE1394     138\r
+\r
+/*\r
+ * Various SS7 encapsulations, as per a request from Jeff Morriss\r
+ * <jeff.morriss[AT]ulticom.com> and subsequent discussions.\r
+ */\r
+#define DLT_MTP2_WITH_PHDR     139     /* pseudo-header with various info, followed by MTP2 */\r
+#define DLT_MTP2               140     /* MTP2, without pseudo-header */\r
+#define DLT_MTP3               141     /* MTP3, without pseudo-header or MTP2 */\r
+#define DLT_SCCP               142     /* SCCP, without pseudo-header or MTP2 or MTP3 */\r
+\r
+/*\r
+ * DOCSIS MAC frames.\r
+ */\r
+#define DLT_DOCSIS             143\r
+\r
+/*\r
+ * Linux-IrDA packets. Protocol defined at http://www.irda.org.\r
+ * Those packets include IrLAP headers and above (IrLMP...), but\r
+ * don't include Phy framing (SOF/EOF/CRC & byte stuffing), because Phy\r
+ * framing can be handled by the hardware and depend on the bitrate.\r
+ * This is exactly the format you would get capturing on a Linux-IrDA\r
+ * interface (irdaX), but not on a raw serial port.\r
+ * Note the capture is done in "Linux-cooked" mode, so each packet include\r
+ * a fake packet header (struct sll_header). This is because IrDA packet\r
+ * decoding is dependant on the direction of the packet (incomming or\r
+ * outgoing).\r
+ * When/if other platform implement IrDA capture, we may revisit the\r
+ * issue and define a real DLT_IRDA...\r
+ * Jean II\r
+ */\r
+#define DLT_LINUX_IRDA         144\r
+\r
+/*\r
+ * Reserved for IBM SP switch and IBM Next Federation switch.\r
+ */\r
+#define DLT_IBM_SP             145\r
+#define DLT_IBM_SN             146\r
+\r
+/*\r
+ * Reserved for private use.  If you have some link-layer header type\r
+ * that you want to use within your organization, with the capture files\r
+ * using that link-layer header type not ever be sent outside your\r
+ * organization, you can use these values.\r
+ *\r
+ * No libpcap release will use these for any purpose, nor will any\r
+ * tcpdump release use them, either.\r
+ *\r
+ * Do *NOT* use these in capture files that you expect anybody not using\r
+ * your private versions of capture-file-reading tools to read; in\r
+ * particular, do *NOT* use them in products, otherwise you may find that\r
+ * people won't be able to use tcpdump, or snort, or Ethereal, or... to\r
+ * read capture files from your firewall/intrusion detection/traffic\r
+ * monitoring/etc. appliance, or whatever product uses that DLT_ value,\r
+ * and you may also find that the developers of those applications will\r
+ * not accept patches to let them read those files.\r
+ *\r
+ * Also, do not use them if somebody might send you a capture using them\r
+ * for *their* private type and tools using them for *your* private type\r
+ * would have to read them.\r
+ *\r
+ * Instead, ask "tcpdump-workers@lists.tcpdump.org" for a new DLT_ value,\r
+ * as per the comment above, and use the type you're given.\r
+ */\r
+#define DLT_USER0              147\r
+#define DLT_USER1              148\r
+#define DLT_USER2              149\r
+#define DLT_USER3              150\r
+#define DLT_USER4              151\r
+#define DLT_USER5              152\r
+#define DLT_USER6              153\r
+#define DLT_USER7              154\r
+#define DLT_USER8              155\r
+#define DLT_USER9              156\r
+#define DLT_USER10             157\r
+#define DLT_USER11             158\r
+#define DLT_USER12             159\r
+#define DLT_USER13             160\r
+#define DLT_USER14             161\r
+#define DLT_USER15             162\r
+\r
+/*\r
+ * For future use with 802.11 captures - defined by AbsoluteValue\r
+ * Systems to store a number of bits of link-layer information\r
+ * including radio information:\r
+ *\r
+ *     http://www.shaftnet.org/~pizza/software/capturefrm.txt\r
+ *\r
+ * but it might be used by some non-AVS drivers now or in the\r
+ * future.\r
+ */\r
+#define DLT_IEEE802_11_RADIO_AVS 163   /* 802.11 plus AVS radio header */\r
+\r
+/*\r
+ * Juniper-private data link type, as per request from\r
+ * Hannes Gredler <hannes@juniper.net>.  The DLT_s are used\r
+ * for passing on chassis-internal metainformation such as\r
+ * QOS profiles, etc..\r
+ */\r
+#define DLT_JUNIPER_MONITOR     164\r
+\r
+/*\r
+ * Reserved for BACnet MS/TP.\r
+ */\r
+#define DLT_BACNET_MS_TP       165\r
+\r
+/*\r
+ * Another PPP variant as per request from Karsten Keil <kkeil@suse.de>.\r
+ *\r
+ * This is used in some OSes to allow a kernel socket filter to distinguish\r
+ * between incoming and outgoing packets, on a socket intended to\r
+ * supply pppd with outgoing packets so it can do dial-on-demand and\r
+ * hangup-on-lack-of-demand; incoming packets are filtered out so they\r
+ * don't cause pppd to hold the connection up (you don't want random\r
+ * input packets such as port scans, packets from old lost connections,\r
+ * etc. to force the connection to stay up).\r
+ *\r
+ * The first byte of the PPP header (0xff03) is modified to accomodate\r
+ * the direction - 0x00 = IN, 0x01 = OUT.\r
+ */\r
+#define DLT_PPP_PPPD           166\r
+\r
+/*\r
+ * Names for backwards compatibility with older versions of some PPP\r
+ * software; new software should use DLT_PPP_PPPD.\r
+ */\r
+#define DLT_PPP_WITH_DIRECTION DLT_PPP_PPPD\r
+#define DLT_LINUX_PPP_WITHDIRECTION    DLT_PPP_PPPD\r
+\r
+/*\r
+ * Juniper-private data link type, as per request from\r
+ * Hannes Gredler <hannes@juniper.net>.  The DLT_s are used\r
+ * for passing on chassis-internal metainformation such as\r
+ * QOS profiles, cookies, etc..\r
+ */\r
+#define DLT_JUNIPER_PPPOE       167\r
+#define DLT_JUNIPER_PPPOE_ATM   168\r
+\r
+#define DLT_GPRS_LLC           169     /* GPRS LLC */\r
+#define DLT_GPF_T              170     /* GPF-T (ITU-T G.7041/Y.1303) */\r
+#define DLT_GPF_F              171     /* GPF-F (ITU-T G.7041/Y.1303) */\r
+\r
+/*\r
+ * Requested by Oolan Zimmer <oz@gcom.com> for use in Gcom's T1/E1 line\r
+ * monitoring equipment.\r
+ */\r
+#define DLT_GCOM_T1E1          172\r
+#define DLT_GCOM_SERIAL                173\r
+\r
+/*\r
+ * Juniper-private data link type, as per request from\r
+ * Hannes Gredler <hannes@juniper.net>.  The DLT_ is used\r
+ * for internal communication to Physical Interface Cards (PIC)\r
+ */\r
+#define DLT_JUNIPER_PIC_PEER    174\r
+\r
+/*\r
+ * Link types requested by Gregor Maier <gregor@endace.com> of Endace\r
+ * Measurement Systems.  They add an ERF header (see\r
+ * http://www.endace.com/support/EndaceRecordFormat.pdf) in front of\r
+ * the link-layer header.\r
+ */\r
+#define DLT_ERF_ETH            175     /* Ethernet */\r
+#define DLT_ERF_POS            176     /* Packet-over-SONET */\r
+\r
+/*\r
+ * Requested by Daniele Orlandi <daniele@orlandi.com> for raw LAPD\r
+ * for vISDN (http://www.orlandi.com/visdn/).  Its link-layer header\r
+ * includes additional information before the LAPD header, so it's\r
+ * not necessarily a generic LAPD header.\r
+ */\r
+#define DLT_LINUX_LAPD         177\r
+\r
+/*\r
+ * Juniper-private data link type, as per request from\r
+ * Hannes Gredler <hannes@juniper.net>. \r
+ * The DLT_ are used for prepending meta-information\r
+ * like interface index, interface name\r
+ * before standard Ethernet, PPP, Frelay & C-HDLC Frames\r
+ */\r
+#define DLT_JUNIPER_ETHER       178\r
+#define DLT_JUNIPER_PPP         179\r
+#define DLT_JUNIPER_FRELAY      180\r
+#define DLT_JUNIPER_CHDLC       181\r
+\r
+/*\r
+ * Multi Link Frame Relay (FRF.16)\r
+ */\r
+#define DLT_MFR                 182\r
+\r
+/*\r
+ * Juniper-private data link type, as per request from\r
+ * Hannes Gredler <hannes@juniper.net>. \r
+ * The DLT_ is used for internal communication with a\r
+ * voice Adapter Card (PIC)\r
+ */\r
+#define DLT_JUNIPER_VP          183\r
+\r
+/*\r
+ * Arinc 429 frames.\r
+ * DLT_ requested by Gianluca Varenni <gianluca.varenni@cacetech.com>.\r
+ * Every frame contains a 32bit A429 label.\r
+ * More documentation on Arinc 429 can be found at\r
+ * http://www.condoreng.com/support/downloads/tutorials/ARINCTutorial.pdf\r
+ */\r
+#define DLT_A429                184\r
+\r
+/*\r
+ * Arinc 653 Interpartition Communication messages.\r
+ * DLT_ requested by Gianluca Varenni <gianluca.varenni@cacetech.com>.\r
+ * Please refer to the A653-1 standard for more information.\r
+ */\r
+#define DLT_A653_ICM            185\r
+\r
+/*\r
+ * USB packets, beginning with a USB setup header; requested by\r
+ * Paolo Abeni <paolo.abeni@email.it>.\r
+ */\r
+#define DLT_USB                        186\r
+\r
+/*\r
+ * Bluetooth HCI UART transport layer (part H:4); requested by\r
+ * Paolo Abeni.\r
+ */\r
+#define DLT_BLUETOOTH_HCI_H4   187\r
+\r
+/*\r
+ * IEEE 802.16 MAC Common Part Sublayer; requested by Maria Cruz\r
+ * <cruz_petagay@bah.com>.\r
+ */\r
+#define DLT_IEEE802_16_MAC_CPS 188\r
+\r
+/*\r
+ * USB packets, beginning with a Linux USB header; requested by\r
+ * Paolo Abeni <paolo.abeni@email.it>.\r
+ */\r
+#define DLT_USB_LINUX          189\r
+\r
+/*\r
+ * Controller Area Network (CAN) v. 2.0B packets.\r
+ * DLT_ requested by Gianluca Varenni <gianluca.varenni@cacetech.com>.\r
+ * Used to dump CAN packets coming from a CAN Vector board.\r
+ * More documentation on the CAN v2.0B frames can be found at\r
+ * http://www.can-cia.org/downloads/?269\r
+ */\r
+#define DLT_CAN20B              190\r
+\r
+/*\r
+ * IEEE 802.15.4, with address fields padded, as is done by Linux\r
+ * drivers; requested by Juergen Schimmer.\r
+ */\r
+#define DLT_IEEE802_15_4_LINUX 191\r
+\r
+/*\r
+ * Per Packet Information encapsulated packets.\r
+ * DLT_ requested by Gianluca Varenni <gianluca.varenni@cacetech.com>.\r
+ */\r
+#define DLT_PPI                        192\r
+\r
+/*\r
+ * Header for 802.16 MAC Common Part Sublayer plus a radiotap radio header;\r
+ * requested by Charles Clancy.\r
+ */\r
+#define DLT_IEEE802_16_MAC_CPS_RADIO   193\r
+\r
+/*\r
+ * Juniper-private data link type, as per request from\r
+ * Hannes Gredler <hannes@juniper.net>. \r
+ * The DLT_ is used for internal communication with a\r
+ * integrated service module (ISM).\r
+ */\r
+#define DLT_JUNIPER_ISM         194\r
+\r
+/*\r
+ * IEEE 802.15.4, exactly as it appears in the spec (no padding, no\r
+ * nothing); requested by Mikko Saarnivala <mikko.saarnivala@sensinode.com>.\r
+ */\r
+#define DLT_IEEE802_15_4       195\r
+\r
+/*\r
+ * Various link-layer types, with a pseudo-header, for SITA\r
+ * (http://www.sita.aero/); requested by Fulko Hew (fulko.hew@gmail.com).\r
+ */\r
+#define DLT_SITA               196\r
+\r
+/*\r
+ * Various link-layer types, with a pseudo-header, for Endace DAG cards;\r
+ * encapsulates Endace ERF records.  Requested by Stephen Donnelly\r
+ * <stephen@endace.com>.\r
+ */\r
+#define DLT_ERF                        197\r
+\r
+/*\r
+ * Special header prepended to Ethernet packets when capturing from a\r
+ * u10 Networks board.  Requested by Phil Mulholland\r
+ * <phil@u10networks.com>.\r
+ */\r
+#define DLT_RAIF1              198\r
+\r
+/*\r
+ * IPMB packet for IPMI, beginning with the I2C slave address, followed\r
+ * by the netFn and LUN, etc..  Requested by Chanthy Toeung\r
+ * <chanthy.toeung@ca.kontron.com>.\r
+ */\r
+#define DLT_IPMB               199\r
+\r
+/*\r
+ * Juniper-private data link type, as per request from\r
+ * Hannes Gredler <hannes@juniper.net>. \r
+ * The DLT_ is used for capturing data on a secure tunnel interface.\r
+ */\r
+#define DLT_JUNIPER_ST          200\r
+\r
+/*\r
+ * Bluetooth HCI UART transport layer (part H:4), with pseudo-header\r
+ * that includes direction information; requested by Paolo Abeni.\r
+ */\r
+#define DLT_BLUETOOTH_HCI_H4_WITH_PHDR 201\r
+\r
+/*\r
+ * AX.25 packet with a 1-byte KISS header; see\r
+ *\r
+ *     http://www.ax25.net/kiss.htm\r
+ *\r
+ * as per Richard Stearn <richard@rns-stearn.demon.co.uk>.\r
+ */\r
+#define DLT_AX25_KISS          202\r
+\r
+/*\r
+ * LAPD packets from an ISDN channel, starting with the address field,\r
+ * with no pseudo-header.\r
+ * Requested by Varuna De Silva <varunax@gmail.com>.\r
+ */\r
+#define DLT_LAPD               203\r
+\r
+/*\r
+ * Variants of various link-layer headers, with a one-byte direction\r
+ * pseudo-header prepended - zero means "received by this host",\r
+ * non-zero (any non-zero value) means "sent by this host" - as per\r
+ * Will Barker <w.barker@zen.co.uk>.\r
+ */\r
+#define DLT_PPP_WITH_DIR       204     /* PPP - don't confuse with DLT_PPP_WITH_DIRECTION */\r
+#define DLT_C_HDLC_WITH_DIR    205     /* Cisco HDLC */\r
+#define DLT_FRELAY_WITH_DIR    206     /* Frame Relay */\r
+#define DLT_LAPB_WITH_DIR      207     /* LAPB */\r
+\r
+/*\r
+ * 208 is reserved for an as-yet-unspecified proprietary link-layer\r
+ * type, as requested by Will Barker.\r
+ */\r
+\r
+/*\r
+ * IPMB with a Linux-specific pseudo-header; as requested by Alexey Neyman\r
+ * <avn@pigeonpoint.com>.\r
+ */\r
+#define DLT_IPMB_LINUX         209\r
+\r
+/*\r
+ * FlexRay automotive bus - http://www.flexray.com/ - as requested\r
+ * by Hannes Kaelber <hannes.kaelber@x2e.de>.\r
+ */\r
+#define DLT_FLEXRAY            210\r
+\r
+/*\r
+ * Media Oriented Systems Transport (MOST) bus for multimedia\r
+ * transport - http://www.mostcooperation.com/ - as requested\r
+ * by Hannes Kaelber <hannes.kaelber@x2e.de>.\r
+ */\r
+#define DLT_MOST               211\r
+\r
+/*\r
+ * Local Interconnect Network (LIN) bus for vehicle networks -\r
+ * http://www.lin-subbus.org/ - as requested by Hannes Kaelber\r
+ * <hannes.kaelber@x2e.de>.\r
+ */\r
+#define DLT_LIN                        212\r
+\r
+/*\r
+ * X2E-private data link type used for serial line capture,\r
+ * as requested by Hannes Kaelber <hannes.kaelber@x2e.de>.\r
+ */\r
+#define DLT_X2E_SERIAL         213\r
+\r
+/*\r
+ * X2E-private data link type used for the Xoraya data logger\r
+ * family, as requested by Hannes Kaelber <hannes.kaelber@x2e.de>.\r
+ */\r
+#define DLT_X2E_XORAYA         214\r
+\r
+/*\r
+ * IEEE 802.15.4, exactly as it appears in the spec (no padding, no\r
+ * nothing), but with the PHY-level data for non-ASK PHYs (4 octets\r
+ * of 0 as preamble, one octet of SFD, one octet of frame length+\r
+ * reserved bit, and then the MAC-layer data, starting with the\r
+ * frame control field).\r
+ *\r
+ * Requested by Max Filippov <jcmvbkbc@gmail.com>.\r
+ */\r
+#define DLT_IEEE802_15_4_NONASK_PHY    215\r
+\r
+\r
+/*\r
+ * DLT and savefile link type values are split into a class and\r
+ * a member of that class.  A class value of 0 indicates a regular\r
+ * DLT_/LINKTYPE_ value.\r
+ */\r
+#define DLT_CLASS(x)           ((x) & 0x03ff0000)\r
+\r
+/*\r
+ * NetBSD-specific generic "raw" link type.  The class value indicates\r
+ * that this is the generic raw type, and the lower 16 bits are the\r
+ * address family we're dealing with.  Those values are NetBSD-specific;\r
+ * do not assume that they correspond to AF_ values for your operating\r
+ * system.\r
+ */\r
+#define        DLT_CLASS_NETBSD_RAWAF  0x02240000\r
+#define        DLT_NETBSD_RAWAF(af)    (DLT_CLASS_NETBSD_RAWAF | (af))\r
+#define        DLT_NETBSD_RAWAF_AF(x)  ((x) & 0x0000ffff)\r
+#define        DLT_IS_NETBSD_RAWAF(x)  (DLT_CLASS(x) == DLT_CLASS_NETBSD_RAWAF)\r
+\r
+\r
+/*\r
+ * The instruction encodings.\r
+ */\r
+/* instruction classes */\r
+#define BPF_CLASS(code) ((code) & 0x07)\r
+#define                BPF_LD          0x00\r
+#define                BPF_LDX         0x01\r
+#define                BPF_ST          0x02\r
+#define                BPF_STX         0x03\r
+#define                BPF_ALU         0x04\r
+#define                BPF_JMP         0x05\r
+#define                BPF_RET         0x06\r
+#define                BPF_MISC        0x07\r
+\r
+/* ld/ldx fields */\r
+#define BPF_SIZE(code) ((code) & 0x18)\r
+#define                BPF_W           0x00\r
+#define                BPF_H           0x08\r
+#define                BPF_B           0x10\r
+#define BPF_MODE(code) ((code) & 0xe0)\r
+#define                BPF_IMM         0x00\r
+#define                BPF_ABS         0x20\r
+#define                BPF_IND         0x40\r
+#define                BPF_MEM         0x60\r
+#define                BPF_LEN         0x80\r
+#define                BPF_MSH         0xa0\r
+\r
+/* alu/jmp fields */\r
+#define BPF_OP(code)   ((code) & 0xf0)\r
+#define                BPF_ADD         0x00\r
+#define                BPF_SUB         0x10\r
+#define                BPF_MUL         0x20\r
+#define                BPF_DIV         0x30\r
+#define                BPF_OR          0x40\r
+#define                BPF_AND         0x50\r
+#define                BPF_LSH         0x60\r
+#define                BPF_RSH         0x70\r
+#define                BPF_NEG         0x80\r
+#define                BPF_JA          0x00\r
+#define                BPF_JEQ         0x10\r
+#define                BPF_JGT         0x20\r
+#define                BPF_JGE         0x30\r
+#define                BPF_JSET        0x40\r
+#define BPF_SRC(code)  ((code) & 0x08)\r
+#define                BPF_K           0x00\r
+#define                BPF_X           0x08\r
+\r
+/* ret - BPF_K and BPF_X also apply */\r
+#define BPF_RVAL(code) ((code) & 0x18)\r
+#define                BPF_A           0x10\r
+\r
+/* misc */\r
+#define BPF_MISCOP(code) ((code) & 0xf8)\r
+#define                BPF_TAX         0x00\r
+#define                BPF_TXA         0x80\r
+\r
+/*\r
+ * The instruction data structure.\r
+ */\r
+struct bpf_insn {\r
+       u_short code;\r
+       u_char  jt;\r
+       u_char  jf;\r
+       bpf_u_int32 k;\r
+};\r
+\r
+/*\r
+ * Macros for insn array initializers.\r
+ */\r
+#define BPF_STMT(code, k) { (u_short)(code), 0, 0, k }\r
+#define BPF_JUMP(code, k, jt, jf) { (u_short)(code), jt, jf, k }\r
+\r
+#if __STDC__ || defined(__cplusplus)\r
+extern int bpf_validate(const struct bpf_insn *, int);\r
+extern u_int bpf_filter(const struct bpf_insn *, const u_char *, u_int, u_int);\r
+#else\r
+extern int bpf_validate();\r
+extern u_int bpf_filter();\r
+#endif\r
+\r
+/*\r
+ * Number of scratch memory words (for BPF_LD|BPF_MEM and BPF_ST).\r
+ */\r
+#define BPF_MEMWORDS 16\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif\r
+\r
+#endif\r