dlt.h 44 KB

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