dlt.h 50 KB

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