Home | History | Annotate | Line # | Download | only in net
      1  1.25  christos /*	$NetBSD: dlt.h,v 1.25 2024/09/02 15:34:08 christos Exp $	*/
      2   1.1   thorpej 
      3  1.13  christos /*-
      4  1.13  christos  * Copyright (c) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997
      5   1.1   thorpej  *	The Regents of the University of California.  All rights reserved.
      6   1.1   thorpej  *
      7   1.1   thorpej  * This code is derived from the Stanford/CMU enet packet filter,
      8   1.1   thorpej  * (net/enet.c) distributed as part of 4.3BSD, and code contributed
      9   1.1   thorpej  * to Berkeley by Steven McCanne and Van Jacobson both of Lawrence
     10   1.1   thorpej  * Berkeley Laboratory.
     11   1.1   thorpej  *
     12   1.1   thorpej  * Redistribution and use in source and binary forms, with or without
     13   1.1   thorpej  * modification, are permitted provided that the following conditions
     14   1.1   thorpej  * are met:
     15   1.1   thorpej  * 1. Redistributions of source code must retain the above copyright
     16   1.1   thorpej  *    notice, this list of conditions and the following disclaimer.
     17   1.1   thorpej  * 2. Redistributions in binary form must reproduce the above copyright
     18   1.1   thorpej  *    notice, this list of conditions and the following disclaimer in the
     19   1.1   thorpej  *    documentation and/or other materials provided with the distribution.
     20  1.19  christos  * 3. Neither the name of the University nor the names of its contributors
     21   1.1   thorpej  *    may be used to endorse or promote products derived from this software
     22   1.1   thorpej  *    without specific prior written permission.
     23   1.1   thorpej  *
     24   1.1   thorpej  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
     25   1.1   thorpej  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     26   1.1   thorpej  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     27   1.1   thorpej  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
     28   1.1   thorpej  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
     29   1.1   thorpej  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
     30   1.1   thorpej  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     31   1.1   thorpej  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
     32   1.1   thorpej  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
     33   1.1   thorpej  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
     34   1.1   thorpej  * SUCH DAMAGE.
     35   1.1   thorpej  *
     36  1.13  christos  *      @(#)bpf.h       7.1 (Berkeley) 5/7/91
     37   1.1   thorpej  */
     38   1.1   thorpej 
     39   1.1   thorpej #ifndef _NET_DLT_H_
     40   1.1   thorpej #define _NET_DLT_H_
     41  1.24  christos 
     42  1.13  christos /*
     43  1.13  christos  * Link-layer header type codes.
     44  1.13  christos  *
     45  1.13  christos  * Do *NOT* add new values to this list without asking
     46  1.13  christos  * "tcpdump-workers (at) lists.tcpdump.org" for a value.  Otherwise, you run
     47  1.13  christos  * the risk of using a value that's already being used for some other
     48  1.13  christos  * purpose, and of having tools that read libpcap-format captures not
     49  1.13  christos  * being able to handle captures with your new DLT_ value, with no hope
     50  1.13  christos  * that they will ever be changed to do so (as that would destroy their
     51  1.13  christos  * ability to read captures using that value for that other purpose).
     52  1.13  christos  *
     53  1.13  christos  * See
     54  1.13  christos  *
     55  1.19  christos  *	https://www.tcpdump.org/linktypes.html
     56  1.13  christos  *
     57  1.13  christos  * for detailed descriptions of some of these link-layer header types.
     58  1.13  christos  */
     59   1.1   thorpej 
     60   1.1   thorpej /*
     61  1.13  christos  * These are the types that are the same on all platforms, and that
     62  1.13  christos  * have been defined by <net/bpf.h> for ages.
     63  1.25  christos  *
     64  1.25  christos  * DLT_LOW_MATCHING_MIN is the lowest such value; DLT_LOW_MATCHING_MAX
     65  1.25  christos  * is the highest such value.
     66   1.1   thorpej  */
     67  1.25  christos #define DLT_LOW_MATCHING_MIN	0
     68  1.25  christos 
     69  1.13  christos #define DLT_NULL	0	/* BSD loopback encapsulation */
     70   1.1   thorpej #define DLT_EN10MB	1	/* Ethernet (10Mb) */
     71   1.1   thorpej #define DLT_EN3MB	2	/* Experimental Ethernet (3Mb) */
     72   1.1   thorpej #define DLT_AX25	3	/* Amateur Radio AX.25 */
     73   1.1   thorpej #define DLT_PRONET	4	/* Proteon ProNET Token Ring */
     74   1.1   thorpej #define DLT_CHAOS	5	/* Chaos */
     75  1.13  christos #define DLT_IEEE802	6	/* 802.5 Token Ring */
     76  1.13  christos #define DLT_ARCNET	7	/* ARCNET, with BSD-style header */
     77   1.1   thorpej #define DLT_SLIP	8	/* Serial Line IP */
     78   1.1   thorpej #define DLT_PPP		9	/* Point-to-point Protocol */
     79   1.1   thorpej #define DLT_FDDI	10	/* FDDI */
     80  1.13  christos 
     81  1.25  christos  /*
     82  1.25  christos  * In case the code that includes this file (directly or indirectly)
     83  1.25  christos  * has also included OS files that happen to define DLT_LOW_MATCHING_MAX,
     84  1.25  christos  * with a different value (perhaps because that OS hasn't picked up
     85  1.25  christos  * the latest version of our DLT definitions), we undefine the
     86  1.25  christos  * previous value of DLT_LOW_MATCHING_MAX.
     87  1.25  christos  *
     88  1.25  christos  * (They shouldn't, because only those 10 values were assigned in
     89  1.25  christos  * the Good Old Days, before DLT_ code assignment became a bit of
     90  1.25  christos  * a free-for-all.  Perhaps 11 is DLT_ATM_RFC1483 everywhere 11
     91  1.25  christos  * is used at all, but 12 is DLT_RAW on some platforms but not
     92  1.25  christos  * OpenBSD, and the fun continues for several other values.)
     93  1.25  christos  */
     94  1.25  christos #ifdef DLT_LOW_MATCHING_MAX
     95  1.25  christos #undef DLT_LOW_MATCHING_MAX
     96  1.25  christos #endif
     97  1.25  christos 
     98  1.25  christos #define DLT_LOW_MATCHING_MAX	DLT_FDDI	/* highest value in this "matching" range */
     99  1.25  christos 
    100  1.13  christos /*
    101  1.13  christos  * These are types that are different on some platforms, and that
    102  1.13  christos  * have been defined by <net/bpf.h> for ages.  We use #ifdefs to
    103  1.13  christos  * detect the BSDs that define them differently from the traditional
    104  1.13  christos  * libpcap <net/bpf.h>
    105  1.13  christos  *
    106  1.13  christos  * XXX - DLT_ATM_RFC1483 is 13 in BSD/OS, and DLT_RAW is 14 in BSD/OS,
    107  1.25  christos  * but I don't know what the right #define is for BSD/OS.  The last
    108  1.25  christos  * release was in October 2003; if anybody cares about making this
    109  1.25  christos  * work on BSD/OS, give us a pull request for a change to make it work.
    110  1.13  christos  */
    111  1.13  christos #define DLT_ATM_RFC1483	11	/* LLC-encapsulated ATM */
    112  1.13  christos 
    113  1.13  christos #ifdef __OpenBSD__
    114  1.13  christos #define DLT_RAW		14	/* raw IP */
    115  1.13  christos #else
    116   1.1   thorpej #define DLT_RAW		12	/* raw IP */
    117  1.13  christos #endif
    118  1.13  christos 
    119  1.13  christos /*
    120  1.13  christos  * Given that the only OS that currently generates BSD/OS SLIP or PPP
    121  1.13  christos  * is, well, BSD/OS, arguably everybody should have chosen its values
    122  1.13  christos  * for DLT_SLIP_BSDOS and DLT_PPP_BSDOS, which are 15 and 16, but they
    123  1.13  christos  * didn't.  So it goes.
    124  1.13  christos  */
    125  1.13  christos #if defined(__NetBSD__) || defined(__FreeBSD__)
    126  1.13  christos #ifndef DLT_SLIP_BSDOS
    127   1.1   thorpej #define DLT_SLIP_BSDOS	13	/* BSD/OS Serial Line IP */
    128   1.1   thorpej #define DLT_PPP_BSDOS	14	/* BSD/OS Point-to-point Protocol */
    129  1.13  christos #endif
    130  1.13  christos #else
    131  1.13  christos #define DLT_SLIP_BSDOS	15	/* BSD/OS Serial Line IP */
    132  1.13  christos #define DLT_PPP_BSDOS	16	/* BSD/OS Point-to-point Protocol */
    133  1.13  christos #endif
    134  1.13  christos 
    135  1.13  christos /*
    136  1.24  christos  * NetBSD uses 15 for HIPPI.
    137  1.24  christos  *
    138  1.24  christos  * From a quick look at sys/net/if_hippi.h and sys/net/if_hippisubr.c
    139  1.24  christos  * in an older version of NetBSD , the header appears to be:
    140  1.24  christos  *
    141  1.24  christos  *	a 1-byte ULP field (ULP-id)?
    142  1.24  christos  *
    143  1.24  christos  *	a 1-byte flags field;
    144  1.24  christos  *
    145  1.24  christos  *	a 2-byte "offsets" field;
    146  1.24  christos  *
    147  1.24  christos  *	a 4-byte "D2 length" field (D2_Size?);
    148  1.24  christos  *
    149  1.24  christos  *	a 4-byte "destination switch" field (or a 1-byte field
    150  1.24  christos  *	containing the Forwarding Class, Double_Wide, and Message_Type
    151  1.24  christos  *	sub fields, followed by a 3-byte Destination_Switch_Address
    152  1.24  christos  *	field?, HIPPI-LE 3.4-style?);
    153  1.24  christos  *
    154  1.24  christos  *	a 4-byte "source switch" field (or a 1-byte field containing the
    155  1.24  christos  *	Destination_Address_type and Source_Address_Type fields, followed
    156  1.24  christos  *	by a 3-byte Source_Switch_Address field, HIPPI-LE 3.4-style?);
    157  1.24  christos  *
    158  1.24  christos  *	a 2-byte reserved field;
    159  1.24  christos  *
    160  1.24  christos  *	a 6-byte destination address field;
    161  1.24  christos  *
    162  1.24  christos  *	a 2-byte "local admin" field;
    163  1.24  christos  *
    164  1.24  christos  *	a 6-byte source address field;
    165  1.24  christos  *
    166  1.24  christos  * followed by an 802.2 LLC header.
    167  1.24  christos  *
    168  1.24  christos  * This looks somewhat like something derived from the HIPPI-FP 4.4
    169  1.24  christos  * Header_Area, followed an HIPPI-FP 4.4 D1_Area containing a D1 data set
    170  1.24  christos  * with the header in HIPPI-LE 3.4 (ANSI X3.218-1993), followed by an
    171  1.24  christos  * HIPPI-FP 4.4 D2_Area (with no Offset) containing the 802.2 LLC header
    172  1.24  christos  * and payload?  Or does the "offsets" field contain the D2_Offset,
    173  1.24  christos  * with that many bytes of offset before the payload?
    174  1.24  christos  *
    175  1.24  christos  * See http://wotug.org/parallel/standards/hippi/ for an archive of
    176  1.24  christos  * HIPPI specifications.
    177  1.24  christos  *
    178  1.24  christos  * RFC 2067 imposes some additional restrictions.  It says that the
    179  1.24  christos  * Offset is always zero
    180  1.24  christos  *
    181  1.24  christos  * HIPPI is long-gone, and the source files found in an older version
    182  1.24  christos  * of NetBSD don't appear to be in the main CVS branch, so we may never
    183  1.24  christos  * see a capture with this link-layer type.
    184  1.24  christos  */
    185  1.24  christos #if defined(__NetBSD__)
    186  1.24  christos #define DLT_HIPPI	15	/* HIPPI */
    187  1.24  christos #endif
    188  1.24  christos 
    189  1.24  christos /*
    190  1.24  christos  * NetBSD uses 16 for DLT_HDLC; see below.
    191  1.24  christos  * BSD/OS uses it for PPP; see above.
    192  1.24  christos  * As far as I know, no other OS uses it for anything; don't use it
    193  1.24  christos  * for anything else.
    194  1.24  christos  */
    195  1.24  christos 
    196  1.24  christos /*
    197  1.13  christos  * 17 was used for DLT_PFLOG in OpenBSD; it no longer is.
    198  1.13  christos  *
    199  1.13  christos  * It was DLT_LANE8023 in SuSE 6.3, so we defined LINKTYPE_PFLOG
    200  1.13  christos  * as 117 so that pflog captures would use a link-layer header type
    201  1.13  christos  * value that didn't collide with any other values.  On all
    202  1.13  christos  * platforms other than OpenBSD, we defined DLT_PFLOG as 117,
    203  1.13  christos  * and we mapped between LINKTYPE_PFLOG and DLT_PFLOG.
    204  1.13  christos  *
    205  1.13  christos  * OpenBSD eventually switched to using 117 for DLT_PFLOG as well.
    206  1.13  christos  *
    207  1.13  christos  * Don't use 17 for anything else.
    208  1.13  christos  */
    209  1.13  christos 
    210  1.13  christos /*
    211  1.13  christos  * 18 is used for DLT_PFSYNC in OpenBSD, NetBSD, DragonFly BSD and
    212  1.19  christos  * macOS; don't use it for anything else.  (FreeBSD uses 121, which
    213  1.19  christos  * collides with DLT_HHDLC, even though it doesn't use 18 for
    214  1.19  christos  * anything and doesn't appear to have ever used it for anything.)
    215  1.13  christos  *
    216  1.13  christos  * We define it as 18 on those platforms; it is, unfortunately, used
    217  1.25  christos  * for DLT_CIP in SUSE 6.3, so we don't define it as 18 on all
    218  1.25  christos  * platforms. We define it as 121 on FreeBSD and as the same
    219  1.25  christos  * value that we assigned to LINKTYPE_PFSYNC on all remaining
    220  1.25  christos  * platforms.
    221  1.13  christos  */
    222  1.13  christos #if defined(__OpenBSD__) || defined(__NetBSD__) || defined(__DragonFly__) || defined(__APPLE__)
    223  1.13  christos #define DLT_PFSYNC	18
    224  1.13  christos #endif
    225   1.1   thorpej 
    226  1.24  christos #define DLT_ATM_CLIP	19	/* Linux Classical IP over ATM */
    227   1.3     bjh21 
    228  1.13  christos /*
    229  1.13  christos  * Apparently Redback uses this for its SmartEdge 400/800.  I hope
    230  1.13  christos  * nobody else decided to use it, too.
    231  1.13  christos  */
    232  1.13  christos #define DLT_REDBACK_SMARTEDGE	32
    233  1.13  christos 
    234  1.13  christos /*
    235  1.13  christos  * These values are defined by NetBSD; other platforms should refrain from
    236  1.13  christos  * using them for other purposes, so that NetBSD savefiles with link
    237  1.13  christos  * types of 50 or 51 can be read as this type on all platforms.
    238  1.13  christos  */
    239  1.13  christos #define DLT_PPP_SERIAL	50	/* PPP over serial with HDLC encapsulation */
    240  1.13  christos #define DLT_PPP_ETHER	51	/* PPP over Ethernet */
    241  1.13  christos 
    242  1.13  christos /*
    243  1.13  christos  * The Axent Raptor firewall - now the Symantec Enterprise Firewall - uses
    244  1.13  christos  * a link-layer type of 99 for the tcpdump it supplies.  The link-layer
    245  1.13  christos  * header has 6 bytes of unknown data, something that appears to be an
    246  1.13  christos  * Ethernet type, and 36 bytes that appear to be 0 in at least one capture
    247  1.13  christos  * I've seen.
    248  1.13  christos  */
    249   1.9    dyoung #define DLT_SYMANTEC_FIREWALL	99
    250   1.9    dyoung 
    251  1.13  christos /*
    252  1.13  christos  * Values between 100 and 103 are used in capture file headers as
    253  1.13  christos  * link-layer header type LINKTYPE_ values corresponding to DLT_ types
    254  1.13  christos  * that differ between platforms; don't use those values for new DLT_
    255  1.13  christos  * new types.
    256  1.13  christos  */
    257  1.13  christos 
    258  1.13  christos /*
    259  1.13  christos  * Values starting with 104 are used for newly-assigned link-layer
    260  1.13  christos  * header type values; for those link-layer header types, the DLT_
    261  1.13  christos  * value returned by pcap_datalink() and passed to pcap_open_dead(),
    262  1.13  christos  * and the LINKTYPE_ value that appears in capture files, are the
    263  1.13  christos  * same.
    264  1.13  christos  *
    265  1.25  christos  * DLT_HIGH_MATCHING_MIN is the lowest such value; DLT_HIGH_MATCHING_MAX is
    266  1.13  christos  * the highest such value.
    267  1.13  christos  */
    268  1.25  christos #define DLT_HIGH_MATCHING_MIN	104
    269  1.13  christos 
    270  1.13  christos /*
    271  1.13  christos  * This value was defined by libpcap 0.5; platforms that have defined
    272  1.13  christos  * it with a different value should define it here with that value -
    273  1.13  christos  * a link type of 104 in a save file will be mapped to DLT_C_HDLC,
    274  1.13  christos  * whatever value that happens to be, so programs will correctly
    275  1.13  christos  * handle files with that link type regardless of the value of
    276  1.13  christos  * DLT_C_HDLC.
    277  1.13  christos  *
    278  1.13  christos  * The name DLT_C_HDLC was used by BSD/OS; we use that name for source
    279  1.13  christos  * compatibility with programs written for BSD/OS.
    280  1.13  christos  *
    281  1.13  christos  * libpcap 0.5 defined it as DLT_CHDLC; we define DLT_CHDLC as well,
    282  1.13  christos  * for source compatibility with programs written for libpcap 0.5.
    283  1.13  christos  */
    284  1.13  christos #define DLT_C_HDLC	104	/* Cisco HDLC */
    285  1.13  christos #define DLT_CHDLC	DLT_C_HDLC
    286  1.13  christos 
    287  1.13  christos #define DLT_IEEE802_11	105	/* IEEE 802.11 wireless */
    288  1.13  christos 
    289  1.13  christos /*
    290  1.13  christos  * 106 is reserved for Linux Classical IP over ATM; it's like DLT_RAW,
    291  1.13  christos  * except when it isn't.  (I.e., sometimes it's just raw IP, and
    292  1.13  christos  * sometimes it isn't.)  We currently handle it as DLT_LINUX_SLL,
    293  1.13  christos  * so that we don't have to worry about the link-layer header.)
    294  1.13  christos  */
    295  1.13  christos 
    296  1.13  christos /*
    297  1.13  christos  * Frame Relay; BSD/OS has a DLT_FR with a value of 11, but that collides
    298  1.13  christos  * with other values.
    299  1.13  christos  * DLT_FR and DLT_FRELAY packets start with the Q.922 Frame Relay header
    300  1.13  christos  * (DLCI, etc.).
    301  1.13  christos  */
    302  1.13  christos #define DLT_FRELAY	107
    303  1.13  christos 
    304  1.13  christos /*
    305  1.13  christos  * OpenBSD DLT_LOOP, for loopback devices; it's like DLT_NULL, except
    306  1.13  christos  * that the AF_ type in the link-layer header is in network byte order.
    307  1.13  christos  *
    308  1.13  christos  * DLT_LOOP is 12 in OpenBSD, but that's DLT_RAW in other OSes, so
    309  1.24  christos  * we don't use 12 for it in OSes other than OpenBSD; instead, we
    310  1.24  christos  * use the same value as LINKTYPE_LOOP.
    311  1.13  christos  */
    312  1.13  christos #ifdef __OpenBSD__
    313  1.13  christos #define DLT_LOOP	12
    314  1.13  christos #else
    315  1.13  christos #define DLT_LOOP	108
    316  1.13  christos #endif
    317  1.13  christos 
    318  1.13  christos /*
    319  1.13  christos  * Encapsulated packets for IPsec; DLT_ENC is 13 in OpenBSD, but that's
    320  1.13  christos  * DLT_SLIP_BSDOS in NetBSD, so we don't use 13 for it in OSes other
    321  1.24  christos  * than OpenBSD; instead, we use the same value as LINKTYPE_ENC.
    322  1.13  christos  */
    323  1.13  christos #ifdef __OpenBSD__
    324  1.13  christos #define DLT_ENC		13
    325  1.13  christos #else
    326  1.13  christos #define DLT_ENC		109
    327  1.13  christos #endif
    328  1.13  christos 
    329  1.13  christos /*
    330  1.24  christos  * Values 110 and 111 are reserved for use in capture file headers
    331  1.13  christos  * as link-layer types corresponding to DLT_ types that might differ
    332  1.13  christos  * between platforms; don't use those values for new DLT_ types
    333  1.13  christos  * other than the corresponding DLT_ types.
    334  1.13  christos  */
    335  1.13  christos 
    336  1.13  christos /*
    337  1.24  christos  * NetBSD uses 16 for (Cisco) "HDLC framing".  For other platforms,
    338  1.24  christos  * we define it to have the same value as LINKTYPE_NETBSD_HDLC.
    339  1.24  christos  */
    340  1.24  christos #if defined(__NetBSD__)
    341  1.24  christos #define DLT_HDLC	16	/* Cisco HDLC */
    342  1.24  christos #else
    343  1.24  christos #define DLT_HDLC	112
    344  1.24  christos #endif
    345  1.24  christos 
    346  1.24  christos /*
    347  1.20  christos  * Linux cooked sockets.
    348  1.13  christos  */
    349  1.13  christos #define DLT_LINUX_SLL	113
    350  1.13  christos 
    351  1.13  christos /*
    352  1.13  christos  * Apple LocalTalk hardware.
    353  1.13  christos  */
    354  1.13  christos #define DLT_LTALK	114
    355  1.13  christos 
    356  1.13  christos /*
    357  1.13  christos  * Acorn Econet.
    358  1.13  christos  */
    359  1.13  christos #define DLT_ECONET	115
    360  1.13  christos 
    361  1.13  christos /*
    362  1.13  christos  * Reserved for use with OpenBSD ipfilter.
    363  1.13  christos  */
    364  1.13  christos #define DLT_IPFILTER	116
    365  1.13  christos 
    366  1.13  christos /*
    367  1.13  christos  * OpenBSD DLT_PFLOG.
    368  1.13  christos  */
    369  1.13  christos #define DLT_PFLOG	117
    370  1.13  christos 
    371  1.13  christos /*
    372  1.13  christos  * Registered for Cisco-internal use.
    373  1.13  christos  */
    374  1.13  christos #define DLT_CISCO_IOS	118
    375  1.13  christos 
    376  1.13  christos /*
    377  1.13  christos  * For 802.11 cards using the Prism II chips, with a link-layer
    378  1.13  christos  * header including Prism monitor mode information plus an 802.11
    379  1.13  christos  * header.
    380  1.13  christos  */
    381  1.13  christos #define DLT_PRISM_HEADER	119
    382  1.13  christos 
    383  1.13  christos /*
    384  1.13  christos  * Reserved for Aironet 802.11 cards, with an Aironet link-layer header
    385  1.13  christos  * (see Doug Ambrisko's FreeBSD patches).
    386  1.13  christos  */
    387  1.13  christos #define DLT_AIRONET_HEADER	120
    388  1.13  christos 
    389  1.13  christos /*
    390  1.13  christos  * Sigh.
    391  1.13  christos  *
    392  1.17  christos  * 121 was reserved for Siemens HiPath HDLC on 2002-01-25, as
    393  1.13  christos  * requested by Tomas Kukosa.
    394  1.13  christos  *
    395  1.13  christos  * On 2004-02-25, a FreeBSD checkin to sys/net/bpf.h was made that
    396  1.17  christos  * assigned 121 as DLT_PFSYNC.  In current versions, its libpcap
    397  1.17  christos  * does DLT_ <-> LINKTYPE_ mapping, mapping DLT_PFSYNC to a
    398  1.17  christos  * LINKTYPE_PFSYNC value of 246, so it should write out DLT_PFSYNC
    399  1.17  christos  * dump files with 246 as the link-layer header type.  (Earlier
    400  1.17  christos  * versions might not have done mapping, in which case they would
    401  1.17  christos  * have written them out with a link-layer header type of 121.)
    402  1.13  christos  *
    403  1.13  christos  * OpenBSD, from which pf came, however, uses 18 for DLT_PFSYNC;
    404  1.17  christos  * its libpcap does no DLT_ <-> LINKTYPE_ mapping, so it would
    405  1.17  christos  * write out DLT_PFSYNC dump files with use 18 as the link-layer
    406  1.17  christos  * header type.
    407  1.17  christos  *
    408  1.17  christos  * NetBSD, DragonFly BSD, and Darwin also use 18 for DLT_PFSYNC; in
    409  1.17  christos  * current versions, their libpcaps do DLT_ <-> LINKTYPE_ mapping,
    410  1.17  christos  * mapping DLT_PFSYNC to a LINKTYPE_PFSYNC value of 246, so they
    411  1.17  christos  * should write out DLT_PFSYNC dump files with 246 as the link-layer
    412  1.17  christos  * header type.  (Earlier versions might not have done mapping,
    413  1.17  christos  * in which case they'd work the same way OpenBSD does, writing
    414  1.17  christos  * them out with a link-layer header type of 18.)
    415  1.17  christos  *
    416  1.17  christos  * We'll define DLT_PFSYNC as:
    417  1.17  christos  *
    418  1.17  christos  *    18 on NetBSD, OpenBSD, DragonFly BSD, and Darwin;
    419  1.17  christos  *
    420  1.17  christos  *    121 on FreeBSD;
    421  1.17  christos  *
    422  1.17  christos  *    246 everywhere else.
    423  1.17  christos  *
    424  1.17  christos  * We'll define DLT_HHDLC as 121 on everything except for FreeBSD;
    425  1.17  christos  * anybody who wants to compile, on FreeBSD, code that uses DLT_HHDLC
    426  1.17  christos  * is out of luck.
    427  1.17  christos  *
    428  1.17  christos  * We'll define LINKTYPE_PFSYNC as 246 on *all* platforms, so that
    429  1.17  christos  * savefiles written using *this* code won't use 18 or 121 for PFSYNC,
    430  1.17  christos  * they'll all use 246.
    431  1.17  christos  *
    432  1.17  christos  * Code that uses pcap_datalink() to determine the link-layer header
    433  1.17  christos  * type of a savefile won't, when built and run on FreeBSD, be able
    434  1.17  christos  * to distinguish between LINKTYPE_PFSYNC and LINKTYPE_HHDLC capture
    435  1.17  christos  * files, as pcap_datalink() will give 121 for both of them.  Code
    436  1.17  christos  * that doesn't, such as the code in Wireshark, will be able to
    437  1.17  christos  * distinguish between them.
    438  1.17  christos  *
    439  1.17  christos  * FreeBSD's libpcap won't map a link-layer header type of 18 - i.e.,
    440  1.17  christos  * DLT_PFSYNC files from OpenBSD and possibly older versions of NetBSD,
    441  1.19  christos  * DragonFly BSD, and macOS - to DLT_PFSYNC, so code built with FreeBSD's
    442  1.17  christos  * libpcap won't treat those files as DLT_PFSYNC files.
    443  1.17  christos  *
    444  1.17  christos  * Other libpcaps won't map a link-layer header type of 121 to DLT_PFSYNC;
    445  1.17  christos  * this means they can read DLT_HHDLC files, if any exist, but won't
    446  1.17  christos  * treat pcap files written by any older versions of FreeBSD libpcap that
    447  1.17  christos  * didn't map to 246 as DLT_PFSYNC files.
    448  1.13  christos  */
    449  1.13  christos #ifdef __FreeBSD__
    450  1.13  christos #define DLT_PFSYNC		121
    451  1.13  christos #else
    452  1.13  christos #define DLT_HHDLC		121
    453  1.13  christos #endif
    454  1.13  christos 
    455  1.13  christos /*
    456  1.13  christos  * This is for RFC 2625 IP-over-Fibre Channel.
    457  1.13  christos  *
    458  1.13  christos  * This is not for use with raw Fibre Channel, where the link-layer
    459  1.13  christos  * header starts with a Fibre Channel frame header; it's for IP-over-FC,
    460  1.13  christos  * where the link-layer header starts with an RFC 2625 Network_Header
    461  1.13  christos  * field.
    462  1.13  christos  */
    463  1.13  christos #define DLT_IP_OVER_FC		122
    464  1.13  christos 
    465  1.13  christos /*
    466  1.13  christos  * This is for Full Frontal ATM on Solaris with SunATM, with a
    467  1.13  christos  * pseudo-header followed by an AALn PDU.
    468  1.13  christos  *
    469  1.13  christos  * There may be other forms of Full Frontal ATM on other OSes,
    470  1.13  christos  * with different pseudo-headers.
    471  1.13  christos  *
    472  1.13  christos  * If ATM software returns a pseudo-header with VPI/VCI information
    473  1.13  christos  * (and, ideally, packet type information, e.g. signalling, ILMI,
    474  1.13  christos  * LANE, LLC-multiplexed traffic, etc.), it should not use
    475  1.13  christos  * DLT_ATM_RFC1483, but should get a new DLT_ value, so tcpdump
    476  1.13  christos  * and the like don't have to infer the presence or absence of a
    477  1.13  christos  * pseudo-header and the form of the pseudo-header.
    478  1.13  christos  */
    479   1.9    dyoung #define DLT_SUNATM		123	/* Solaris+SunATM */
    480  1.13  christos 
    481  1.13  christos /*
    482  1.13  christos  * Reserved as per request from Kent Dahlgren <kent (at) praesum.com>
    483  1.13  christos  * for private use.
    484  1.13  christos  */
    485   1.9    dyoung #define DLT_RIO                 124     /* RapidIO */
    486   1.9    dyoung #define DLT_PCI_EXP             125     /* PCI Express */
    487   1.9    dyoung #define DLT_AURORA              126     /* Xilinx Aurora link layer */
    488  1.13  christos 
    489  1.13  christos /*
    490  1.13  christos  * Header for 802.11 plus a number of bits of link-layer information
    491  1.13  christos  * including radio information, used by some recent BSD drivers as
    492  1.13  christos  * well as the madwifi Atheros driver for Linux.
    493  1.13  christos  */
    494  1.13  christos #define DLT_IEEE802_11_RADIO	127	/* 802.11 plus radiotap radio header */
    495  1.13  christos 
    496  1.13  christos /*
    497  1.13  christos  * Reserved for the TZSP encapsulation, as per request from
    498  1.13  christos  * Chris Waters <chris.waters (at) networkchemistry.com>
    499  1.13  christos  * TZSP is a generic encapsulation for any other link type,
    500  1.13  christos  * which includes a means to include meta-information
    501  1.13  christos  * with the packet, e.g. signal strength and channel
    502  1.13  christos  * for 802.11 packets.
    503  1.13  christos  */
    504   1.9    dyoung #define DLT_TZSP                128     /* Tazmen Sniffer Protocol */
    505  1.13  christos 
    506  1.13  christos /*
    507  1.13  christos  * BSD's ARCNET headers have the source host, destination host,
    508  1.13  christos  * and type at the beginning of the packet; that's what's handed
    509  1.13  christos  * up to userland via BPF.
    510  1.13  christos  *
    511  1.13  christos  * Linux's ARCNET headers, however, have a 2-byte offset field
    512  1.13  christos  * between the host IDs and the type; that's what's handed up
    513  1.13  christos  * to userland via PF_PACKET sockets.
    514  1.13  christos  *
    515  1.13  christos  * We therefore have to have separate DLT_ values for them.
    516  1.13  christos  */
    517   1.9    dyoung #define DLT_ARCNET_LINUX	129	/* ARCNET */
    518  1.13  christos 
    519  1.13  christos /*
    520  1.13  christos  * Juniper-private data link types, as per request from
    521  1.13  christos  * Hannes Gredler <hannes (at) juniper.net>.  The DLT_s are used
    522  1.13  christos  * for passing on chassis-internal metainformation such as
    523  1.13  christos  * QOS profiles, etc..
    524  1.13  christos  */
    525  1.13  christos #define DLT_JUNIPER_MLPPP       130
    526   1.9    dyoung #define DLT_JUNIPER_MLFR        131
    527   1.9    dyoung #define DLT_JUNIPER_ES          132
    528   1.9    dyoung #define DLT_JUNIPER_GGSN        133
    529   1.9    dyoung #define DLT_JUNIPER_MFR         134
    530   1.9    dyoung #define DLT_JUNIPER_ATM2        135
    531   1.9    dyoung #define DLT_JUNIPER_SERVICES    136
    532   1.9    dyoung #define DLT_JUNIPER_ATM1        137
    533   1.9    dyoung 
    534  1.13  christos /*
    535  1.13  christos  * Apple IP-over-IEEE 1394, as per a request from Dieter Siegmund
    536  1.13  christos  * <dieter (at) apple.com>.  The header that's presented is an Ethernet-like
    537  1.13  christos  * header:
    538  1.13  christos  *
    539  1.13  christos  *	#define FIREWIRE_EUI64_LEN	8
    540  1.13  christos  *	struct firewire_header {
    541  1.13  christos  *		u_char  firewire_dhost[FIREWIRE_EUI64_LEN];
    542  1.13  christos  *		u_char  firewire_shost[FIREWIRE_EUI64_LEN];
    543  1.13  christos  *		u_short firewire_type;
    544  1.13  christos  *	};
    545  1.13  christos  *
    546  1.13  christos  * with "firewire_type" being an Ethernet type value, rather than,
    547  1.13  christos  * for example, raw GASP frames being handed up.
    548  1.13  christos  */
    549  1.13  christos #define DLT_APPLE_IP_OVER_IEEE1394	138
    550  1.13  christos 
    551  1.13  christos /*
    552  1.13  christos  * Various SS7 encapsulations, as per a request from Jeff Morriss
    553  1.13  christos  * <jeff.morriss[AT]ulticom.com> and subsequent discussions.
    554  1.13  christos  */
    555  1.13  christos #define DLT_MTP2_WITH_PHDR	139	/* pseudo-header with various info, followed by MTP2 */
    556  1.13  christos #define DLT_MTP2		140	/* MTP2, without pseudo-header */
    557  1.13  christos #define DLT_MTP3		141	/* MTP3, without pseudo-header or MTP2 */
    558  1.13  christos #define DLT_SCCP		142	/* SCCP, without pseudo-header or MTP2 or MTP3 */
    559   1.9    dyoung 
    560  1.13  christos /*
    561  1.13  christos  * DOCSIS MAC frames.
    562  1.13  christos  */
    563  1.13  christos #define DLT_DOCSIS		143
    564  1.13  christos 
    565  1.13  christos /*
    566  1.24  christos  * Linux-IrDA packets. Protocol defined at https://www.irda.org.
    567  1.13  christos  * Those packets include IrLAP headers and above (IrLMP...), but
    568  1.13  christos  * don't include Phy framing (SOF/EOF/CRC & byte stuffing), because Phy
    569  1.13  christos  * framing can be handled by the hardware and depend on the bitrate.
    570  1.13  christos  * This is exactly the format you would get capturing on a Linux-IrDA
    571  1.13  christos  * interface (irdaX), but not on a raw serial port.
    572  1.13  christos  * Note the capture is done in "Linux-cooked" mode, so each packet include
    573  1.13  christos  * a fake packet header (struct sll_header). This is because IrDA packet
    574  1.24  christos  * decoding is dependent on the direction of the packet (incoming or
    575  1.13  christos  * outgoing).
    576  1.13  christos  * When/if other platform implement IrDA capture, we may revisit the
    577  1.13  christos  * issue and define a real DLT_IRDA...
    578  1.13  christos  * Jean II
    579  1.13  christos  */
    580  1.13  christos #define DLT_LINUX_IRDA		144
    581   1.9    dyoung 
    582  1.13  christos /*
    583  1.13  christos  * Reserved for IBM SP switch and IBM Next Federation switch.
    584  1.13  christos  */
    585   1.9    dyoung #define DLT_IBM_SP		145
    586   1.9    dyoung #define DLT_IBM_SN		146
    587   1.9    dyoung 
    588  1.13  christos /*
    589  1.13  christos  * Reserved for private use.  If you have some link-layer header type
    590  1.13  christos  * that you want to use within your organization, with the capture files
    591  1.13  christos  * using that link-layer header type not ever be sent outside your
    592  1.13  christos  * organization, you can use these values.
    593  1.13  christos  *
    594  1.13  christos  * No libpcap release will use these for any purpose, nor will any
    595  1.13  christos  * tcpdump release use them, either.
    596  1.13  christos  *
    597  1.13  christos  * Do *NOT* use these in capture files that you expect anybody not using
    598  1.13  christos  * your private versions of capture-file-reading tools to read; in
    599  1.13  christos  * particular, do *NOT* use them in products, otherwise you may find that
    600  1.13  christos  * people won't be able to use tcpdump, or snort, or Ethereal, or... to
    601  1.13  christos  * read capture files from your firewall/intrusion detection/traffic
    602  1.13  christos  * monitoring/etc. appliance, or whatever product uses that DLT_ value,
    603  1.13  christos  * and you may also find that the developers of those applications will
    604  1.13  christos  * not accept patches to let them read those files.
    605  1.13  christos  *
    606  1.13  christos  * Also, do not use them if somebody might send you a capture using them
    607  1.13  christos  * for *their* private type and tools using them for *your* private type
    608  1.13  christos  * would have to read them.
    609  1.13  christos  *
    610  1.13  christos  * Instead, ask "tcpdump-workers (at) lists.tcpdump.org" for a new DLT_ value,
    611  1.13  christos  * as per the comment above, and use the type you're given.
    612  1.13  christos  */
    613  1.13  christos #define DLT_USER0		147
    614  1.13  christos #define DLT_USER1		148
    615  1.13  christos #define DLT_USER2		149
    616  1.13  christos #define DLT_USER3		150
    617  1.13  christos #define DLT_USER4		151
    618  1.13  christos #define DLT_USER5		152
    619  1.13  christos #define DLT_USER6		153
    620  1.13  christos #define DLT_USER7		154
    621  1.13  christos #define DLT_USER8		155
    622  1.13  christos #define DLT_USER9		156
    623  1.13  christos #define DLT_USER10		157
    624  1.13  christos #define DLT_USER11		158
    625  1.13  christos #define DLT_USER12		159
    626  1.13  christos #define DLT_USER13		160
    627  1.13  christos #define DLT_USER14		161
    628  1.13  christos #define DLT_USER15		162
    629  1.13  christos 
    630  1.13  christos /*
    631  1.13  christos  * For future use with 802.11 captures - defined by AbsoluteValue
    632  1.13  christos  * Systems to store a number of bits of link-layer information
    633  1.13  christos  * including radio information:
    634  1.13  christos  *
    635  1.13  christos  *	http://www.shaftnet.org/~pizza/software/capturefrm.txt
    636  1.13  christos  *
    637  1.13  christos  * but it might be used by some non-AVS drivers now or in the
    638  1.13  christos  * future.
    639  1.13  christos  */
    640  1.13  christos #define DLT_IEEE802_11_RADIO_AVS 163	/* 802.11 plus AVS radio header */
    641  1.13  christos 
    642  1.13  christos /*
    643  1.13  christos  * Juniper-private data link type, as per request from
    644  1.13  christos  * Hannes Gredler <hannes (at) juniper.net>.  The DLT_s are used
    645  1.13  christos  * for passing on chassis-internal metainformation such as
    646  1.13  christos  * QOS profiles, etc..
    647  1.13  christos  */
    648  1.13  christos #define DLT_JUNIPER_MONITOR     164
    649  1.13  christos 
    650  1.13  christos /*
    651  1.13  christos  * BACnet MS/TP frames.
    652  1.13  christos  */
    653  1.11  drochner #define DLT_BACNET_MS_TP	165
    654  1.11  drochner 
    655  1.13  christos /*
    656  1.13  christos  * Another PPP variant as per request from Karsten Keil <kkeil (at) suse.de>.
    657  1.13  christos  *
    658  1.13  christos  * This is used in some OSes to allow a kernel socket filter to distinguish
    659  1.13  christos  * between incoming and outgoing packets, on a socket intended to
    660  1.13  christos  * supply pppd with outgoing packets so it can do dial-on-demand and
    661  1.13  christos  * hangup-on-lack-of-demand; incoming packets are filtered out so they
    662  1.13  christos  * don't cause pppd to hold the connection up (you don't want random
    663  1.13  christos  * input packets such as port scans, packets from old lost connections,
    664  1.13  christos  * etc. to force the connection to stay up).
    665  1.13  christos  *
    666  1.21   msaitoh  * The first byte of the PPP header (0xff03) is modified to accommodate
    667  1.13  christos  * the direction - 0x00 = IN, 0x01 = OUT.
    668  1.13  christos  */
    669  1.13  christos #define DLT_PPP_PPPD		166
    670  1.13  christos 
    671  1.13  christos /*
    672  1.13  christos  * Names for backwards compatibility with older versions of some PPP
    673  1.13  christos  * software; new software should use DLT_PPP_PPPD.
    674  1.13  christos  */
    675  1.13  christos #define DLT_PPP_WITH_DIRECTION	DLT_PPP_PPPD
    676  1.13  christos #define DLT_LINUX_PPP_WITHDIRECTION	DLT_PPP_PPPD
    677  1.13  christos 
    678  1.13  christos /*
    679  1.13  christos  * Juniper-private data link type, as per request from
    680  1.13  christos  * Hannes Gredler <hannes (at) juniper.net>.  The DLT_s are used
    681  1.13  christos  * for passing on chassis-internal metainformation such as
    682  1.13  christos  * QOS profiles, cookies, etc..
    683  1.13  christos  */
    684  1.13  christos #define DLT_JUNIPER_PPPOE       167
    685  1.13  christos #define DLT_JUNIPER_PPPOE_ATM   168
    686  1.11  drochner 
    687  1.11  drochner #define DLT_GPRS_LLC		169	/* GPRS LLC */
    688  1.11  drochner #define DLT_GPF_T		170	/* GPF-T (ITU-T G.7041/Y.1303) */
    689  1.11  drochner #define DLT_GPF_F		171	/* GPF-F (ITU-T G.7041/Y.1303) */
    690  1.11  drochner 
    691  1.13  christos /*
    692  1.13  christos  * Requested by Oolan Zimmer <oz (at) gcom.com> for use in Gcom's T1/E1 line
    693  1.13  christos  * monitoring equipment.
    694  1.13  christos  */
    695  1.11  drochner #define DLT_GCOM_T1E1		172
    696  1.11  drochner #define DLT_GCOM_SERIAL		173
    697  1.11  drochner 
    698  1.13  christos /*
    699  1.13  christos  * Juniper-private data link type, as per request from
    700  1.13  christos  * Hannes Gredler <hannes (at) juniper.net>.  The DLT_ is used
    701  1.13  christos  * for internal communication to Physical Interface Cards (PIC)
    702  1.13  christos  */
    703  1.13  christos #define DLT_JUNIPER_PIC_PEER    174
    704  1.13  christos 
    705  1.13  christos /*
    706  1.13  christos  * Link types requested by Gregor Maier <gregor (at) endace.com> of Endace
    707  1.13  christos  * Measurement Systems.  They add an ERF header (see
    708  1.24  christos  * https://www.endace.com/support/EndaceRecordFormat.pdf) in front of
    709  1.13  christos  * the link-layer header.
    710  1.13  christos  */
    711  1.11  drochner #define DLT_ERF_ETH		175	/* Ethernet */
    712  1.11  drochner #define DLT_ERF_POS		176	/* Packet-over-SONET */
    713  1.11  drochner 
    714  1.13  christos /*
    715  1.13  christos  * Requested by Daniele Orlandi <daniele (at) orlandi.com> for raw LAPD
    716  1.13  christos  * for vISDN (http://www.orlandi.com/visdn/).  Its link-layer header
    717  1.13  christos  * includes additional information before the LAPD header, so it's
    718  1.13  christos  * not necessarily a generic LAPD header.
    719  1.13  christos  */
    720  1.13  christos #define DLT_LINUX_LAPD		177
    721   1.1   thorpej 
    722   1.1   thorpej /*
    723  1.12  christos  * Juniper-private data link type, as per request from
    724  1.13  christos  * Hannes Gredler <hannes (at) juniper.net>.
    725  1.12  christos  * The DLT_ are used for prepending meta-information
    726  1.12  christos  * like interface index, interface name
    727  1.12  christos  * before standard Ethernet, PPP, Frelay & C-HDLC Frames
    728  1.12  christos  */
    729  1.12  christos #define DLT_JUNIPER_ETHER       178
    730  1.12  christos #define DLT_JUNIPER_PPP         179
    731  1.12  christos #define DLT_JUNIPER_FRELAY      180
    732  1.12  christos #define DLT_JUNIPER_CHDLC       181
    733  1.12  christos 
    734  1.12  christos /*
    735  1.12  christos  * Multi Link Frame Relay (FRF.16)
    736  1.12  christos  */
    737  1.12  christos #define DLT_MFR                 182
    738  1.12  christos 
    739  1.12  christos /*
    740  1.12  christos  * Juniper-private data link type, as per request from
    741  1.13  christos  * Hannes Gredler <hannes (at) juniper.net>.
    742  1.12  christos  * The DLT_ is used for internal communication with a
    743  1.12  christos  * voice Adapter Card (PIC)
    744  1.12  christos  */
    745  1.12  christos #define DLT_JUNIPER_VP          183
    746  1.12  christos 
    747  1.12  christos /*
    748  1.12  christos  * Arinc 429 frames.
    749  1.12  christos  * DLT_ requested by Gianluca Varenni <gianluca.varenni (at) cacetech.com>.
    750  1.12  christos  * Every frame contains a 32bit A429 label.
    751  1.12  christos  * More documentation on Arinc 429 can be found at
    752  1.24  christos  * https://web.archive.org/web/20040616233302/https://www.condoreng.com/support/downloads/tutorials/ARINCTutorial.pdf
    753  1.12  christos  */
    754  1.12  christos #define DLT_A429                184
    755  1.12  christos 
    756  1.12  christos /*
    757  1.12  christos  * Arinc 653 Interpartition Communication messages.
    758  1.12  christos  * DLT_ requested by Gianluca Varenni <gianluca.varenni (at) cacetech.com>.
    759  1.12  christos  * Please refer to the A653-1 standard for more information.
    760  1.12  christos  */
    761  1.12  christos #define DLT_A653_ICM            185
    762  1.12  christos 
    763  1.12  christos /*
    764  1.17  christos  * This used to be "USB packets, beginning with a USB setup header;
    765  1.17  christos  * requested by Paolo Abeni <paolo.abeni (at) email.it>."
    766  1.17  christos  *
    767  1.17  christos  * However, that header didn't work all that well - it left out some
    768  1.17  christos  * useful information - and was abandoned in favor of the DLT_USB_LINUX
    769  1.17  christos  * header.
    770  1.17  christos  *
    771  1.17  christos  * This is now used by FreeBSD for its BPF taps for USB; that has its
    772  1.17  christos  * own headers.  So it is written, so it is done.
    773  1.17  christos  *
    774  1.17  christos  * For source-code compatibility, we also define DLT_USB to have this
    775  1.17  christos  * value.  We do it numerically so that, if code that includes this
    776  1.17  christos  * file (directly or indirectly) also includes an OS header that also
    777  1.17  christos  * defines DLT_USB as 186, we don't get a redefinition warning.
    778  1.17  christos  * (NetBSD 7 does that.)
    779  1.12  christos  */
    780  1.17  christos #define DLT_USB_FREEBSD		186
    781  1.12  christos #define DLT_USB			186
    782  1.12  christos 
    783  1.12  christos /*
    784  1.12  christos  * Bluetooth HCI UART transport layer (part H:4); requested by
    785  1.12  christos  * Paolo Abeni.
    786  1.12  christos  */
    787  1.12  christos #define DLT_BLUETOOTH_HCI_H4	187
    788  1.12  christos 
    789  1.12  christos /*
    790  1.12  christos  * IEEE 802.16 MAC Common Part Sublayer; requested by Maria Cruz
    791  1.12  christos  * <cruz_petagay (at) bah.com>.
    792  1.12  christos  */
    793  1.12  christos #define DLT_IEEE802_16_MAC_CPS	188
    794  1.12  christos 
    795  1.12  christos /*
    796  1.12  christos  * USB packets, beginning with a Linux USB header; requested by
    797  1.12  christos  * Paolo Abeni <paolo.abeni (at) email.it>.
    798  1.12  christos  */
    799  1.12  christos #define DLT_USB_LINUX		189
    800  1.12  christos 
    801  1.12  christos /*
    802  1.12  christos  * Controller Area Network (CAN) v. 2.0B packets.
    803  1.12  christos  * DLT_ requested by Gianluca Varenni <gianluca.varenni (at) cacetech.com>.
    804  1.12  christos  * Used to dump CAN packets coming from a CAN Vector board.
    805  1.12  christos  * More documentation on the CAN v2.0B frames can be found at
    806  1.12  christos  * http://www.can-cia.org/downloads/?269
    807  1.12  christos  */
    808  1.12  christos #define DLT_CAN20B              190
    809  1.12  christos 
    810  1.12  christos /*
    811  1.12  christos  * IEEE 802.15.4, with address fields padded, as is done by Linux
    812  1.12  christos  * drivers; requested by Juergen Schimmer.
    813  1.12  christos  */
    814  1.12  christos #define DLT_IEEE802_15_4_LINUX	191
    815  1.12  christos 
    816  1.12  christos /*
    817  1.12  christos  * Per Packet Information encapsulated packets.
    818  1.12  christos  * DLT_ requested by Gianluca Varenni <gianluca.varenni (at) cacetech.com>.
    819  1.12  christos  */
    820  1.12  christos #define DLT_PPI			192
    821  1.12  christos 
    822  1.12  christos /*
    823  1.12  christos  * Header for 802.16 MAC Common Part Sublayer plus a radiotap radio header;
    824  1.12  christos  * requested by Charles Clancy.
    825  1.12  christos  */
    826  1.12  christos #define DLT_IEEE802_16_MAC_CPS_RADIO	193
    827  1.12  christos 
    828  1.12  christos /*
    829  1.12  christos  * Juniper-private data link type, as per request from
    830  1.13  christos  * Hannes Gredler <hannes (at) juniper.net>.
    831  1.12  christos  * The DLT_ is used for internal communication with a
    832  1.12  christos  * integrated service module (ISM).
    833  1.12  christos  */
    834  1.12  christos #define DLT_JUNIPER_ISM         194
    835  1.12  christos 
    836  1.12  christos /*
    837  1.12  christos  * IEEE 802.15.4, exactly as it appears in the spec (no padding, no
    838  1.12  christos  * nothing); requested by Mikko Saarnivala <mikko.saarnivala (at) sensinode.com>.
    839  1.13  christos  * For this one, we expect the FCS to be present at the end of the frame;
    840  1.13  christos  * if the frame has no FCS, DLT_IEEE802_15_4_NOFCS should be used.
    841  1.19  christos  *
    842  1.19  christos  * We keep the name DLT_IEEE802_15_4 as an alias for backwards
    843  1.19  christos  * compatibility, but, again, this should *only* be used for 802.15.4
    844  1.19  christos  * frames that include the FCS.
    845  1.12  christos  */
    846  1.19  christos #define DLT_IEEE802_15_4_WITHFCS	195
    847  1.19  christos #define DLT_IEEE802_15_4		DLT_IEEE802_15_4_WITHFCS
    848  1.12  christos 
    849  1.12  christos /*
    850  1.12  christos  * Various link-layer types, with a pseudo-header, for SITA
    851  1.24  christos  * (https://www.sita.aero/); requested by Fulko Hew (fulko.hew (at) gmail.com).
    852  1.12  christos  */
    853  1.12  christos #define DLT_SITA		196
    854  1.12  christos 
    855  1.12  christos /*
    856  1.12  christos  * Various link-layer types, with a pseudo-header, for Endace DAG cards;
    857  1.12  christos  * encapsulates Endace ERF records.  Requested by Stephen Donnelly
    858  1.12  christos  * <stephen (at) endace.com>.
    859  1.12  christos  */
    860  1.12  christos #define DLT_ERF			197
    861  1.12  christos 
    862  1.12  christos /*
    863  1.12  christos  * Special header prepended to Ethernet packets when capturing from a
    864  1.12  christos  * u10 Networks board.  Requested by Phil Mulholland
    865  1.12  christos  * <phil (at) u10networks.com>.
    866  1.12  christos  */
    867  1.12  christos #define DLT_RAIF1		198
    868  1.12  christos 
    869  1.12  christos /*
    870  1.20  christos  * IPMB packet for IPMI, beginning with a 2-byte header, followed by
    871  1.20  christos  * the I2C slave address, followed by the netFn and LUN, etc..
    872  1.20  christos  * Requested by Chanthy Toeung <chanthy.toeung (at) ca.kontron.com>.
    873  1.20  christos  *
    874  1.20  christos  * XXX - this used to be called DLT_IPMB, back when we got the
    875  1.20  christos  * impression from the email thread requesting it that the packet
    876  1.20  christos  * had no extra 2-byte header.  We've renamed it; if anybody used
    877  1.20  christos  * DLT_IPMB and assumed no 2-byte header, this will cause the compile
    878  1.20  christos  * to fail, at which point we'll have to figure out what to do about
    879  1.20  christos  * the two header types using the same DLT_/LINKTYPE_ value.  If that
    880  1.20  christos  * doesn't happen, we'll assume nobody used it and that the redefinition
    881  1.20  christos  * is safe.
    882  1.12  christos  */
    883  1.20  christos #define DLT_IPMB_KONTRON	199
    884  1.12  christos 
    885  1.12  christos /*
    886  1.12  christos  * Juniper-private data link type, as per request from
    887  1.13  christos  * Hannes Gredler <hannes (at) juniper.net>.
    888  1.12  christos  * The DLT_ is used for capturing data on a secure tunnel interface.
    889  1.12  christos  */
    890  1.12  christos #define DLT_JUNIPER_ST          200
    891  1.12  christos 
    892  1.12  christos /*
    893  1.12  christos  * Bluetooth HCI UART transport layer (part H:4), with pseudo-header
    894  1.12  christos  * that includes direction information; requested by Paolo Abeni.
    895  1.12  christos  */
    896  1.12  christos #define DLT_BLUETOOTH_HCI_H4_WITH_PHDR	201
    897  1.12  christos 
    898  1.12  christos /*
    899  1.12  christos  * AX.25 packet with a 1-byte KISS header; see
    900  1.12  christos  *
    901  1.12  christos  *	http://www.ax25.net/kiss.htm
    902  1.12  christos  *
    903  1.12  christos  * as per Richard Stearn <richard (at) rns-stearn.demon.co.uk>.
    904  1.12  christos  */
    905  1.12  christos #define DLT_AX25_KISS		202
    906  1.12  christos 
    907  1.12  christos /*
    908  1.12  christos  * LAPD packets from an ISDN channel, starting with the address field,
    909  1.12  christos  * with no pseudo-header.
    910  1.12  christos  * Requested by Varuna De Silva <varunax (at) gmail.com>.
    911  1.12  christos  */
    912  1.12  christos #define DLT_LAPD		203
    913  1.12  christos 
    914  1.12  christos /*
    915  1.20  christos  * PPP, with a one-byte direction pseudo-header prepended - zero means
    916  1.20  christos  * "received by this host", non-zero (any non-zero value) means "sent by
    917  1.20  christos  * this host" - as per Will Barker <w.barker (at) zen.co.uk>.
    918  1.24  christos  *
    919  1.24  christos  * Don't confuse this with DLT_PPP_WITH_DIRECTION, which is an old
    920  1.24  christos  * name for what is now called DLT_PPP_PPPD.
    921  1.20  christos  */
    922  1.24  christos #define DLT_PPP_WITH_DIR	204
    923  1.20  christos 
    924  1.20  christos /*
    925  1.20  christos  * Cisco HDLC, with a one-byte direction pseudo-header prepended - zero
    926  1.20  christos  * means "received by this host", non-zero (any non-zero value) means
    927  1.20  christos  * "sent by this host" - as per Will Barker <w.barker (at) zen.co.uk>.
    928  1.20  christos  */
    929  1.20  christos #define DLT_C_HDLC_WITH_DIR	205
    930  1.20  christos 
    931  1.20  christos /*
    932  1.20  christos  * Frame Relay, with a one-byte direction pseudo-header prepended - zero
    933  1.20  christos  * means "received by this host" (DCE -> DTE), non-zero (any non-zero
    934  1.20  christos  * value) means "sent by this host" (DTE -> DCE) - as per Will Barker
    935  1.20  christos  * <w.barker (at) zen.co.uk>.
    936  1.20  christos  */
    937  1.20  christos #define DLT_FRELAY_WITH_DIR	206
    938  1.20  christos 
    939  1.20  christos /*
    940  1.20  christos  * LAPB, with a one-byte direction pseudo-header prepended - zero means
    941  1.20  christos  * "received by this host" (DCE -> DTE), non-zero (any non-zero value)
    942  1.20  christos  * means "sent by this host" (DTE -> DCE)- as per Will Barker
    943  1.20  christos  * <w.barker (at) zen.co.uk>.
    944  1.20  christos  */
    945  1.20  christos #define DLT_LAPB_WITH_DIR	207
    946  1.12  christos 
    947  1.12  christos /*
    948  1.12  christos  * 208 is reserved for an as-yet-unspecified proprietary link-layer
    949  1.12  christos  * type, as requested by Will Barker.
    950  1.12  christos  */
    951  1.12  christos 
    952  1.12  christos /*
    953  1.12  christos  * IPMB with a Linux-specific pseudo-header; as requested by Alexey Neyman
    954  1.12  christos  * <avn (at) pigeonpoint.com>.
    955  1.12  christos  */
    956  1.12  christos #define DLT_IPMB_LINUX		209
    957  1.12  christos 
    958  1.12  christos /*
    959  1.12  christos  * FlexRay automotive bus - http://www.flexray.com/ - as requested
    960  1.12  christos  * by Hannes Kaelber <hannes.kaelber (at) x2e.de>.
    961  1.12  christos  */
    962  1.12  christos #define DLT_FLEXRAY		210
    963  1.12  christos 
    964  1.12  christos /*
    965  1.12  christos  * Media Oriented Systems Transport (MOST) bus for multimedia
    966  1.24  christos  * transport - https://www.mostcooperation.com/ - as requested
    967  1.12  christos  * by Hannes Kaelber <hannes.kaelber (at) x2e.de>.
    968  1.12  christos  */
    969  1.12  christos #define DLT_MOST		211
    970  1.12  christos 
    971  1.12  christos /*
    972  1.12  christos  * Local Interconnect Network (LIN) bus for vehicle networks -
    973  1.12  christos  * http://www.lin-subbus.org/ - as requested by Hannes Kaelber
    974  1.12  christos  * <hannes.kaelber (at) x2e.de>.
    975  1.12  christos  */
    976  1.12  christos #define DLT_LIN			212
    977  1.12  christos 
    978  1.12  christos /*
    979  1.12  christos  * X2E-private data link type used for serial line capture,
    980  1.12  christos  * as requested by Hannes Kaelber <hannes.kaelber (at) x2e.de>.
    981  1.12  christos  */
    982  1.12  christos #define DLT_X2E_SERIAL		213
    983  1.12  christos 
    984  1.12  christos /*
    985  1.12  christos  * X2E-private data link type used for the Xoraya data logger
    986  1.12  christos  * family, as requested by Hannes Kaelber <hannes.kaelber (at) x2e.de>.
    987  1.12  christos  */
    988  1.12  christos #define DLT_X2E_XORAYA		214
    989  1.12  christos 
    990  1.12  christos /*
    991  1.12  christos  * IEEE 802.15.4, exactly as it appears in the spec (no padding, no
    992  1.12  christos  * nothing), but with the PHY-level data for non-ASK PHYs (4 octets
    993  1.12  christos  * of 0 as preamble, one octet of SFD, one octet of frame length+
    994  1.12  christos  * reserved bit, and then the MAC-layer data, starting with the
    995  1.12  christos  * frame control field).
    996  1.12  christos  *
    997  1.12  christos  * Requested by Max Filippov <jcmvbkbc (at) gmail.com>.
    998  1.12  christos  */
    999  1.12  christos #define DLT_IEEE802_15_4_NONASK_PHY	215
   1000  1.12  christos 
   1001  1.13  christos /*
   1002  1.12  christos  * David Gibson <david (at) gibson.dropbear.id.au> requested this for
   1003  1.12  christos  * captures from the Linux kernel /dev/input/eventN devices. This
   1004  1.12  christos  * is used to communicate keystrokes and mouse movements from the
   1005  1.13  christos  * Linux kernel to display systems, such as Xorg.
   1006  1.12  christos  */
   1007  1.12  christos #define DLT_LINUX_EVDEV		216
   1008  1.12  christos 
   1009  1.12  christos /*
   1010  1.12  christos  * GSM Um and Abis interfaces, preceded by a "gsmtap" header.
   1011  1.12  christos  *
   1012  1.12  christos  * Requested by Harald Welte <laforge (at) gnumonks.org>.
   1013  1.12  christos  */
   1014  1.12  christos #define DLT_GSMTAP_UM		217
   1015  1.12  christos #define DLT_GSMTAP_ABIS		218
   1016  1.12  christos 
   1017  1.12  christos /*
   1018  1.12  christos  * MPLS, with an MPLS label as the link-layer header.
   1019  1.12  christos  * Requested by Michele Marchetto <michele (at) openbsd.org> on behalf
   1020  1.12  christos  * of OpenBSD.
   1021  1.12  christos  */
   1022  1.12  christos #define DLT_MPLS		219
   1023  1.12  christos 
   1024  1.12  christos /*
   1025  1.12  christos  * USB packets, beginning with a Linux USB header, with the USB header
   1026  1.12  christos  * padded to 64 bytes; required for memory-mapped access.
   1027  1.12  christos  */
   1028  1.12  christos #define DLT_USB_LINUX_MMAPPED	220
   1029  1.12  christos 
   1030  1.12  christos /*
   1031  1.12  christos  * DECT packets, with a pseudo-header; requested by
   1032  1.12  christos  * Matthias Wenzel <tcpdump (at) mazzoo.de>.
   1033  1.12  christos  */
   1034  1.12  christos #define DLT_DECT		221
   1035  1.12  christos 
   1036  1.12  christos /*
   1037  1.12  christos  * From: "Lidwa, Eric (GSFC-582.0)[SGT INC]" <eric.lidwa-1 (at) nasa.gov>
   1038  1.12  christos  * Date: Mon, 11 May 2009 11:18:30 -0500
   1039  1.12  christos  *
   1040  1.12  christos  * DLT_AOS. We need it for AOS Space Data Link Protocol.
   1041  1.12  christos  *   I have already written dissectors for but need an OK from
   1042  1.12  christos  *   legal before I can submit a patch.
   1043  1.12  christos  *
   1044  1.12  christos  */
   1045  1.12  christos #define DLT_AOS                 222
   1046  1.12  christos 
   1047  1.12  christos /*
   1048  1.25  christos  * WirelessHART (Highway Addressable Remote Transducer)
   1049  1.12  christos  * From the HART Communication Foundation
   1050  1.25  christos  * IEC/PAS 62591
   1051  1.12  christos  *
   1052  1.12  christos  * Requested by Sam Roberts <vieuxtech (at) gmail.com>.
   1053  1.12  christos  */
   1054  1.12  christos #define DLT_WIHART		223
   1055  1.12  christos 
   1056  1.12  christos /*
   1057  1.12  christos  * Fibre Channel FC-2 frames, beginning with a Frame_Header.
   1058  1.12  christos  * Requested by Kahou Lei <kahou82 (at) gmail.com>.
   1059  1.12  christos  */
   1060  1.12  christos #define DLT_FC_2		224
   1061  1.12  christos 
   1062  1.12  christos /*
   1063  1.12  christos  * Fibre Channel FC-2 frames, beginning with an encoding of the
   1064  1.12  christos  * SOF, and ending with an encoding of the EOF.
   1065  1.12  christos  *
   1066  1.12  christos  * The encodings represent the frame delimiters as 4-byte sequences
   1067  1.12  christos  * representing the corresponding ordered sets, with K28.5
   1068  1.12  christos  * represented as 0xBC, and the D symbols as the corresponding
   1069  1.12  christos  * byte values; for example, SOFi2, which is K28.5 - D21.5 - D1.2 - D21.2,
   1070  1.12  christos  * is represented as 0xBC 0xB5 0x55 0x55.
   1071  1.12  christos  *
   1072  1.12  christos  * Requested by Kahou Lei <kahou82 (at) gmail.com>.
   1073  1.12  christos  */
   1074  1.12  christos #define DLT_FC_2_WITH_FRAME_DELIMS	225
   1075  1.12  christos 
   1076  1.12  christos /*
   1077  1.12  christos  * Solaris ipnet pseudo-header; requested by Darren Reed <Darren.Reed (at) Sun.COM>.
   1078  1.12  christos  *
   1079  1.12  christos  * The pseudo-header starts with a one-byte version number; for version 2,
   1080  1.12  christos  * the pseudo-header is:
   1081  1.12  christos  *
   1082  1.12  christos  * struct dl_ipnetinfo {
   1083  1.19  christos  *     uint8_t   dli_version;
   1084  1.19  christos  *     uint8_t   dli_family;
   1085  1.19  christos  *     uint16_t  dli_htype;
   1086  1.19  christos  *     uint32_t  dli_pktlen;
   1087  1.19  christos  *     uint32_t  dli_ifindex;
   1088  1.19  christos  *     uint32_t  dli_grifindex;
   1089  1.19  christos  *     uint32_t  dli_zsrc;
   1090  1.19  christos  *     uint32_t  dli_zdst;
   1091  1.12  christos  * };
   1092  1.12  christos  *
   1093  1.12  christos  * dli_version is 2 for the current version of the pseudo-header.
   1094  1.12  christos  *
   1095  1.12  christos  * dli_family is a Solaris address family value, so it's 2 for IPv4
   1096  1.12  christos  * and 26 for IPv6.
   1097  1.12  christos  *
   1098  1.12  christos  * dli_htype is a "hook type" - 0 for incoming packets, 1 for outgoing
   1099  1.12  christos  * packets, and 2 for packets arriving from another zone on the same
   1100  1.12  christos  * machine.
   1101  1.12  christos  *
   1102  1.12  christos  * dli_pktlen is the length of the packet data following the pseudo-header
   1103  1.12  christos  * (so the captured length minus dli_pktlen is the length of the
   1104  1.12  christos  * pseudo-header, assuming the entire pseudo-header was captured).
   1105  1.12  christos  *
   1106  1.12  christos  * dli_ifindex is the interface index of the interface on which the
   1107  1.12  christos  * packet arrived.
   1108  1.12  christos  *
   1109  1.12  christos  * dli_grifindex is the group interface index number (for IPMP interfaces).
   1110  1.12  christos  *
   1111  1.12  christos  * dli_zsrc is the zone identifier for the source of the packet.
   1112  1.12  christos  *
   1113  1.12  christos  * dli_zdst is the zone identifier for the destination of the packet.
   1114  1.12  christos  *
   1115  1.12  christos  * A zone number of 0 is the global zone; a zone number of 0xffffffff
   1116  1.12  christos  * means that the packet arrived from another host on the network, not
   1117  1.12  christos  * from another zone on the same machine.
   1118  1.12  christos  *
   1119  1.12  christos  * An IPv4 or IPv6 datagram follows the pseudo-header; dli_family indicates
   1120  1.12  christos  * which of those it is.
   1121  1.12  christos  */
   1122  1.13  christos #define DLT_IPNET		226
   1123  1.12  christos 
   1124  1.12  christos /*
   1125  1.12  christos  * CAN (Controller Area Network) frames, with a pseudo-header as supplied
   1126  1.17  christos  * by Linux SocketCAN, and with multi-byte numerical fields in that header
   1127  1.17  christos  * in big-endian byte order.
   1128  1.17  christos  *
   1129  1.17  christos  * See Documentation/networking/can.txt in the Linux source.
   1130  1.12  christos  *
   1131  1.12  christos  * Requested by Felix Obenhuber <felix (at) obenhuber.de>.
   1132  1.12  christos  */
   1133  1.13  christos #define DLT_CAN_SOCKETCAN	227
   1134  1.12  christos 
   1135  1.12  christos /*
   1136  1.12  christos  * Raw IPv4/IPv6; different from DLT_RAW in that the DLT_ value specifies
   1137  1.12  christos  * whether it's v4 or v6.  Requested by Darren Reed <Darren.Reed (at) Sun.COM>.
   1138  1.12  christos  */
   1139  1.13  christos #define DLT_IPV4		228
   1140  1.13  christos #define DLT_IPV6		229
   1141  1.13  christos 
   1142  1.13  christos /*
   1143  1.13  christos  * IEEE 802.15.4, exactly as it appears in the spec (no padding, no
   1144  1.13  christos  * nothing), and with no FCS at the end of the frame; requested by
   1145  1.13  christos  * Jon Smirl <jonsmirl (at) gmail.com>.
   1146  1.13  christos  */
   1147  1.13  christos #define DLT_IEEE802_15_4_NOFCS	230
   1148  1.13  christos 
   1149  1.13  christos /*
   1150  1.13  christos  * Raw D-Bus:
   1151  1.13  christos  *
   1152  1.24  christos  *	https://www.freedesktop.org/wiki/Software/dbus
   1153  1.13  christos  *
   1154  1.13  christos  * messages:
   1155  1.13  christos  *
   1156  1.24  christos  *	https://dbus.freedesktop.org/doc/dbus-specification.html#message-protocol-messages
   1157  1.13  christos  *
   1158  1.13  christos  * starting with the endianness flag, followed by the message type, etc.,
   1159  1.13  christos  * but without the authentication handshake before the message sequence:
   1160  1.13  christos  *
   1161  1.24  christos  *	https://dbus.freedesktop.org/doc/dbus-specification.html#auth-protocol
   1162  1.13  christos  *
   1163  1.13  christos  * Requested by Martin Vidner <martin (at) vidner.net>.
   1164  1.13  christos  */
   1165  1.13  christos #define DLT_DBUS		231
   1166  1.13  christos 
   1167  1.13  christos /*
   1168  1.13  christos  * Juniper-private data link type, as per request from
   1169  1.13  christos  * Hannes Gredler <hannes (at) juniper.net>.
   1170  1.13  christos  */
   1171  1.13  christos #define DLT_JUNIPER_VS			232
   1172  1.13  christos #define DLT_JUNIPER_SRX_E2E		233
   1173  1.13  christos #define DLT_JUNIPER_FIBRECHANNEL	234
   1174  1.13  christos 
   1175  1.13  christos /*
   1176  1.13  christos  * DVB-CI (DVB Common Interface for communication between a PC Card
   1177  1.13  christos  * module and a DVB receiver).  See
   1178  1.13  christos  *
   1179  1.24  christos  *	https://www.kaiser.cx/pcap-dvbci.html
   1180  1.13  christos  *
   1181  1.13  christos  * for the specification.
   1182  1.13  christos  *
   1183  1.13  christos  * Requested by Martin Kaiser <martin (at) kaiser.cx>.
   1184  1.13  christos  */
   1185  1.13  christos #define DLT_DVB_CI		235
   1186  1.13  christos 
   1187  1.13  christos /*
   1188  1.13  christos  * Variant of 3GPP TS 27.010 multiplexing protocol (similar to, but
   1189  1.13  christos  * *not* the same as, 27.010).  Requested by Hans-Christoph Schemmel
   1190  1.13  christos  * <hans-christoph.schemmel (at) cinterion.com>.
   1191  1.13  christos  */
   1192  1.13  christos #define DLT_MUX27010		236
   1193  1.13  christos 
   1194  1.13  christos /*
   1195  1.13  christos  * STANAG 5066 D_PDUs.  Requested by M. Baris Demiray
   1196  1.13  christos  * <barisdemiray (at) gmail.com>.
   1197  1.13  christos  */
   1198  1.13  christos #define DLT_STANAG_5066_D_PDU	237
   1199  1.13  christos 
   1200  1.13  christos /*
   1201  1.13  christos  * Juniper-private data link type, as per request from
   1202  1.13  christos  * Hannes Gredler <hannes (at) juniper.net>.
   1203  1.13  christos  */
   1204  1.13  christos #define DLT_JUNIPER_ATM_CEMIC	238
   1205  1.13  christos 
   1206  1.13  christos /*
   1207  1.13  christos  * NetFilter LOG messages
   1208  1.13  christos  * (payload of netlink NFNL_SUBSYS_ULOG/NFULNL_MSG_PACKET packets)
   1209  1.13  christos  *
   1210  1.13  christos  * Requested by Jakub Zawadzki <darkjames-ws (at) darkjames.pl>
   1211  1.13  christos  */
   1212  1.13  christos #define DLT_NFLOG		239
   1213  1.13  christos 
   1214  1.13  christos /*
   1215  1.13  christos  * Hilscher Gesellschaft fuer Systemautomation mbH link-layer type
   1216  1.13  christos  * for Ethernet packets with a 4-byte pseudo-header and always
   1217  1.13  christos  * with the payload including the FCS, as supplied by their
   1218  1.13  christos  * netANALYZER hardware and software.
   1219  1.13  christos  *
   1220  1.13  christos  * Requested by Holger P. Frommer <HPfrommer (at) hilscher.com>
   1221  1.13  christos  */
   1222  1.13  christos #define DLT_NETANALYZER		240
   1223  1.13  christos 
   1224  1.13  christos /*
   1225  1.13  christos  * Hilscher Gesellschaft fuer Systemautomation mbH link-layer type
   1226  1.13  christos  * for Ethernet packets with a 4-byte pseudo-header and FCS and
   1227  1.13  christos  * with the Ethernet header preceded by 7 bytes of preamble and
   1228  1.13  christos  * 1 byte of SFD, as supplied by their netANALYZER hardware and
   1229  1.13  christos  * software.
   1230  1.13  christos  *
   1231  1.13  christos  * Requested by Holger P. Frommer <HPfrommer (at) hilscher.com>
   1232  1.13  christos  */
   1233  1.13  christos #define DLT_NETANALYZER_TRANSPARENT	241
   1234  1.13  christos 
   1235  1.13  christos /*
   1236  1.17  christos  * IP-over-InfiniBand, as specified by RFC 4391.
   1237  1.13  christos  *
   1238  1.13  christos  * Requested by Petr Sumbera <petr.sumbera (at) oracle.com>.
   1239  1.13  christos  */
   1240  1.13  christos #define DLT_IPOIB		242
   1241  1.13  christos 
   1242  1.13  christos /*
   1243  1.13  christos  * MPEG-2 transport stream (ISO 13818-1/ITU-T H.222.0).
   1244  1.13  christos  *
   1245  1.13  christos  * Requested by Guy Martin <gmsoft (at) tuxicoman.be>.
   1246  1.13  christos  */
   1247  1.13  christos #define DLT_MPEG_2_TS		243
   1248  1.13  christos 
   1249  1.13  christos /*
   1250  1.13  christos  * ng4T GmbH's UMTS Iub/Iur-over-ATM and Iub/Iur-over-IP format as
   1251  1.13  christos  * used by their ng40 protocol tester.
   1252  1.13  christos  *
   1253  1.13  christos  * Requested by Jens Grimmer <jens.grimmer (at) ng4t.com>.
   1254  1.13  christos  */
   1255  1.13  christos #define DLT_NG40		244
   1256  1.13  christos 
   1257  1.13  christos /*
   1258  1.13  christos  * Pseudo-header giving adapter number and flags, followed by an NFC
   1259  1.13  christos  * (Near-Field Communications) Logical Link Control Protocol (LLCP) PDU,
   1260  1.13  christos  * as specified by NFC Forum Logical Link Control Protocol Technical
   1261  1.13  christos  * Specification LLCP 1.1.
   1262  1.13  christos  *
   1263  1.13  christos  * Requested by Mike Wakerly <mikey (at) google.com>.
   1264  1.13  christos  */
   1265  1.13  christos #define DLT_NFC_LLCP		245
   1266  1.13  christos 
   1267  1.13  christos /*
   1268  1.17  christos  * 246 is used as LINKTYPE_PFSYNC; do not use it for any other purpose.
   1269  1.13  christos  *
   1270  1.13  christos  * DLT_PFSYNC has different values on different platforms, and all of
   1271  1.13  christos  * them collide with something used elsewhere.  On platforms that
   1272  1.17  christos  * don't already define it, define it as 246.
   1273  1.13  christos  */
   1274  1.13  christos #if !defined(__FreeBSD__) && !defined(__OpenBSD__) && !defined(__NetBSD__) && !defined(__DragonFly__) && !defined(__APPLE__)
   1275  1.13  christos #define DLT_PFSYNC		246
   1276  1.13  christos #endif
   1277  1.13  christos 
   1278  1.15  christos /*
   1279  1.15  christos  * Raw InfiniBand packets, starting with the Local Routing Header.
   1280  1.15  christos  *
   1281  1.15  christos  * Requested by Oren Kladnitsky <orenk (at) mellanox.com>.
   1282  1.15  christos  */
   1283  1.15  christos #define DLT_INFINIBAND		247
   1284  1.15  christos 
   1285  1.15  christos /*
   1286  1.15  christos  * SCTP, with no lower-level protocols (i.e., no IPv4 or IPv6).
   1287  1.15  christos  *
   1288  1.15  christos  * Requested by Michael Tuexen <Michael.Tuexen (at) lurchi.franken.de>.
   1289  1.15  christos  */
   1290  1.15  christos #define DLT_SCTP		248
   1291  1.15  christos 
   1292  1.15  christos /*
   1293  1.15  christos  * USB packets, beginning with a USBPcap header.
   1294  1.15  christos  *
   1295  1.15  christos  * Requested by Tomasz Mon <desowin (at) gmail.com>
   1296  1.15  christos  */
   1297  1.15  christos #define DLT_USBPCAP		249
   1298  1.15  christos 
   1299  1.15  christos /*
   1300  1.15  christos  * Schweitzer Engineering Laboratories "RTAC" product serial-line
   1301  1.15  christos  * packets.
   1302  1.15  christos  *
   1303  1.15  christos  * Requested by Chris Bontje <chris_bontje (at) selinc.com>.
   1304  1.15  christos  */
   1305  1.15  christos #define DLT_RTAC_SERIAL		250
   1306  1.15  christos 
   1307  1.15  christos /*
   1308  1.15  christos  * Bluetooth Low Energy air interface link-layer packets.
   1309  1.15  christos  *
   1310  1.15  christos  * Requested by Mike Kershaw <dragorn (at) kismetwireless.net>.
   1311  1.15  christos  */
   1312  1.15  christos #define DLT_BLUETOOTH_LE_LL	251
   1313  1.15  christos 
   1314  1.15  christos /*
   1315  1.24  christos  * DLT type for upper-protocol layer PDU saves from Wireshark.
   1316  1.24  christos  *
   1317  1.24  christos  * the actual contents are determined by two TAGs, one or more of
   1318  1.24  christos  * which is stored with each packet:
   1319  1.17  christos  *
   1320  1.24  christos  *   EXP_PDU_TAG_DISSECTOR_NAME      the name of the Wireshark dissector
   1321  1.24  christos  *				     that can make sense of the data stored.
   1322  1.15  christos  *
   1323  1.24  christos  *   EXP_PDU_TAG_HEUR_DISSECTOR_NAME the name of the Wireshark heuristic
   1324  1.24  christos  *				     dissector that can make sense of the
   1325  1.24  christos  *				     data stored.
   1326  1.15  christos  */
   1327  1.15  christos #define DLT_WIRESHARK_UPPER_PDU	252
   1328  1.15  christos 
   1329  1.15  christos /*
   1330  1.15  christos  * DLT type for the netlink protocol (nlmon devices).
   1331  1.15  christos  */
   1332  1.15  christos #define DLT_NETLINK		253
   1333  1.15  christos 
   1334  1.15  christos /*
   1335  1.15  christos  * Bluetooth Linux Monitor headers for the BlueZ stack.
   1336  1.15  christos  */
   1337  1.15  christos #define DLT_BLUETOOTH_LINUX_MONITOR	254
   1338  1.15  christos 
   1339  1.15  christos /*
   1340  1.15  christos  * Bluetooth Basic Rate/Enhanced Data Rate baseband packets, as
   1341  1.15  christos  * captured by Ubertooth.
   1342  1.15  christos  */
   1343  1.15  christos #define DLT_BLUETOOTH_BREDR_BB	255
   1344  1.15  christos 
   1345  1.15  christos /*
   1346  1.15  christos  * Bluetooth Low Energy link layer packets, as captured by Ubertooth.
   1347  1.15  christos  */
   1348  1.15  christos #define DLT_BLUETOOTH_LE_LL_WITH_PHDR	256
   1349  1.15  christos 
   1350  1.15  christos /*
   1351  1.15  christos  * PROFIBUS data link layer.
   1352  1.15  christos  */
   1353  1.15  christos #define DLT_PROFIBUS_DL		257
   1354  1.15  christos 
   1355  1.15  christos /*
   1356  1.15  christos  * Apple's DLT_PKTAP headers.
   1357  1.15  christos  *
   1358  1.15  christos  * Sadly, the folks at Apple either had no clue that the DLT_USERn values
   1359  1.15  christos  * are for internal use within an organization and partners only, and
   1360  1.15  christos  * didn't know that the right way to get a link-layer header type is to
   1361  1.15  christos  * ask tcpdump.org for one, or knew and didn't care, so they just
   1362  1.15  christos  * used DLT_USER2, which causes problems for everything except for
   1363  1.15  christos  * their version of tcpdump.
   1364  1.15  christos  *
   1365  1.15  christos  * So I'll just give them one; hopefully this will show up in a
   1366  1.15  christos  * libpcap release in time for them to get this into 10.10 Big Sur
   1367  1.15  christos  * or whatever Mavericks' successor is called.  LINKTYPE_PKTAP
   1368  1.19  christos  * will be 258 *even on macOS*; that is *intentional*, so that
   1369  1.15  christos  * PKTAP files look the same on *all* OSes (different OSes can have
   1370  1.15  christos  * different numerical values for a given DLT_, but *MUST NOT* have
   1371  1.15  christos  * different values for what goes in a file, as files can be moved
   1372  1.15  christos  * between OSes!).
   1373  1.15  christos  *
   1374  1.15  christos  * When capturing, on a system with a Darwin-based OS, on a device
   1375  1.15  christos  * that returns 149 (DLT_USER2 and Apple's DLT_PKTAP) with this
   1376  1.15  christos  * version of libpcap, the DLT_ value for the pcap_t  will be DLT_PKTAP,
   1377  1.15  christos  * and that will continue to be DLT_USER2 on Darwin-based OSes. That way,
   1378  1.15  christos  * binary compatibility with Mavericks is preserved for programs using
   1379  1.15  christos  * this version of libpcap.  This does mean that if you were using
   1380  1.19  christos  * DLT_USER2 for some capture device on macOS, you can't do so with
   1381  1.15  christos  * this version of libpcap, just as you can't with Apple's libpcap -
   1382  1.19  christos  * on macOS, they define DLT_PKTAP to be DLT_USER2, so programs won't
   1383  1.15  christos  * be able to distinguish between PKTAP and whatever you were using
   1384  1.15  christos  * DLT_USER2 for.
   1385  1.15  christos  *
   1386  1.15  christos  * If the program saves the capture to a file using this version of
   1387  1.15  christos  * libpcap's pcap_dump code, the LINKTYPE_ value in the file will be
   1388  1.15  christos  * LINKTYPE_PKTAP, which will be 258, even on Darwin-based OSes.
   1389  1.15  christos  * That way, the file will *not* be a DLT_USER2 file.  That means
   1390  1.15  christos  * that the latest version of tcpdump, when built with this version
   1391  1.15  christos  * of libpcap, and sufficiently recent versions of Wireshark will
   1392  1.15  christos  * be able to read those files and interpret them correctly; however,
   1393  1.15  christos  * Apple's version of tcpdump in OS X 10.9 won't be able to handle
   1394  1.15  christos  * them.  (Hopefully, Apple will pick up this version of libpcap,
   1395  1.15  christos  * and the corresponding version of tcpdump, so that tcpdump will
   1396  1.15  christos  * be able to handle the old LINKTYPE_USER2 captures *and* the new
   1397  1.15  christos  * LINKTYPE_PKTAP captures.)
   1398  1.15  christos  */
   1399  1.15  christos #ifdef __APPLE__
   1400  1.15  christos #define DLT_PKTAP	DLT_USER2
   1401  1.15  christos #else
   1402  1.15  christos #define DLT_PKTAP	258
   1403  1.15  christos #endif
   1404  1.15  christos 
   1405  1.15  christos /*
   1406  1.15  christos  * Ethernet packets preceded by a header giving the last 6 octets
   1407  1.15  christos  * of the preamble specified by 802.3-2012 Clause 65, section
   1408  1.15  christos  * 65.1.3.2 "Transmit".
   1409  1.15  christos  */
   1410  1.15  christos #define DLT_EPON	259
   1411  1.15  christos 
   1412  1.15  christos /*
   1413  1.15  christos  * IPMI trace packets, as specified by Table 3-20 "Trace Data Block Format"
   1414  1.15  christos  * in the PICMG HPM.2 specification.
   1415  1.15  christos  */
   1416  1.15  christos #define DLT_IPMI_HPM_2	260
   1417  1.15  christos 
   1418  1.16  christos /*
   1419  1.16  christos  * per  Joshua Wright <jwright (at) hasborg.com>, formats for Zwave captures.
   1420  1.16  christos  */
   1421  1.16  christos #define DLT_ZWAVE_R1_R2  261
   1422  1.16  christos #define DLT_ZWAVE_R3     262
   1423  1.16  christos 
   1424  1.16  christos /*
   1425  1.16  christos  * per Steve Karg <skarg (at) users.sourceforge.net>, formats for Wattstopper
   1426  1.16  christos  * Digital Lighting Management room bus serial protocol captures.
   1427  1.16  christos  */
   1428  1.16  christos #define DLT_WATTSTOPPER_DLM     263
   1429  1.16  christos 
   1430  1.17  christos /*
   1431  1.17  christos  * ISO 14443 contactless smart card messages.
   1432  1.17  christos  */
   1433  1.17  christos #define DLT_ISO_14443	264
   1434  1.17  christos 
   1435  1.17  christos /*
   1436  1.17  christos  * Radio data system (RDS) groups.  IEC 62106.
   1437  1.17  christos  * Per Jonathan Brucker <jonathan.brucke (at) gmail.com>.
   1438  1.17  christos  */
   1439  1.17  christos #define DLT_RDS		265
   1440  1.17  christos 
   1441  1.17  christos /*
   1442  1.19  christos  * USB packets, beginning with a Darwin (macOS, etc.) header.
   1443  1.19  christos  */
   1444  1.19  christos #define DLT_USB_DARWIN	266
   1445  1.19  christos 
   1446  1.19  christos /*
   1447  1.19  christos  * OpenBSD DLT_OPENFLOW.
   1448  1.19  christos  */
   1449  1.19  christos #define DLT_OPENFLOW	267
   1450  1.19  christos 
   1451  1.19  christos /*
   1452  1.19  christos  * SDLC frames containing SNA PDUs.
   1453  1.19  christos  */
   1454  1.19  christos #define DLT_SDLC	268
   1455  1.19  christos 
   1456  1.19  christos /*
   1457  1.19  christos  * per "Selvig, Bjorn" <b.selvig (at) ti.com> used for
   1458  1.19  christos  * TI protocol sniffer.
   1459  1.19  christos  */
   1460  1.19  christos #define DLT_TI_LLN_SNIFFER	269
   1461  1.19  christos 
   1462  1.19  christos /*
   1463  1.19  christos  * per: Erik de Jong <erikdejong at gmail.com> for
   1464  1.19  christos  *   https://github.com/eriknl/LoRaTap/releases/tag/v0.1
   1465  1.19  christos  */
   1466  1.19  christos #define DLT_LORATAP             270
   1467  1.19  christos 
   1468  1.19  christos /*
   1469  1.19  christos  * per: Stefanha at gmail.com for
   1470  1.24  christos  *   https://lists.sandelman.ca/pipermail/tcpdump-workers/2017-May/000772.html
   1471  1.19  christos  * and: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/include/uapi/linux/vsockmon.h
   1472  1.24  christos  * for: https://qemu-project.org/Features/VirtioVsock
   1473  1.19  christos  */
   1474  1.19  christos #define DLT_VSOCK               271
   1475  1.19  christos 
   1476  1.19  christos /*
   1477  1.19  christos  * Nordic Semiconductor Bluetooth LE sniffer.
   1478  1.19  christos  */
   1479  1.19  christos #define DLT_NORDIC_BLE		272
   1480  1.19  christos 
   1481  1.19  christos /*
   1482  1.19  christos  * Excentis DOCSIS 3.1 RF sniffer (XRA-31)
   1483  1.19  christos  *   per: bruno.verstuyft at excentis.com
   1484  1.24  christos  *        https://www.xra31.com/xra-header
   1485  1.19  christos  */
   1486  1.19  christos #define DLT_DOCSIS31_XRA31	273
   1487  1.19  christos 
   1488  1.19  christos /*
   1489  1.19  christos  * mPackets, as specified by IEEE 802.3br Figure 99-4, starting
   1490  1.19  christos  * with the preamble and always ending with a CRC field.
   1491  1.19  christos  */
   1492  1.19  christos #define DLT_ETHERNET_MPACKET	274
   1493  1.19  christos 
   1494  1.19  christos /*
   1495  1.19  christos  * DisplayPort AUX channel monitoring data as specified by VESA
   1496  1.22   msaitoh  * DisplayPort(DP) Standard preceded by a pseudo-header.
   1497  1.19  christos  *    per dirk.eibach at gdsys.cc
   1498  1.19  christos  */
   1499  1.19  christos #define DLT_DISPLAYPORT_AUX	275
   1500  1.19  christos 
   1501  1.19  christos /*
   1502  1.20  christos  * Linux cooked sockets v2.
   1503  1.20  christos  */
   1504  1.20  christos #define DLT_LINUX_SLL2	276
   1505  1.20  christos 
   1506  1.20  christos /*
   1507  1.24  christos  * Sercos Monitor, per Manuel Jacob <manuel.jacob at steinbeis-stg.de>
   1508  1.24  christos  */
   1509  1.24  christos #define DLT_SERCOS_MONITOR 277
   1510  1.24  christos 
   1511  1.24  christos /*
   1512  1.24  christos  * OpenVizsla http://openvizsla.org is open source USB analyzer hardware.
   1513  1.24  christos  * It consists of FPGA with attached USB phy and FTDI chip for streaming
   1514  1.24  christos  * the data to the host PC.
   1515  1.24  christos  *
   1516  1.24  christos  * Current OpenVizsla data encapsulation format is described here:
   1517  1.24  christos  * https://github.com/matwey/libopenvizsla/wiki/OpenVizsla-protocol-description
   1518  1.24  christos  *
   1519  1.24  christos  */
   1520  1.24  christos #define DLT_OPENVIZSLA	        278
   1521  1.24  christos 
   1522  1.24  christos /*
   1523  1.24  christos  * The Elektrobit High Speed Capture and Replay (EBHSCR) protocol is produced
   1524  1.24  christos  * by a PCIe Card for interfacing high speed automotive interfaces.
   1525  1.24  christos  *
   1526  1.24  christos  * The specification for this frame format can be found at:
   1527  1.24  christos  *   https://www.elektrobit.com/ebhscr
   1528  1.24  christos  *
   1529  1.24  christos  * for Guenter.Ebermann at elektrobit.com
   1530  1.24  christos  *
   1531  1.24  christos  */
   1532  1.24  christos #define DLT_EBHSCR	        279
   1533  1.24  christos 
   1534  1.24  christos /*
   1535  1.24  christos  * The https://fd.io vpp graph dispatch tracer produces pcap trace files
   1536  1.24  christos  * in the format documented here:
   1537  1.24  christos  * https://fdio-vpp.readthedocs.io/en/latest/gettingstarted/developers/vnet.html#graph-dispatcher-pcap-tracing
   1538  1.24  christos  */
   1539  1.24  christos #define DLT_VPP_DISPATCH	280
   1540  1.24  christos 
   1541  1.24  christos /*
   1542  1.24  christos  * Broadcom Ethernet switches (ROBO switch) 4 bytes proprietary tagging format.
   1543  1.24  christos  */
   1544  1.24  christos #define DLT_DSA_TAG_BRCM	281
   1545  1.24  christos #define DLT_DSA_TAG_BRCM_PREPEND	282
   1546  1.24  christos 
   1547  1.24  christos /*
   1548  1.24  christos  * IEEE 802.15.4 with pseudo-header and optional meta-data TLVs, PHY payload
   1549  1.24  christos  * exactly as it appears in the spec (no padding, no nothing), and FCS if
   1550  1.24  christos  * specified by FCS Type TLV;  requested by James Ko <jck (at) exegin.com>.
   1551  1.24  christos  * Specification at https://github.com/jkcko/ieee802.15.4-tap
   1552  1.24  christos  */
   1553  1.24  christos #define DLT_IEEE802_15_4_TAP    283
   1554  1.24  christos 
   1555  1.24  christos /*
   1556  1.24  christos  * Marvell (Ethertype) Distributed Switch Architecture proprietary tagging format.
   1557  1.24  christos  */
   1558  1.24  christos #define DLT_DSA_TAG_DSA		284
   1559  1.24  christos #define DLT_DSA_TAG_EDSA	285
   1560  1.24  christos 
   1561  1.24  christos /*
   1562  1.24  christos  * Payload of lawful intercept packets using the ELEE protocol;
   1563  1.24  christos  * https://socket.hr/draft-dfranusic-opsawg-elee-00.xml
   1564  1.24  christos  * https://xml2rfc.tools.ietf.org/cgi-bin/xml2rfc.cgi?url=https://socket.hr/draft-dfranusic-opsawg-elee-00.xml&modeAsFormat=html/ascii
   1565  1.24  christos  */
   1566  1.24  christos #define DLT_ELEE		286
   1567  1.24  christos 
   1568  1.24  christos /*
   1569  1.24  christos  * Serial frames transmitted between a host and a Z-Wave chip.
   1570  1.24  christos  */
   1571  1.24  christos #define DLT_Z_WAVE_SERIAL	287
   1572  1.24  christos 
   1573  1.24  christos /*
   1574  1.24  christos  * USB 2.0, 1.1, and 1.0 packets as transmitted over the cable.
   1575  1.24  christos  */
   1576  1.24  christos #define DLT_USB_2_0		288
   1577  1.24  christos 
   1578  1.24  christos /*
   1579  1.24  christos  * ATSC Link-Layer Protocol (A/330) packets.
   1580  1.24  christos  */
   1581  1.24  christos #define DLT_ATSC_ALP		289
   1582  1.24  christos 
   1583  1.24  christos /*
   1584  1.17  christos  * In case the code that includes this file (directly or indirectly)
   1585  1.25  christos  * has also included OS files that happen to define DLT_HIGH_MATCHING_MAX,
   1586  1.17  christos  * with a different value (perhaps because that OS hasn't picked up
   1587  1.17  christos  * the latest version of our DLT definitions), we undefine the
   1588  1.25  christos  * previous value of DLT_HIGH_MATCHING_MAX.
   1589  1.17  christos  */
   1590  1.25  christos #ifdef DLT_HIGH_MATCHING_MAX
   1591  1.25  christos #undef DLT_HIGH_MATCHING_MAX
   1592  1.17  christos #endif
   1593  1.25  christos #define DLT_HIGH_MATCHING_MAX	289	/* highest value in the "matching" range */
   1594  1.12  christos 
   1595  1.12  christos /*
   1596  1.13  christos  * DLT and savefile link type values are split into a class and
   1597  1.13  christos  * a member of that class.  A class value of 0 indicates a regular
   1598  1.13  christos  * DLT_/LINKTYPE_ value.
   1599  1.13  christos  */
   1600  1.13  christos #define DLT_CLASS(x)		((x) & 0x03ff0000)
   1601  1.13  christos 
   1602  1.13  christos /*
   1603  1.13  christos  * NetBSD-specific generic "raw" link type.  The class value indicates
   1604  1.13  christos  * that this is the generic raw type, and the lower 16 bits are the
   1605  1.13  christos  * address family we're dealing with.  Those values are NetBSD-specific;
   1606  1.13  christos  * do not assume that they correspond to AF_ values for your operating
   1607  1.13  christos  * system.
   1608  1.13  christos  */
   1609  1.13  christos #define	DLT_CLASS_NETBSD_RAWAF	0x02240000
   1610  1.13  christos #define	DLT_NETBSD_RAWAF(af)	(DLT_CLASS_NETBSD_RAWAF | (af))
   1611  1.13  christos #define	DLT_NETBSD_RAWAF_AF(x)	((x) & 0x0000ffff)
   1612  1.13  christos #define	DLT_IS_NETBSD_RAWAF(x)	(DLT_CLASS(x) == DLT_CLASS_NETBSD_RAWAF)
   1613   1.1   thorpej 
   1614  1.24  christos #endif /* _NET_DLT_H_ */
   1615