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