xref: /netbsd/external/bsd/libpcap/dist/pcap/bpf.h (revision 05335472)
154a6ec8aSchristos /*-
254a6ec8aSchristos  * Copyright (c) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997
354a6ec8aSchristos  *	The Regents of the University of California.  All rights reserved.
454a6ec8aSchristos  *
554a6ec8aSchristos  * This code is derived from the Stanford/CMU enet packet filter,
654a6ec8aSchristos  * (net/enet.c) distributed as part of 4.3BSD, and code contributed
754a6ec8aSchristos  * to Berkeley by Steven McCanne and Van Jacobson both of Lawrence
854a6ec8aSchristos  * Berkeley Laboratory.
954a6ec8aSchristos  *
1054a6ec8aSchristos  * Redistribution and use in source and binary forms, with or without
1154a6ec8aSchristos  * modification, are permitted provided that the following conditions
1254a6ec8aSchristos  * are met:
1354a6ec8aSchristos  * 1. Redistributions of source code must retain the above copyright
1454a6ec8aSchristos  *    notice, this list of conditions and the following disclaimer.
1554a6ec8aSchristos  * 2. Redistributions in binary form must reproduce the above copyright
1654a6ec8aSchristos  *    notice, this list of conditions and the following disclaimer in the
1754a6ec8aSchristos  *    documentation and/or other materials provided with the distribution.
1854a6ec8aSchristos  * 3. All advertising materials mentioning features or use of this software
1954a6ec8aSchristos  *    must display the following acknowledgement:
2054a6ec8aSchristos  *      This product includes software developed by the University of
2154a6ec8aSchristos  *      California, Berkeley and its contributors.
2254a6ec8aSchristos  * 4. Neither the name of the University nor the names of its contributors
2354a6ec8aSchristos  *    may be used to endorse or promote products derived from this software
2454a6ec8aSchristos  *    without specific prior written permission.
2554a6ec8aSchristos  *
2654a6ec8aSchristos  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
2754a6ec8aSchristos  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
2854a6ec8aSchristos  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
2954a6ec8aSchristos  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
3054a6ec8aSchristos  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
3154a6ec8aSchristos  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
3254a6ec8aSchristos  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
3354a6ec8aSchristos  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
3454a6ec8aSchristos  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
3554a6ec8aSchristos  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
3654a6ec8aSchristos  * SUCH DAMAGE.
3754a6ec8aSchristos  *
3854a6ec8aSchristos  *      @(#)bpf.h       7.1 (Berkeley) 5/7/91
3954a6ec8aSchristos  *
4034c1edddSchristos  * @(#) Header: /tcpdump/master/libpcap/pcap/bpf.h,v 1.32 2008-12-23 20:13:29 guy Exp (LBL)
4154a6ec8aSchristos  */
42*05335472Schristos #error "This is not used in NetBSD, we use <net/bpf.h>"
4354a6ec8aSchristos /*
4454a6ec8aSchristos  * This is libpcap's cut-down version of bpf.h; it includes only
4554a6ec8aSchristos  * the stuff needed for the code generator and the userland BPF
4654a6ec8aSchristos  * interpreter, and the libpcap APIs for setting filters, etc..
4754a6ec8aSchristos  *
4854a6ec8aSchristos  * "pcap-bpf.c" will include the native OS version, as it deals with
4954a6ec8aSchristos  * the OS's BPF implementation.
5054a6ec8aSchristos  *
5154a6ec8aSchristos  * XXX - should this all just be moved to "pcap.h"?
5254a6ec8aSchristos  */
5354a6ec8aSchristos 
5454a6ec8aSchristos #ifndef BPF_MAJOR_VERSION
5554a6ec8aSchristos 
5654a6ec8aSchristos #ifdef __cplusplus
5754a6ec8aSchristos extern "C" {
5854a6ec8aSchristos #endif
5954a6ec8aSchristos 
6054a6ec8aSchristos /* BSD style release date */
6154a6ec8aSchristos #define BPF_RELEASE 199606
6254a6ec8aSchristos 
6354a6ec8aSchristos #ifdef MSDOS /* must be 32-bit */
6454a6ec8aSchristos typedef long          bpf_int32;
6554a6ec8aSchristos typedef unsigned long bpf_u_int32;
6654a6ec8aSchristos #else
6754a6ec8aSchristos typedef	int bpf_int32;
6854a6ec8aSchristos typedef	u_int bpf_u_int32;
6954a6ec8aSchristos #endif
7054a6ec8aSchristos 
7154a6ec8aSchristos /*
7254a6ec8aSchristos  * Alignment macros.  BPF_WORDALIGN rounds up to the next
7354a6ec8aSchristos  * even multiple of BPF_ALIGNMENT.
7454a6ec8aSchristos  */
7554a6ec8aSchristos #ifndef __NetBSD__
7654a6ec8aSchristos #define BPF_ALIGNMENT sizeof(bpf_int32)
7754a6ec8aSchristos #else
7854a6ec8aSchristos #define BPF_ALIGNMENT sizeof(long)
7954a6ec8aSchristos #endif
8054a6ec8aSchristos #define BPF_WORDALIGN(x) (((x)+(BPF_ALIGNMENT-1))&~(BPF_ALIGNMENT-1))
8154a6ec8aSchristos 
8254a6ec8aSchristos #define BPF_MAXBUFSIZE 0x8000
8354a6ec8aSchristos #define BPF_MINBUFSIZE 32
8454a6ec8aSchristos 
8554a6ec8aSchristos /*
8654a6ec8aSchristos  * Structure for "pcap_compile()", "pcap_setfilter()", etc..
8754a6ec8aSchristos  */
8854a6ec8aSchristos struct bpf_program {
8954a6ec8aSchristos 	u_int bf_len;
9054a6ec8aSchristos 	struct bpf_insn *bf_insns;
9154a6ec8aSchristos };
9254a6ec8aSchristos 
9354a6ec8aSchristos /*
9454a6ec8aSchristos  * Struct return by BIOCVERSION.  This represents the version number of
9554a6ec8aSchristos  * the filter language described by the instruction encodings below.
9654a6ec8aSchristos  * bpf understands a program iff kernel_major == filter_major &&
9754a6ec8aSchristos  * kernel_minor >= filter_minor, that is, if the value returned by the
9854a6ec8aSchristos  * running kernel has the same major number and a minor number equal
9954a6ec8aSchristos  * equal to or less than the filter being downloaded.  Otherwise, the
10054a6ec8aSchristos  * results are undefined, meaning an error may be returned or packets
10154a6ec8aSchristos  * may be accepted haphazardly.
10254a6ec8aSchristos  * It has nothing to do with the source code version.
10354a6ec8aSchristos  */
10454a6ec8aSchristos struct bpf_version {
10554a6ec8aSchristos 	u_short bv_major;
10654a6ec8aSchristos 	u_short bv_minor;
10754a6ec8aSchristos };
10854a6ec8aSchristos /* Current version number of filter architecture. */
10954a6ec8aSchristos #define BPF_MAJOR_VERSION 1
11054a6ec8aSchristos #define BPF_MINOR_VERSION 1
11154a6ec8aSchristos 
11254a6ec8aSchristos /*
11354a6ec8aSchristos  * Data-link level type codes.
11454a6ec8aSchristos  *
11554a6ec8aSchristos  * Do *NOT* add new values to this list without asking
11654a6ec8aSchristos  * "tcpdump-workers@lists.tcpdump.org" for a value.  Otherwise, you run
11754a6ec8aSchristos  * the risk of using a value that's already being used for some other
11854a6ec8aSchristos  * purpose, and of having tools that read libpcap-format captures not
11954a6ec8aSchristos  * being able to handle captures with your new DLT_ value, with no hope
12054a6ec8aSchristos  * that they will ever be changed to do so (as that would destroy their
12154a6ec8aSchristos  * ability to read captures using that value for that other purpose).
12254a6ec8aSchristos  */
12354a6ec8aSchristos 
12454a6ec8aSchristos /*
12554a6ec8aSchristos  * These are the types that are the same on all platforms, and that
12654a6ec8aSchristos  * have been defined by <net/bpf.h> for ages.
12754a6ec8aSchristos  */
12854a6ec8aSchristos #define DLT_NULL	0	/* BSD loopback encapsulation */
12954a6ec8aSchristos #define DLT_EN10MB	1	/* Ethernet (10Mb) */
13054a6ec8aSchristos #define DLT_EN3MB	2	/* Experimental Ethernet (3Mb) */
13154a6ec8aSchristos #define DLT_AX25	3	/* Amateur Radio AX.25 */
13254a6ec8aSchristos #define DLT_PRONET	4	/* Proteon ProNET Token Ring */
13354a6ec8aSchristos #define DLT_CHAOS	5	/* Chaos */
13454a6ec8aSchristos #define DLT_IEEE802	6	/* 802.5 Token Ring */
13554a6ec8aSchristos #define DLT_ARCNET	7	/* ARCNET, with BSD-style header */
13654a6ec8aSchristos #define DLT_SLIP	8	/* Serial Line IP */
13754a6ec8aSchristos #define DLT_PPP		9	/* Point-to-point Protocol */
13854a6ec8aSchristos #define DLT_FDDI	10	/* FDDI */
13954a6ec8aSchristos 
14054a6ec8aSchristos /*
14154a6ec8aSchristos  * These are types that are different on some platforms, and that
14254a6ec8aSchristos  * have been defined by <net/bpf.h> for ages.  We use #ifdefs to
14354a6ec8aSchristos  * detect the BSDs that define them differently from the traditional
14454a6ec8aSchristos  * libpcap <net/bpf.h>
14554a6ec8aSchristos  *
14654a6ec8aSchristos  * XXX - DLT_ATM_RFC1483 is 13 in BSD/OS, and DLT_RAW is 14 in BSD/OS,
14754a6ec8aSchristos  * but I don't know what the right #define is for BSD/OS.
14854a6ec8aSchristos  */
14954a6ec8aSchristos #define DLT_ATM_RFC1483	11	/* LLC-encapsulated ATM */
15054a6ec8aSchristos 
15154a6ec8aSchristos #ifdef __OpenBSD__
15254a6ec8aSchristos #define DLT_RAW		14	/* raw IP */
15354a6ec8aSchristos #else
15454a6ec8aSchristos #define DLT_RAW		12	/* raw IP */
15554a6ec8aSchristos #endif
15654a6ec8aSchristos 
15754a6ec8aSchristos /*
15854a6ec8aSchristos  * Given that the only OS that currently generates BSD/OS SLIP or PPP
15954a6ec8aSchristos  * is, well, BSD/OS, arguably everybody should have chosen its values
16054a6ec8aSchristos  * for DLT_SLIP_BSDOS and DLT_PPP_BSDOS, which are 15 and 16, but they
16154a6ec8aSchristos  * didn't.  So it goes.
16254a6ec8aSchristos  */
16354a6ec8aSchristos #if defined(__NetBSD__) || defined(__FreeBSD__)
16454a6ec8aSchristos #ifndef DLT_SLIP_BSDOS
16554a6ec8aSchristos #define DLT_SLIP_BSDOS	13	/* BSD/OS Serial Line IP */
16654a6ec8aSchristos #define DLT_PPP_BSDOS	14	/* BSD/OS Point-to-point Protocol */
16754a6ec8aSchristos #endif
16854a6ec8aSchristos #else
16954a6ec8aSchristos #define DLT_SLIP_BSDOS	15	/* BSD/OS Serial Line IP */
17054a6ec8aSchristos #define DLT_PPP_BSDOS	16	/* BSD/OS Point-to-point Protocol */
17154a6ec8aSchristos #endif
17254a6ec8aSchristos 
17354a6ec8aSchristos /*
17454a6ec8aSchristos  * 17 is used for DLT_OLD_PFLOG in OpenBSD;
17554a6ec8aSchristos  *     OBSOLETE: DLT_PFLOG is 117 in OpenBSD now as well. See below.
17654a6ec8aSchristos  * 18 is used for DLT_PFSYNC in OpenBSD; don't use it for anything else.
17754a6ec8aSchristos  */
17854a6ec8aSchristos 
17954a6ec8aSchristos #define DLT_ATM_CLIP	19	/* Linux Classical-IP over ATM */
18054a6ec8aSchristos 
18154a6ec8aSchristos /*
18254a6ec8aSchristos  * Apparently Redback uses this for its SmartEdge 400/800.  I hope
18354a6ec8aSchristos  * nobody else decided to use it, too.
18454a6ec8aSchristos  */
18554a6ec8aSchristos #define DLT_REDBACK_SMARTEDGE	32
18654a6ec8aSchristos 
18754a6ec8aSchristos /*
18854a6ec8aSchristos  * These values are defined by NetBSD; other platforms should refrain from
18954a6ec8aSchristos  * using them for other purposes, so that NetBSD savefiles with link
19054a6ec8aSchristos  * types of 50 or 51 can be read as this type on all platforms.
19154a6ec8aSchristos  */
19254a6ec8aSchristos #define DLT_PPP_SERIAL	50	/* PPP over serial with HDLC encapsulation */
19354a6ec8aSchristos #define DLT_PPP_ETHER	51	/* PPP over Ethernet */
19454a6ec8aSchristos 
19554a6ec8aSchristos /*
19654a6ec8aSchristos  * The Axent Raptor firewall - now the Symantec Enterprise Firewall - uses
19754a6ec8aSchristos  * a link-layer type of 99 for the tcpdump it supplies.  The link-layer
19854a6ec8aSchristos  * header has 6 bytes of unknown data, something that appears to be an
19954a6ec8aSchristos  * Ethernet type, and 36 bytes that appear to be 0 in at least one capture
20054a6ec8aSchristos  * I've seen.
20154a6ec8aSchristos  */
20254a6ec8aSchristos #define DLT_SYMANTEC_FIREWALL	99
20354a6ec8aSchristos 
20454a6ec8aSchristos /*
20554a6ec8aSchristos  * Values between 100 and 103 are used in capture file headers as
20654a6ec8aSchristos  * link-layer types corresponding to DLT_ types that differ
20754a6ec8aSchristos  * between platforms; don't use those values for new DLT_ new types.
20854a6ec8aSchristos  */
20954a6ec8aSchristos 
21054a6ec8aSchristos /*
21154a6ec8aSchristos  * This value was defined by libpcap 0.5; platforms that have defined
21254a6ec8aSchristos  * it with a different value should define it here with that value -
21354a6ec8aSchristos  * a link type of 104 in a save file will be mapped to DLT_C_HDLC,
21454a6ec8aSchristos  * whatever value that happens to be, so programs will correctly
21554a6ec8aSchristos  * handle files with that link type regardless of the value of
21654a6ec8aSchristos  * DLT_C_HDLC.
21754a6ec8aSchristos  *
21854a6ec8aSchristos  * The name DLT_C_HDLC was used by BSD/OS; we use that name for source
21954a6ec8aSchristos  * compatibility with programs written for BSD/OS.
22054a6ec8aSchristos  *
22154a6ec8aSchristos  * libpcap 0.5 defined it as DLT_CHDLC; we define DLT_CHDLC as well,
22254a6ec8aSchristos  * for source compatibility with programs written for libpcap 0.5.
22354a6ec8aSchristos  */
22454a6ec8aSchristos #define DLT_C_HDLC	104	/* Cisco HDLC */
22554a6ec8aSchristos #define DLT_CHDLC	DLT_C_HDLC
22654a6ec8aSchristos 
22754a6ec8aSchristos #define DLT_IEEE802_11	105	/* IEEE 802.11 wireless */
22854a6ec8aSchristos 
22954a6ec8aSchristos /*
23054a6ec8aSchristos  * 106 is reserved for Linux Classical IP over ATM; it's like DLT_RAW,
23154a6ec8aSchristos  * except when it isn't.  (I.e., sometimes it's just raw IP, and
23254a6ec8aSchristos  * sometimes it isn't.)  We currently handle it as DLT_LINUX_SLL,
23354a6ec8aSchristos  * so that we don't have to worry about the link-layer header.)
23454a6ec8aSchristos  */
23554a6ec8aSchristos 
23654a6ec8aSchristos /*
23754a6ec8aSchristos  * Frame Relay; BSD/OS has a DLT_FR with a value of 11, but that collides
23854a6ec8aSchristos  * with other values.
23954a6ec8aSchristos  * DLT_FR and DLT_FRELAY packets start with the Q.922 Frame Relay header
24054a6ec8aSchristos  * (DLCI, etc.).
24154a6ec8aSchristos  */
24254a6ec8aSchristos #define DLT_FRELAY	107
24354a6ec8aSchristos 
24454a6ec8aSchristos /*
24554a6ec8aSchristos  * OpenBSD DLT_LOOP, for loopback devices; it's like DLT_NULL, except
24654a6ec8aSchristos  * that the AF_ type in the link-layer header is in network byte order.
24754a6ec8aSchristos  *
24854a6ec8aSchristos  * DLT_LOOP is 12 in OpenBSD, but that's DLT_RAW in other OSes, so
24954a6ec8aSchristos  * we don't use 12 for it in OSes other than OpenBSD.
25054a6ec8aSchristos  */
25154a6ec8aSchristos #ifdef __OpenBSD__
25254a6ec8aSchristos #define DLT_LOOP	12
25354a6ec8aSchristos #else
25454a6ec8aSchristos #define DLT_LOOP	108
25554a6ec8aSchristos #endif
25654a6ec8aSchristos 
25754a6ec8aSchristos /*
25854a6ec8aSchristos  * Encapsulated packets for IPsec; DLT_ENC is 13 in OpenBSD, but that's
25954a6ec8aSchristos  * DLT_SLIP_BSDOS in NetBSD, so we don't use 13 for it in OSes other
26054a6ec8aSchristos  * than OpenBSD.
26154a6ec8aSchristos  */
26254a6ec8aSchristos #ifdef __OpenBSD__
26354a6ec8aSchristos #define DLT_ENC		13
26454a6ec8aSchristos #else
26554a6ec8aSchristos #define DLT_ENC		109
26654a6ec8aSchristos #endif
26754a6ec8aSchristos 
26854a6ec8aSchristos /*
26954a6ec8aSchristos  * Values between 110 and 112 are reserved for use in capture file headers
27054a6ec8aSchristos  * as link-layer types corresponding to DLT_ types that might differ
27154a6ec8aSchristos  * between platforms; don't use those values for new DLT_ types
27254a6ec8aSchristos  * other than the corresponding DLT_ types.
27354a6ec8aSchristos  */
27454a6ec8aSchristos 
27554a6ec8aSchristos /*
27654a6ec8aSchristos  * This is for Linux cooked sockets.
27754a6ec8aSchristos  */
27854a6ec8aSchristos #define DLT_LINUX_SLL	113
27954a6ec8aSchristos 
28054a6ec8aSchristos /*
28154a6ec8aSchristos  * Apple LocalTalk hardware.
28254a6ec8aSchristos  */
28354a6ec8aSchristos #define DLT_LTALK	114
28454a6ec8aSchristos 
28554a6ec8aSchristos /*
28654a6ec8aSchristos  * Acorn Econet.
28754a6ec8aSchristos  */
28854a6ec8aSchristos #define DLT_ECONET	115
28954a6ec8aSchristos 
29054a6ec8aSchristos /*
29154a6ec8aSchristos  * Reserved for use with OpenBSD ipfilter.
29254a6ec8aSchristos  */
29354a6ec8aSchristos #define DLT_IPFILTER	116
29454a6ec8aSchristos 
29554a6ec8aSchristos /*
29654a6ec8aSchristos  * OpenBSD DLT_PFLOG; DLT_PFLOG is 17 in OpenBSD, but that's DLT_LANE8023
29754a6ec8aSchristos  * in SuSE 6.3, so we can't use 17 for it in capture-file headers.
29854a6ec8aSchristos  *
29954a6ec8aSchristos  * XXX: is there a conflict with DLT_PFSYNC 18 as well?
30054a6ec8aSchristos  */
30100e806a9Schristos #if defined(__OpenBSD__) || defined(__NetBSD__)
30254a6ec8aSchristos #define DLT_OLD_PFLOG	17
30354a6ec8aSchristos #define DLT_PFSYNC	18
30454a6ec8aSchristos #endif
30554a6ec8aSchristos #define DLT_PFLOG	117
30654a6ec8aSchristos 
30754a6ec8aSchristos /*
30854a6ec8aSchristos  * Registered for Cisco-internal use.
30954a6ec8aSchristos  */
31054a6ec8aSchristos #define DLT_CISCO_IOS	118
31154a6ec8aSchristos 
31254a6ec8aSchristos /*
31354a6ec8aSchristos  * For 802.11 cards using the Prism II chips, with a link-layer
31454a6ec8aSchristos  * header including Prism monitor mode information plus an 802.11
31554a6ec8aSchristos  * header.
31654a6ec8aSchristos  */
31754a6ec8aSchristos #define DLT_PRISM_HEADER	119
31854a6ec8aSchristos 
31954a6ec8aSchristos /*
32054a6ec8aSchristos  * Reserved for Aironet 802.11 cards, with an Aironet link-layer header
32154a6ec8aSchristos  * (see Doug Ambrisko's FreeBSD patches).
32254a6ec8aSchristos  */
32354a6ec8aSchristos #define DLT_AIRONET_HEADER	120
32454a6ec8aSchristos 
32554a6ec8aSchristos /*
32654a6ec8aSchristos  * Reserved for Siemens HiPath HDLC.
32754a6ec8aSchristos  */
32854a6ec8aSchristos #define DLT_HHDLC		121
32954a6ec8aSchristos 
33054a6ec8aSchristos /*
33154a6ec8aSchristos  * This is for RFC 2625 IP-over-Fibre Channel.
33254a6ec8aSchristos  *
33354a6ec8aSchristos  * This is not for use with raw Fibre Channel, where the link-layer
33454a6ec8aSchristos  * header starts with a Fibre Channel frame header; it's for IP-over-FC,
33554a6ec8aSchristos  * where the link-layer header starts with an RFC 2625 Network_Header
33654a6ec8aSchristos  * field.
33754a6ec8aSchristos  */
33854a6ec8aSchristos #define DLT_IP_OVER_FC		122
33954a6ec8aSchristos 
34054a6ec8aSchristos /*
34154a6ec8aSchristos  * This is for Full Frontal ATM on Solaris with SunATM, with a
34254a6ec8aSchristos  * pseudo-header followed by an AALn PDU.
34354a6ec8aSchristos  *
34454a6ec8aSchristos  * There may be other forms of Full Frontal ATM on other OSes,
34554a6ec8aSchristos  * with different pseudo-headers.
34654a6ec8aSchristos  *
34754a6ec8aSchristos  * If ATM software returns a pseudo-header with VPI/VCI information
34854a6ec8aSchristos  * (and, ideally, packet type information, e.g. signalling, ILMI,
34954a6ec8aSchristos  * LANE, LLC-multiplexed traffic, etc.), it should not use
35054a6ec8aSchristos  * DLT_ATM_RFC1483, but should get a new DLT_ value, so tcpdump
35154a6ec8aSchristos  * and the like don't have to infer the presence or absence of a
35254a6ec8aSchristos  * pseudo-header and the form of the pseudo-header.
35354a6ec8aSchristos  */
35454a6ec8aSchristos #define DLT_SUNATM		123	/* Solaris+SunATM */
35554a6ec8aSchristos 
35654a6ec8aSchristos /*
35754a6ec8aSchristos  * Reserved as per request from Kent Dahlgren <kent@praesum.com>
35854a6ec8aSchristos  * for private use.
35954a6ec8aSchristos  */
36054a6ec8aSchristos #define DLT_RIO                 124     /* RapidIO */
36154a6ec8aSchristos #define DLT_PCI_EXP             125     /* PCI Express */
36254a6ec8aSchristos #define DLT_AURORA              126     /* Xilinx Aurora link layer */
36354a6ec8aSchristos 
36454a6ec8aSchristos /*
36554a6ec8aSchristos  * Header for 802.11 plus a number of bits of link-layer information
36654a6ec8aSchristos  * including radio information, used by some recent BSD drivers as
36754a6ec8aSchristos  * well as the madwifi Atheros driver for Linux.
36854a6ec8aSchristos  */
36954a6ec8aSchristos #define DLT_IEEE802_11_RADIO	127	/* 802.11 plus radiotap radio header */
37054a6ec8aSchristos 
37154a6ec8aSchristos /*
37254a6ec8aSchristos  * Reserved for the TZSP encapsulation, as per request from
37354a6ec8aSchristos  * Chris Waters <chris.waters@networkchemistry.com>
37454a6ec8aSchristos  * TZSP is a generic encapsulation for any other link type,
37554a6ec8aSchristos  * which includes a means to include meta-information
37654a6ec8aSchristos  * with the packet, e.g. signal strength and channel
37754a6ec8aSchristos  * for 802.11 packets.
37854a6ec8aSchristos  */
37954a6ec8aSchristos #define DLT_TZSP                128     /* Tazmen Sniffer Protocol */
38054a6ec8aSchristos 
38154a6ec8aSchristos /*
38254a6ec8aSchristos  * BSD's ARCNET headers have the source host, destination host,
38354a6ec8aSchristos  * and type at the beginning of the packet; that's what's handed
38454a6ec8aSchristos  * up to userland via BPF.
38554a6ec8aSchristos  *
38654a6ec8aSchristos  * Linux's ARCNET headers, however, have a 2-byte offset field
38754a6ec8aSchristos  * between the host IDs and the type; that's what's handed up
38854a6ec8aSchristos  * to userland via PF_PACKET sockets.
38954a6ec8aSchristos  *
39054a6ec8aSchristos  * We therefore have to have separate DLT_ values for them.
39154a6ec8aSchristos  */
39254a6ec8aSchristos #define DLT_ARCNET_LINUX	129	/* ARCNET */
39354a6ec8aSchristos 
39454a6ec8aSchristos /*
39554a6ec8aSchristos  * Juniper-private data link types, as per request from
39654a6ec8aSchristos  * Hannes Gredler <hannes@juniper.net>.  The DLT_s are used
39754a6ec8aSchristos  * for passing on chassis-internal metainformation such as
39854a6ec8aSchristos  * QOS profiles, etc..
39954a6ec8aSchristos  */
40054a6ec8aSchristos #define DLT_JUNIPER_MLPPP       130
40154a6ec8aSchristos #define DLT_JUNIPER_MLFR        131
40254a6ec8aSchristos #define DLT_JUNIPER_ES          132
40354a6ec8aSchristos #define DLT_JUNIPER_GGSN        133
40454a6ec8aSchristos #define DLT_JUNIPER_MFR         134
40554a6ec8aSchristos #define DLT_JUNIPER_ATM2        135
40654a6ec8aSchristos #define DLT_JUNIPER_SERVICES    136
40754a6ec8aSchristos #define DLT_JUNIPER_ATM1        137
40854a6ec8aSchristos 
40954a6ec8aSchristos /*
41054a6ec8aSchristos  * Apple IP-over-IEEE 1394, as per a request from Dieter Siegmund
41154a6ec8aSchristos  * <dieter@apple.com>.  The header that's presented is an Ethernet-like
41254a6ec8aSchristos  * header:
41354a6ec8aSchristos  *
41454a6ec8aSchristos  *	#define FIREWIRE_EUI64_LEN	8
41554a6ec8aSchristos  *	struct firewire_header {
41654a6ec8aSchristos  *		u_char  firewire_dhost[FIREWIRE_EUI64_LEN];
41754a6ec8aSchristos  *		u_char  firewire_shost[FIREWIRE_EUI64_LEN];
41854a6ec8aSchristos  *		u_short firewire_type;
41954a6ec8aSchristos  *	};
42054a6ec8aSchristos  *
42154a6ec8aSchristos  * with "firewire_type" being an Ethernet type value, rather than,
42254a6ec8aSchristos  * for example, raw GASP frames being handed up.
42354a6ec8aSchristos  */
42454a6ec8aSchristos #define DLT_APPLE_IP_OVER_IEEE1394	138
42554a6ec8aSchristos 
42654a6ec8aSchristos /*
42754a6ec8aSchristos  * Various SS7 encapsulations, as per a request from Jeff Morriss
42854a6ec8aSchristos  * <jeff.morriss[AT]ulticom.com> and subsequent discussions.
42954a6ec8aSchristos  */
43054a6ec8aSchristos #define DLT_MTP2_WITH_PHDR	139	/* pseudo-header with various info, followed by MTP2 */
43154a6ec8aSchristos #define DLT_MTP2		140	/* MTP2, without pseudo-header */
43254a6ec8aSchristos #define DLT_MTP3		141	/* MTP3, without pseudo-header or MTP2 */
43354a6ec8aSchristos #define DLT_SCCP		142	/* SCCP, without pseudo-header or MTP2 or MTP3 */
43454a6ec8aSchristos 
43554a6ec8aSchristos /*
43654a6ec8aSchristos  * DOCSIS MAC frames.
43754a6ec8aSchristos  */
43854a6ec8aSchristos #define DLT_DOCSIS		143
43954a6ec8aSchristos 
44054a6ec8aSchristos /*
44154a6ec8aSchristos  * Linux-IrDA packets. Protocol defined at http://www.irda.org.
44254a6ec8aSchristos  * Those packets include IrLAP headers and above (IrLMP...), but
44354a6ec8aSchristos  * don't include Phy framing (SOF/EOF/CRC & byte stuffing), because Phy
44454a6ec8aSchristos  * framing can be handled by the hardware and depend on the bitrate.
44554a6ec8aSchristos  * This is exactly the format you would get capturing on a Linux-IrDA
44654a6ec8aSchristos  * interface (irdaX), but not on a raw serial port.
44754a6ec8aSchristos  * Note the capture is done in "Linux-cooked" mode, so each packet include
44854a6ec8aSchristos  * a fake packet header (struct sll_header). This is because IrDA packet
44954a6ec8aSchristos  * decoding is dependant on the direction of the packet (incomming or
45054a6ec8aSchristos  * outgoing).
45154a6ec8aSchristos  * When/if other platform implement IrDA capture, we may revisit the
45254a6ec8aSchristos  * issue and define a real DLT_IRDA...
45354a6ec8aSchristos  * Jean II
45454a6ec8aSchristos  */
45554a6ec8aSchristos #define DLT_LINUX_IRDA		144
45654a6ec8aSchristos 
45754a6ec8aSchristos /*
45854a6ec8aSchristos  * Reserved for IBM SP switch and IBM Next Federation switch.
45954a6ec8aSchristos  */
46054a6ec8aSchristos #define DLT_IBM_SP		145
46154a6ec8aSchristos #define DLT_IBM_SN		146
46254a6ec8aSchristos 
46354a6ec8aSchristos /*
46454a6ec8aSchristos  * Reserved for private use.  If you have some link-layer header type
46554a6ec8aSchristos  * that you want to use within your organization, with the capture files
46654a6ec8aSchristos  * using that link-layer header type not ever be sent outside your
46754a6ec8aSchristos  * organization, you can use these values.
46854a6ec8aSchristos  *
46954a6ec8aSchristos  * No libpcap release will use these for any purpose, nor will any
47054a6ec8aSchristos  * tcpdump release use them, either.
47154a6ec8aSchristos  *
47254a6ec8aSchristos  * Do *NOT* use these in capture files that you expect anybody not using
47354a6ec8aSchristos  * your private versions of capture-file-reading tools to read; in
47454a6ec8aSchristos  * particular, do *NOT* use them in products, otherwise you may find that
47554a6ec8aSchristos  * people won't be able to use tcpdump, or snort, or Ethereal, or... to
47654a6ec8aSchristos  * read capture files from your firewall/intrusion detection/traffic
47754a6ec8aSchristos  * monitoring/etc. appliance, or whatever product uses that DLT_ value,
47854a6ec8aSchristos  * and you may also find that the developers of those applications will
47954a6ec8aSchristos  * not accept patches to let them read those files.
48054a6ec8aSchristos  *
48154a6ec8aSchristos  * Also, do not use them if somebody might send you a capture using them
48254a6ec8aSchristos  * for *their* private type and tools using them for *your* private type
48354a6ec8aSchristos  * would have to read them.
48454a6ec8aSchristos  *
48554a6ec8aSchristos  * Instead, ask "tcpdump-workers@lists.tcpdump.org" for a new DLT_ value,
48654a6ec8aSchristos  * as per the comment above, and use the type you're given.
48754a6ec8aSchristos  */
48854a6ec8aSchristos #define DLT_USER0		147
48954a6ec8aSchristos #define DLT_USER1		148
49054a6ec8aSchristos #define DLT_USER2		149
49154a6ec8aSchristos #define DLT_USER3		150
49254a6ec8aSchristos #define DLT_USER4		151
49354a6ec8aSchristos #define DLT_USER5		152
49454a6ec8aSchristos #define DLT_USER6		153
49554a6ec8aSchristos #define DLT_USER7		154
49654a6ec8aSchristos #define DLT_USER8		155
49754a6ec8aSchristos #define DLT_USER9		156
49854a6ec8aSchristos #define DLT_USER10		157
49954a6ec8aSchristos #define DLT_USER11		158
50054a6ec8aSchristos #define DLT_USER12		159
50154a6ec8aSchristos #define DLT_USER13		160
50254a6ec8aSchristos #define DLT_USER14		161
50354a6ec8aSchristos #define DLT_USER15		162
50454a6ec8aSchristos 
50554a6ec8aSchristos /*
50654a6ec8aSchristos  * For future use with 802.11 captures - defined by AbsoluteValue
50754a6ec8aSchristos  * Systems to store a number of bits of link-layer information
50854a6ec8aSchristos  * including radio information:
50954a6ec8aSchristos  *
51054a6ec8aSchristos  *	http://www.shaftnet.org/~pizza/software/capturefrm.txt
51154a6ec8aSchristos  *
51254a6ec8aSchristos  * but it might be used by some non-AVS drivers now or in the
51354a6ec8aSchristos  * future.
51454a6ec8aSchristos  */
51554a6ec8aSchristos #define DLT_IEEE802_11_RADIO_AVS 163	/* 802.11 plus AVS radio header */
51654a6ec8aSchristos 
51754a6ec8aSchristos /*
51854a6ec8aSchristos  * Juniper-private data link type, as per request from
51954a6ec8aSchristos  * Hannes Gredler <hannes@juniper.net>.  The DLT_s are used
52054a6ec8aSchristos  * for passing on chassis-internal metainformation such as
52154a6ec8aSchristos  * QOS profiles, etc..
52254a6ec8aSchristos  */
52354a6ec8aSchristos #define DLT_JUNIPER_MONITOR     164
52454a6ec8aSchristos 
52554a6ec8aSchristos /*
52654a6ec8aSchristos  * Reserved for BACnet MS/TP.
52754a6ec8aSchristos  */
52854a6ec8aSchristos #define DLT_BACNET_MS_TP	165
52954a6ec8aSchristos 
53054a6ec8aSchristos /*
53154a6ec8aSchristos  * Another PPP variant as per request from Karsten Keil <kkeil@suse.de>.
53254a6ec8aSchristos  *
53354a6ec8aSchristos  * This is used in some OSes to allow a kernel socket filter to distinguish
53454a6ec8aSchristos  * between incoming and outgoing packets, on a socket intended to
53554a6ec8aSchristos  * supply pppd with outgoing packets so it can do dial-on-demand and
53654a6ec8aSchristos  * hangup-on-lack-of-demand; incoming packets are filtered out so they
53754a6ec8aSchristos  * don't cause pppd to hold the connection up (you don't want random
53854a6ec8aSchristos  * input packets such as port scans, packets from old lost connections,
53954a6ec8aSchristos  * etc. to force the connection to stay up).
54054a6ec8aSchristos  *
54154a6ec8aSchristos  * The first byte of the PPP header (0xff03) is modified to accomodate
54254a6ec8aSchristos  * the direction - 0x00 = IN, 0x01 = OUT.
54354a6ec8aSchristos  */
54454a6ec8aSchristos #define DLT_PPP_PPPD		166
54554a6ec8aSchristos 
54654a6ec8aSchristos /*
54754a6ec8aSchristos  * Names for backwards compatibility with older versions of some PPP
54854a6ec8aSchristos  * software; new software should use DLT_PPP_PPPD.
54954a6ec8aSchristos  */
55054a6ec8aSchristos #define DLT_PPP_WITH_DIRECTION	DLT_PPP_PPPD
55154a6ec8aSchristos #define DLT_LINUX_PPP_WITHDIRECTION	DLT_PPP_PPPD
55254a6ec8aSchristos 
55354a6ec8aSchristos /*
55454a6ec8aSchristos  * Juniper-private data link type, as per request from
55554a6ec8aSchristos  * Hannes Gredler <hannes@juniper.net>.  The DLT_s are used
55654a6ec8aSchristos  * for passing on chassis-internal metainformation such as
55754a6ec8aSchristos  * QOS profiles, cookies, etc..
55854a6ec8aSchristos  */
55954a6ec8aSchristos #define DLT_JUNIPER_PPPOE       167
56054a6ec8aSchristos #define DLT_JUNIPER_PPPOE_ATM   168
56154a6ec8aSchristos 
56254a6ec8aSchristos #define DLT_GPRS_LLC		169	/* GPRS LLC */
56354a6ec8aSchristos #define DLT_GPF_T		170	/* GPF-T (ITU-T G.7041/Y.1303) */
56454a6ec8aSchristos #define DLT_GPF_F		171	/* GPF-F (ITU-T G.7041/Y.1303) */
56554a6ec8aSchristos 
56654a6ec8aSchristos /*
56754a6ec8aSchristos  * Requested by Oolan Zimmer <oz@gcom.com> for use in Gcom's T1/E1 line
56854a6ec8aSchristos  * monitoring equipment.
56954a6ec8aSchristos  */
57054a6ec8aSchristos #define DLT_GCOM_T1E1		172
57154a6ec8aSchristos #define DLT_GCOM_SERIAL		173
57254a6ec8aSchristos 
57354a6ec8aSchristos /*
57454a6ec8aSchristos  * Juniper-private data link type, as per request from
57554a6ec8aSchristos  * Hannes Gredler <hannes@juniper.net>.  The DLT_ is used
57654a6ec8aSchristos  * for internal communication to Physical Interface Cards (PIC)
57754a6ec8aSchristos  */
57854a6ec8aSchristos #define DLT_JUNIPER_PIC_PEER    174
57954a6ec8aSchristos 
58054a6ec8aSchristos /*
58154a6ec8aSchristos  * Link types requested by Gregor Maier <gregor@endace.com> of Endace
58254a6ec8aSchristos  * Measurement Systems.  They add an ERF header (see
58354a6ec8aSchristos  * http://www.endace.com/support/EndaceRecordFormat.pdf) in front of
58454a6ec8aSchristos  * the link-layer header.
58554a6ec8aSchristos  */
58654a6ec8aSchristos #define DLT_ERF_ETH		175	/* Ethernet */
58754a6ec8aSchristos #define DLT_ERF_POS		176	/* Packet-over-SONET */
58854a6ec8aSchristos 
58954a6ec8aSchristos /*
59054a6ec8aSchristos  * Requested by Daniele Orlandi <daniele@orlandi.com> for raw LAPD
59154a6ec8aSchristos  * for vISDN (http://www.orlandi.com/visdn/).  Its link-layer header
59254a6ec8aSchristos  * includes additional information before the LAPD header, so it's
59354a6ec8aSchristos  * not necessarily a generic LAPD header.
59454a6ec8aSchristos  */
59554a6ec8aSchristos #define DLT_LINUX_LAPD		177
59654a6ec8aSchristos 
59754a6ec8aSchristos /*
59854a6ec8aSchristos  * Juniper-private data link type, as per request from
59954a6ec8aSchristos  * Hannes Gredler <hannes@juniper.net>.
60054a6ec8aSchristos  * The DLT_ are used for prepending meta-information
60154a6ec8aSchristos  * like interface index, interface name
60254a6ec8aSchristos  * before standard Ethernet, PPP, Frelay & C-HDLC Frames
60354a6ec8aSchristos  */
60454a6ec8aSchristos #define DLT_JUNIPER_ETHER       178
60554a6ec8aSchristos #define DLT_JUNIPER_PPP         179
60654a6ec8aSchristos #define DLT_JUNIPER_FRELAY      180
60754a6ec8aSchristos #define DLT_JUNIPER_CHDLC       181
60854a6ec8aSchristos 
60954a6ec8aSchristos /*
61054a6ec8aSchristos  * Multi Link Frame Relay (FRF.16)
61154a6ec8aSchristos  */
61254a6ec8aSchristos #define DLT_MFR                 182
61354a6ec8aSchristos 
61454a6ec8aSchristos /*
61554a6ec8aSchristos  * Juniper-private data link type, as per request from
61654a6ec8aSchristos  * Hannes Gredler <hannes@juniper.net>.
61754a6ec8aSchristos  * The DLT_ is used for internal communication with a
61854a6ec8aSchristos  * voice Adapter Card (PIC)
61954a6ec8aSchristos  */
62054a6ec8aSchristos #define DLT_JUNIPER_VP          183
62154a6ec8aSchristos 
62254a6ec8aSchristos /*
62354a6ec8aSchristos  * Arinc 429 frames.
62454a6ec8aSchristos  * DLT_ requested by Gianluca Varenni <gianluca.varenni@cacetech.com>.
62554a6ec8aSchristos  * Every frame contains a 32bit A429 label.
62654a6ec8aSchristos  * More documentation on Arinc 429 can be found at
62754a6ec8aSchristos  * http://www.condoreng.com/support/downloads/tutorials/ARINCTutorial.pdf
62854a6ec8aSchristos  */
62954a6ec8aSchristos #define DLT_A429                184
63054a6ec8aSchristos 
63154a6ec8aSchristos /*
63254a6ec8aSchristos  * Arinc 653 Interpartition Communication messages.
63354a6ec8aSchristos  * DLT_ requested by Gianluca Varenni <gianluca.varenni@cacetech.com>.
63454a6ec8aSchristos  * Please refer to the A653-1 standard for more information.
63554a6ec8aSchristos  */
63654a6ec8aSchristos #define DLT_A653_ICM            185
63754a6ec8aSchristos 
63854a6ec8aSchristos /*
63954a6ec8aSchristos  * USB packets, beginning with a USB setup header; requested by
64054a6ec8aSchristos  * Paolo Abeni <paolo.abeni@email.it>.
64154a6ec8aSchristos  */
64254a6ec8aSchristos #define DLT_USB			186
64354a6ec8aSchristos 
64454a6ec8aSchristos /*
64554a6ec8aSchristos  * Bluetooth HCI UART transport layer (part H:4); requested by
64654a6ec8aSchristos  * Paolo Abeni.
64754a6ec8aSchristos  */
64854a6ec8aSchristos #define DLT_BLUETOOTH_HCI_H4	187
64954a6ec8aSchristos 
65054a6ec8aSchristos /*
65154a6ec8aSchristos  * IEEE 802.16 MAC Common Part Sublayer; requested by Maria Cruz
65254a6ec8aSchristos  * <cruz_petagay@bah.com>.
65354a6ec8aSchristos  */
65454a6ec8aSchristos #define DLT_IEEE802_16_MAC_CPS	188
65554a6ec8aSchristos 
65654a6ec8aSchristos /*
65754a6ec8aSchristos  * USB packets, beginning with a Linux USB header; requested by
65854a6ec8aSchristos  * Paolo Abeni <paolo.abeni@email.it>.
65954a6ec8aSchristos  */
66054a6ec8aSchristos #define DLT_USB_LINUX		189
66154a6ec8aSchristos 
66254a6ec8aSchristos /*
66354a6ec8aSchristos  * Controller Area Network (CAN) v. 2.0B packets.
66454a6ec8aSchristos  * DLT_ requested by Gianluca Varenni <gianluca.varenni@cacetech.com>.
66554a6ec8aSchristos  * Used to dump CAN packets coming from a CAN Vector board.
66654a6ec8aSchristos  * More documentation on the CAN v2.0B frames can be found at
66754a6ec8aSchristos  * http://www.can-cia.org/downloads/?269
66854a6ec8aSchristos  */
66954a6ec8aSchristos #define DLT_CAN20B              190
67054a6ec8aSchristos 
67154a6ec8aSchristos /*
67254a6ec8aSchristos  * IEEE 802.15.4, with address fields padded, as is done by Linux
67354a6ec8aSchristos  * drivers; requested by Juergen Schimmer.
67454a6ec8aSchristos  */
67554a6ec8aSchristos #define DLT_IEEE802_15_4_LINUX	191
67654a6ec8aSchristos 
67754a6ec8aSchristos /*
67854a6ec8aSchristos  * Per Packet Information encapsulated packets.
67954a6ec8aSchristos  * DLT_ requested by Gianluca Varenni <gianluca.varenni@cacetech.com>.
68054a6ec8aSchristos  */
68154a6ec8aSchristos #define DLT_PPI			192
68254a6ec8aSchristos 
68354a6ec8aSchristos /*
68454a6ec8aSchristos  * Header for 802.16 MAC Common Part Sublayer plus a radiotap radio header;
68554a6ec8aSchristos  * requested by Charles Clancy.
68654a6ec8aSchristos  */
68754a6ec8aSchristos #define DLT_IEEE802_16_MAC_CPS_RADIO	193
68854a6ec8aSchristos 
68954a6ec8aSchristos /*
69054a6ec8aSchristos  * Juniper-private data link type, as per request from
69154a6ec8aSchristos  * Hannes Gredler <hannes@juniper.net>.
69254a6ec8aSchristos  * The DLT_ is used for internal communication with a
69354a6ec8aSchristos  * integrated service module (ISM).
69454a6ec8aSchristos  */
69554a6ec8aSchristos #define DLT_JUNIPER_ISM         194
69654a6ec8aSchristos 
69754a6ec8aSchristos /*
69854a6ec8aSchristos  * IEEE 802.15.4, exactly as it appears in the spec (no padding, no
69954a6ec8aSchristos  * nothing); requested by Mikko Saarnivala <mikko.saarnivala@sensinode.com>.
70054a6ec8aSchristos  */
70154a6ec8aSchristos #define DLT_IEEE802_15_4	195
70254a6ec8aSchristos 
70354a6ec8aSchristos /*
70454a6ec8aSchristos  * Various link-layer types, with a pseudo-header, for SITA
70554a6ec8aSchristos  * (http://www.sita.aero/); requested by Fulko Hew (fulko.hew@gmail.com).
70654a6ec8aSchristos  */
70754a6ec8aSchristos #define DLT_SITA		196
70854a6ec8aSchristos 
70954a6ec8aSchristos /*
71054a6ec8aSchristos  * Various link-layer types, with a pseudo-header, for Endace DAG cards;
71154a6ec8aSchristos  * encapsulates Endace ERF records.  Requested by Stephen Donnelly
71254a6ec8aSchristos  * <stephen@endace.com>.
71354a6ec8aSchristos  */
71454a6ec8aSchristos #define DLT_ERF			197
71554a6ec8aSchristos 
71654a6ec8aSchristos /*
71754a6ec8aSchristos  * Special header prepended to Ethernet packets when capturing from a
71854a6ec8aSchristos  * u10 Networks board.  Requested by Phil Mulholland
71954a6ec8aSchristos  * <phil@u10networks.com>.
72054a6ec8aSchristos  */
72154a6ec8aSchristos #define DLT_RAIF1		198
72254a6ec8aSchristos 
72354a6ec8aSchristos /*
72454a6ec8aSchristos  * IPMB packet for IPMI, beginning with the I2C slave address, followed
72554a6ec8aSchristos  * by the netFn and LUN, etc..  Requested by Chanthy Toeung
72654a6ec8aSchristos  * <chanthy.toeung@ca.kontron.com>.
72754a6ec8aSchristos  */
72854a6ec8aSchristos #define DLT_IPMB		199
72954a6ec8aSchristos 
73054a6ec8aSchristos /*
73154a6ec8aSchristos  * Juniper-private data link type, as per request from
73254a6ec8aSchristos  * Hannes Gredler <hannes@juniper.net>.
73354a6ec8aSchristos  * The DLT_ is used for capturing data on a secure tunnel interface.
73454a6ec8aSchristos  */
73554a6ec8aSchristos #define DLT_JUNIPER_ST          200
73654a6ec8aSchristos 
73754a6ec8aSchristos /*
73854a6ec8aSchristos  * Bluetooth HCI UART transport layer (part H:4), with pseudo-header
73954a6ec8aSchristos  * that includes direction information; requested by Paolo Abeni.
74054a6ec8aSchristos  */
74154a6ec8aSchristos #define DLT_BLUETOOTH_HCI_H4_WITH_PHDR	201
74254a6ec8aSchristos 
74354a6ec8aSchristos /*
74454a6ec8aSchristos  * AX.25 packet with a 1-byte KISS header; see
74554a6ec8aSchristos  *
74654a6ec8aSchristos  *	http://www.ax25.net/kiss.htm
74754a6ec8aSchristos  *
74854a6ec8aSchristos  * as per Richard Stearn <richard@rns-stearn.demon.co.uk>.
74954a6ec8aSchristos  */
75054a6ec8aSchristos #define DLT_AX25_KISS		202
75154a6ec8aSchristos 
75254a6ec8aSchristos /*
75354a6ec8aSchristos  * LAPD packets from an ISDN channel, starting with the address field,
75454a6ec8aSchristos  * with no pseudo-header.
75554a6ec8aSchristos  * Requested by Varuna De Silva <varunax@gmail.com>.
75654a6ec8aSchristos  */
75754a6ec8aSchristos #define DLT_LAPD		203
75854a6ec8aSchristos 
75954a6ec8aSchristos /*
76054a6ec8aSchristos  * Variants of various link-layer headers, with a one-byte direction
76154a6ec8aSchristos  * pseudo-header prepended - zero means "received by this host",
76254a6ec8aSchristos  * non-zero (any non-zero value) means "sent by this host" - as per
76354a6ec8aSchristos  * Will Barker <w.barker@zen.co.uk>.
76454a6ec8aSchristos  */
76554a6ec8aSchristos #define DLT_PPP_WITH_DIR	204	/* PPP - don't confuse with DLT_PPP_WITH_DIRECTION */
76654a6ec8aSchristos #define DLT_C_HDLC_WITH_DIR	205	/* Cisco HDLC */
76754a6ec8aSchristos #define DLT_FRELAY_WITH_DIR	206	/* Frame Relay */
76854a6ec8aSchristos #define DLT_LAPB_WITH_DIR	207	/* LAPB */
76954a6ec8aSchristos 
77054a6ec8aSchristos /*
77154a6ec8aSchristos  * 208 is reserved for an as-yet-unspecified proprietary link-layer
77254a6ec8aSchristos  * type, as requested by Will Barker.
77354a6ec8aSchristos  */
77454a6ec8aSchristos 
77554a6ec8aSchristos /*
77654a6ec8aSchristos  * IPMB with a Linux-specific pseudo-header; as requested by Alexey Neyman
77754a6ec8aSchristos  * <avn@pigeonpoint.com>.
77854a6ec8aSchristos  */
77954a6ec8aSchristos #define DLT_IPMB_LINUX		209
78054a6ec8aSchristos 
78154a6ec8aSchristos /*
78254a6ec8aSchristos  * FlexRay automotive bus - http://www.flexray.com/ - as requested
78354a6ec8aSchristos  * by Hannes Kaelber <hannes.kaelber@x2e.de>.
78454a6ec8aSchristos  */
78554a6ec8aSchristos #define DLT_FLEXRAY		210
78654a6ec8aSchristos 
78754a6ec8aSchristos /*
78854a6ec8aSchristos  * Media Oriented Systems Transport (MOST) bus for multimedia
78954a6ec8aSchristos  * transport - http://www.mostcooperation.com/ - as requested
79054a6ec8aSchristos  * by Hannes Kaelber <hannes.kaelber@x2e.de>.
79154a6ec8aSchristos  */
79254a6ec8aSchristos #define DLT_MOST		211
79354a6ec8aSchristos 
79454a6ec8aSchristos /*
79554a6ec8aSchristos  * Local Interconnect Network (LIN) bus for vehicle networks -
79654a6ec8aSchristos  * http://www.lin-subbus.org/ - as requested by Hannes Kaelber
79754a6ec8aSchristos  * <hannes.kaelber@x2e.de>.
79854a6ec8aSchristos  */
79954a6ec8aSchristos #define DLT_LIN			212
80054a6ec8aSchristos 
80154a6ec8aSchristos /*
80254a6ec8aSchristos  * X2E-private data link type used for serial line capture,
80354a6ec8aSchristos  * as requested by Hannes Kaelber <hannes.kaelber@x2e.de>.
80454a6ec8aSchristos  */
80554a6ec8aSchristos #define DLT_X2E_SERIAL		213
80654a6ec8aSchristos 
80754a6ec8aSchristos /*
80854a6ec8aSchristos  * X2E-private data link type used for the Xoraya data logger
80954a6ec8aSchristos  * family, as requested by Hannes Kaelber <hannes.kaelber@x2e.de>.
81054a6ec8aSchristos  */
81154a6ec8aSchristos #define DLT_X2E_XORAYA		214
81254a6ec8aSchristos 
81354a6ec8aSchristos /*
81454a6ec8aSchristos  * IEEE 802.15.4, exactly as it appears in the spec (no padding, no
81554a6ec8aSchristos  * nothing), but with the PHY-level data for non-ASK PHYs (4 octets
81654a6ec8aSchristos  * of 0 as preamble, one octet of SFD, one octet of frame length+
81754a6ec8aSchristos  * reserved bit, and then the MAC-layer data, starting with the
81854a6ec8aSchristos  * frame control field).
81954a6ec8aSchristos  *
82054a6ec8aSchristos  * Requested by Max Filippov <jcmvbkbc@gmail.com>.
82154a6ec8aSchristos  */
82254a6ec8aSchristos #define DLT_IEEE802_15_4_NONASK_PHY	215
82354a6ec8aSchristos 
82454a6ec8aSchristos /*
82554a6ec8aSchristos  * David Gibson <david@gibson.dropbear.id.au> requested this for
82654a6ec8aSchristos  * captures from the Linux kernel /dev/input/eventN devices. This
82754a6ec8aSchristos  * is used to communicate keystrokes and mouse movements from the
82854a6ec8aSchristos  * Linux kernel to display systems, such as Xorg.
82954a6ec8aSchristos  */
83054a6ec8aSchristos #define DLT_LINUX_EVDEV		216
83154a6ec8aSchristos 
83254a6ec8aSchristos /*
83354a6ec8aSchristos  * GSM Um and Abis interfaces, preceded by a "gsmtap" header.
83454a6ec8aSchristos  *
83554a6ec8aSchristos  * Requested by Harald Welte <laforge@gnumonks.org>.
83654a6ec8aSchristos  */
83754a6ec8aSchristos #define DLT_GSMTAP_UM		217
83854a6ec8aSchristos #define DLT_GSMTAP_ABIS		218
83954a6ec8aSchristos 
84054a6ec8aSchristos /*
84154a6ec8aSchristos  * MPLS, with an MPLS label as the link-layer header.
84254a6ec8aSchristos  * Requested by Michele Marchetto <michele@openbsd.org> on behalf
84354a6ec8aSchristos  * of OpenBSD.
84454a6ec8aSchristos  */
84554a6ec8aSchristos #define DLT_MPLS		219
84654a6ec8aSchristos 
84754a6ec8aSchristos /*
84854a6ec8aSchristos  * USB packets, beginning with a Linux USB header, with the USB header
84954a6ec8aSchristos  * padded to 64 bytes; required for memory-mapped access.
85054a6ec8aSchristos  */
85154a6ec8aSchristos #define DLT_USB_LINUX_MMAPPED	220
85254a6ec8aSchristos 
85354a6ec8aSchristos /*
85454a6ec8aSchristos  * DECT packets, with a pseudo-header; requested by
85554a6ec8aSchristos  * Matthias Wenzel <tcpdump@mazzoo.de>.
85654a6ec8aSchristos  */
85754a6ec8aSchristos #define DLT_DECT		221
85854a6ec8aSchristos 
85954a6ec8aSchristos /*
86054a6ec8aSchristos  * From: "Lidwa, Eric (GSFC-582.0)[SGT INC]" <eric.lidwa-1@nasa.gov>
86154a6ec8aSchristos  * Date: Mon, 11 May 2009 11:18:30 -0500
86254a6ec8aSchristos  *
86354a6ec8aSchristos  * DLT_AOS. We need it for AOS Space Data Link Protocol.
86454a6ec8aSchristos  *   I have already written dissectors for but need an OK from
86554a6ec8aSchristos  *   legal before I can submit a patch.
86654a6ec8aSchristos  *
86754a6ec8aSchristos  */
86854a6ec8aSchristos #define DLT_AOS                 222
86954a6ec8aSchristos 
87054a6ec8aSchristos /*
87154a6ec8aSchristos  * Wireless HART (Highway Addressable Remote Transducer)
87254a6ec8aSchristos  * From the HART Communication Foundation
87354a6ec8aSchristos  * IES/PAS 62591
87454a6ec8aSchristos  *
87554a6ec8aSchristos  * Requested by Sam Roberts <vieuxtech@gmail.com>.
87654a6ec8aSchristos  */
87754a6ec8aSchristos #define DLT_WIHART		223
87854a6ec8aSchristos 
87954a6ec8aSchristos /*
88054a6ec8aSchristos  * Fibre Channel FC-2 frames, beginning with a Frame_Header.
88154a6ec8aSchristos  * Requested by Kahou Lei <kahou82@gmail.com>.
88254a6ec8aSchristos  */
88354a6ec8aSchristos #define DLT_FC_2		224
88454a6ec8aSchristos 
88554a6ec8aSchristos /*
88654a6ec8aSchristos  * Fibre Channel FC-2 frames, beginning with an encoding of the
88754a6ec8aSchristos  * SOF, and ending with an encoding of the EOF.
88854a6ec8aSchristos  *
88954a6ec8aSchristos  * The encodings represent the frame delimiters as 4-byte sequences
89054a6ec8aSchristos  * representing the corresponding ordered sets, with K28.5
89154a6ec8aSchristos  * represented as 0xBC, and the D symbols as the corresponding
89254a6ec8aSchristos  * byte values; for example, SOFi2, which is K28.5 - D21.5 - D1.2 - D21.2,
89354a6ec8aSchristos  * is represented as 0xBC 0xB5 0x55 0x55.
89454a6ec8aSchristos  *
89554a6ec8aSchristos  * Requested by Kahou Lei <kahou82@gmail.com>.
89654a6ec8aSchristos  */
89754a6ec8aSchristos #define DLT_FC_2_WITH_FRAME_DELIMS	225
89854a6ec8aSchristos 
89954a6ec8aSchristos /*
90054a6ec8aSchristos  * Solaris ipnet pseudo-header; requested by Darren Reed <Darren.Reed@Sun.COM>.
90154a6ec8aSchristos  *
90254a6ec8aSchristos  * The pseudo-header starts with a one-byte version number; for version 2,
90354a6ec8aSchristos  * the pseudo-header is:
90454a6ec8aSchristos  *
90554a6ec8aSchristos  * struct dl_ipnetinfo {
90654a6ec8aSchristos  *     u_int8_t   dli_version;
90754a6ec8aSchristos  *     u_int8_t   dli_family;
90854a6ec8aSchristos  *     u_int16_t  dli_htype;
90954a6ec8aSchristos  *     u_int32_t  dli_pktlen;
91054a6ec8aSchristos  *     u_int32_t  dli_ifindex;
91154a6ec8aSchristos  *     u_int32_t  dli_grifindex;
91254a6ec8aSchristos  *     u_int32_t  dli_zsrc;
91354a6ec8aSchristos  *     u_int32_t  dli_zdst;
91454a6ec8aSchristos  * };
91554a6ec8aSchristos  *
91654a6ec8aSchristos  * dli_version is 2 for the current version of the pseudo-header.
91754a6ec8aSchristos  *
91854a6ec8aSchristos  * dli_family is a Solaris address family value, so it's 2 for IPv4
91954a6ec8aSchristos  * and 26 for IPv6.
92054a6ec8aSchristos  *
92154a6ec8aSchristos  * dli_htype is a "hook type" - 0 for incoming packets, 1 for outgoing
92254a6ec8aSchristos  * packets, and 2 for packets arriving from another zone on the same
92354a6ec8aSchristos  * machine.
92454a6ec8aSchristos  *
92554a6ec8aSchristos  * dli_pktlen is the length of the packet data following the pseudo-header
92654a6ec8aSchristos  * (so the captured length minus dli_pktlen is the length of the
92754a6ec8aSchristos  * pseudo-header, assuming the entire pseudo-header was captured).
92854a6ec8aSchristos  *
92954a6ec8aSchristos  * dli_ifindex is the interface index of the interface on which the
93054a6ec8aSchristos  * packet arrived.
93154a6ec8aSchristos  *
93254a6ec8aSchristos  * dli_grifindex is the group interface index number (for IPMP interfaces).
93354a6ec8aSchristos  *
93454a6ec8aSchristos  * dli_zsrc is the zone identifier for the source of the packet.
93554a6ec8aSchristos  *
93654a6ec8aSchristos  * dli_zdst is the zone identifier for the destination of the packet.
93754a6ec8aSchristos  *
93854a6ec8aSchristos  * A zone number of 0 is the global zone; a zone number of 0xffffffff
93954a6ec8aSchristos  * means that the packet arrived from another host on the network, not
94054a6ec8aSchristos  * from another zone on the same machine.
94154a6ec8aSchristos  *
94254a6ec8aSchristos  * An IPv4 or IPv6 datagram follows the pseudo-header; dli_family indicates
94354a6ec8aSchristos  * which of those it is.
94454a6ec8aSchristos  */
94554a6ec8aSchristos #define DLT_IPNET			226
94654a6ec8aSchristos 
94754a6ec8aSchristos /*
94854a6ec8aSchristos  * CAN (Controller Area Network) frames, with a pseudo-header as supplied
94954a6ec8aSchristos  * by Linux SocketCAN.  See Documentation/networking/can.txt in the Linux
95054a6ec8aSchristos  * source.
95154a6ec8aSchristos  *
95254a6ec8aSchristos  * Requested by Felix Obenhuber <felix@obenhuber.de>.
95354a6ec8aSchristos  */
95454a6ec8aSchristos #define DLT_CAN_SOCKETCAN		227
95554a6ec8aSchristos 
95654a6ec8aSchristos /*
95754a6ec8aSchristos  * Raw IPv4/IPv6; different from DLT_RAW in that the DLT_ value specifies
95854a6ec8aSchristos  * whether it's v4 or v6.  Requested by Darren Reed <Darren.Reed@Sun.COM>.
95954a6ec8aSchristos  */
96054a6ec8aSchristos #define DLT_IPV4			228
96154a6ec8aSchristos #define DLT_IPV6			229
96254a6ec8aSchristos 
96354a6ec8aSchristos /*
96454a6ec8aSchristos  * DLT and savefile link type values are split into a class and
96554a6ec8aSchristos  * a member of that class.  A class value of 0 indicates a regular
96654a6ec8aSchristos  * DLT_/LINKTYPE_ value.
96754a6ec8aSchristos  */
96854a6ec8aSchristos #define DLT_CLASS(x)		((x) & 0x03ff0000)
96954a6ec8aSchristos 
97054a6ec8aSchristos /*
97154a6ec8aSchristos  * NetBSD-specific generic "raw" link type.  The class value indicates
97254a6ec8aSchristos  * that this is the generic raw type, and the lower 16 bits are the
97354a6ec8aSchristos  * address family we're dealing with.  Those values are NetBSD-specific;
97454a6ec8aSchristos  * do not assume that they correspond to AF_ values for your operating
97554a6ec8aSchristos  * system.
97654a6ec8aSchristos  */
97754a6ec8aSchristos #define	DLT_CLASS_NETBSD_RAWAF	0x02240000
97854a6ec8aSchristos #define	DLT_NETBSD_RAWAF(af)	(DLT_CLASS_NETBSD_RAWAF | (af))
97954a6ec8aSchristos #define	DLT_NETBSD_RAWAF_AF(x)	((x) & 0x0000ffff)
98054a6ec8aSchristos #define	DLT_IS_NETBSD_RAWAF(x)	(DLT_CLASS(x) == DLT_CLASS_NETBSD_RAWAF)
98154a6ec8aSchristos 
98254a6ec8aSchristos 
98354a6ec8aSchristos /*
98454a6ec8aSchristos  * The instruction encodings.
98554a6ec8aSchristos  */
98654a6ec8aSchristos /* instruction classes */
98754a6ec8aSchristos #define BPF_CLASS(code) ((code) & 0x07)
98854a6ec8aSchristos #define		BPF_LD		0x00
98954a6ec8aSchristos #define		BPF_LDX		0x01
99054a6ec8aSchristos #define		BPF_ST		0x02
99154a6ec8aSchristos #define		BPF_STX		0x03
99254a6ec8aSchristos #define		BPF_ALU		0x04
99354a6ec8aSchristos #define		BPF_JMP		0x05
99454a6ec8aSchristos #define		BPF_RET		0x06
99554a6ec8aSchristos #define		BPF_MISC	0x07
99654a6ec8aSchristos 
99754a6ec8aSchristos /* ld/ldx fields */
99854a6ec8aSchristos #define BPF_SIZE(code)	((code) & 0x18)
99954a6ec8aSchristos #define		BPF_W		0x00
100054a6ec8aSchristos #define		BPF_H		0x08
100154a6ec8aSchristos #define		BPF_B		0x10
100254a6ec8aSchristos #define BPF_MODE(code)	((code) & 0xe0)
100354a6ec8aSchristos #define		BPF_IMM 	0x00
100454a6ec8aSchristos #define		BPF_ABS		0x20
100554a6ec8aSchristos #define		BPF_IND		0x40
100654a6ec8aSchristos #define		BPF_MEM		0x60
100754a6ec8aSchristos #define		BPF_LEN		0x80
100854a6ec8aSchristos #define		BPF_MSH		0xa0
100954a6ec8aSchristos 
101054a6ec8aSchristos /* alu/jmp fields */
101154a6ec8aSchristos #define BPF_OP(code)	((code) & 0xf0)
101254a6ec8aSchristos #define		BPF_ADD		0x00
101354a6ec8aSchristos #define		BPF_SUB		0x10
101454a6ec8aSchristos #define		BPF_MUL		0x20
101554a6ec8aSchristos #define		BPF_DIV		0x30
101654a6ec8aSchristos #define		BPF_OR		0x40
101754a6ec8aSchristos #define		BPF_AND		0x50
101854a6ec8aSchristos #define		BPF_LSH		0x60
101954a6ec8aSchristos #define		BPF_RSH		0x70
102054a6ec8aSchristos #define		BPF_NEG		0x80
102154a6ec8aSchristos #define		BPF_JA		0x00
102254a6ec8aSchristos #define		BPF_JEQ		0x10
102354a6ec8aSchristos #define		BPF_JGT		0x20
102454a6ec8aSchristos #define		BPF_JGE		0x30
102554a6ec8aSchristos #define		BPF_JSET	0x40
102654a6ec8aSchristos #define BPF_SRC(code)	((code) & 0x08)
102754a6ec8aSchristos #define		BPF_K		0x00
102854a6ec8aSchristos #define		BPF_X		0x08
102954a6ec8aSchristos 
103054a6ec8aSchristos /* ret - BPF_K and BPF_X also apply */
103154a6ec8aSchristos #define BPF_RVAL(code)	((code) & 0x18)
103254a6ec8aSchristos #define		BPF_A		0x10
103354a6ec8aSchristos 
103454a6ec8aSchristos /* misc */
103554a6ec8aSchristos #define BPF_MISCOP(code) ((code) & 0xf8)
103654a6ec8aSchristos #define		BPF_TAX		0x00
103754a6ec8aSchristos #define		BPF_TXA		0x80
103854a6ec8aSchristos 
103954a6ec8aSchristos /*
104054a6ec8aSchristos  * The instruction data structure.
104154a6ec8aSchristos  */
104254a6ec8aSchristos struct bpf_insn {
104354a6ec8aSchristos 	u_short	code;
104454a6ec8aSchristos 	u_char 	jt;
104554a6ec8aSchristos 	u_char 	jf;
104654a6ec8aSchristos 	bpf_u_int32 k;
104754a6ec8aSchristos };
104854a6ec8aSchristos 
104954a6ec8aSchristos /*
105054a6ec8aSchristos  * Macros for insn array initializers.
105154a6ec8aSchristos  */
105254a6ec8aSchristos #define BPF_STMT(code, k) { (u_short)(code), 0, 0, k }
105354a6ec8aSchristos #define BPF_JUMP(code, k, jt, jf) { (u_short)(code), jt, jf, k }
105454a6ec8aSchristos 
105554a6ec8aSchristos #if __STDC__ || defined(__cplusplus)
105654a6ec8aSchristos extern int bpf_validate(const struct bpf_insn *, int);
105754a6ec8aSchristos extern u_int bpf_filter(const struct bpf_insn *, const u_char *, u_int, u_int);
105854a6ec8aSchristos #else
105954a6ec8aSchristos extern int bpf_validate();
106054a6ec8aSchristos extern u_int bpf_filter();
106154a6ec8aSchristos #endif
106254a6ec8aSchristos 
106354a6ec8aSchristos /*
106454a6ec8aSchristos  * Number of scratch memory words (for BPF_LD|BPF_MEM and BPF_ST).
106554a6ec8aSchristos  */
106654a6ec8aSchristos #define BPF_MEMWORDS 16
106754a6ec8aSchristos 
106854a6ec8aSchristos #ifdef __cplusplus
106954a6ec8aSchristos }
107054a6ec8aSchristos #endif
107154a6ec8aSchristos 
107254a6ec8aSchristos #endif
1073