dlt.h revision 1.12 1 /* $NetBSD: dlt.h,v 1.12 2011/12/21 19:04:18 christos Exp $ */
2
3 /*
4 * Copyright (c) 1990, 1991, 1993
5 * The Regents of the University of California. All rights reserved.
6 *
7 * This code is derived from the Stanford/CMU enet packet filter,
8 * (net/enet.c) distributed as part of 4.3BSD, and code contributed
9 * to Berkeley by Steven McCanne and Van Jacobson both of Lawrence
10 * Berkeley Laboratory.
11 *
12 * Redistribution and use in source and binary forms, with or without
13 * modification, are permitted provided that the following conditions
14 * are met:
15 * 1. Redistributions of source code must retain the above copyright
16 * notice, this list of conditions and the following disclaimer.
17 * 2. Redistributions in binary form must reproduce the above copyright
18 * notice, this list of conditions and the following disclaimer in the
19 * documentation and/or other materials provided with the distribution.
20 * 3. Neither the name of the University nor the names of its contributors
21 * may be used to endorse or promote products derived from this software
22 * without specific prior written permission.
23 *
24 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
25 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
27 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
30 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
31 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
33 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34 * SUCH DAMAGE.
35 *
36 * @(#)bpf.h 8.2 (Berkeley) 1/9/95
37 * @(#) Header: bpf.h,v 1.36 97/06/12 14:29:53 leres Exp (LBL)
38 */
39
40 #ifndef _NET_DLT_H_
41 #define _NET_DLT_H_
42
43 /*
44 * Data-link level type codes.
45 */
46 #define DLT_NULL 0 /* no link-layer encapsulation */
47 #define DLT_EN10MB 1 /* Ethernet (10Mb) */
48 #define DLT_EN3MB 2 /* Experimental Ethernet (3Mb) */
49 #define DLT_AX25 3 /* Amateur Radio AX.25 */
50 #define DLT_PRONET 4 /* Proteon ProNET Token Ring */
51 #define DLT_CHAOS 5 /* Chaos */
52 #define DLT_IEEE802 6 /* IEEE 802 Networks */
53 #define DLT_ARCNET 7 /* ARCNET */
54 #define DLT_SLIP 8 /* Serial Line IP */
55 #define DLT_PPP 9 /* Point-to-point Protocol */
56 #define DLT_FDDI 10 /* FDDI */
57 #define DLT_ATM_RFC1483 11 /* LLC/SNAP encapsulated atm */
58 #define DLT_RAW 12 /* raw IP */
59 #define DLT_SLIP_BSDOS 13 /* BSD/OS Serial Line IP */
60 #define DLT_PPP_BSDOS 14 /* BSD/OS Point-to-point Protocol */
61 #define DLT_HIPPI 15 /* HIPPI */
62 #define DLT_HDLC 16 /* HDLC framing */
63
64 #define DLT_PFSYNC 18 /* Packet filter state syncing */
65 #define DLT_ATM_CLIP 19 /* Linux Classical-IP over ATM */
66 #define DLT_ENC 109 /* Encapsulated packets for IPsec */
67 #define DLT_LINUX_SLL 113 /* Linux cooked sockets */
68 #define DLT_LTALK 114 /* Apple LocalTalk hardware */
69 #define DLT_PFLOG 117 /* Packet filter logging, by pcap people */
70 #define DLT_CISCO_IOS 118 /* Registered for Cisco-internal use */
71
72 /* NetBSD-specific types */
73 #define DLT_PPP_SERIAL 50 /* PPP over serial (async and sync) */
74 #define DLT_PPP_ETHER 51 /* XXX - deprecated! PPP over Ethernet; session only, w/o ether header */
75
76 /* Axent Raptor / Symantec Enterprise Firewall */
77 #define DLT_SYMANTEC_FIREWALL 99
78
79 #define DLT_C_HDLC 104 /* Cisco HDLC */
80 #define DLT_IEEE802_11 105 /* IEEE 802.11 wireless */
81 #define DLT_FRELAY 107 /* Frame Relay */
82 #define DLT_LOOP 108 /* OpenBSD DLT_LOOP */
83 #define DLT_ECONET 115 /* Acorn Econet */
84 #define DLT_PRISM_HEADER 119 /* 802.11 header plus Prism II info. */
85 #define DLT_AIRONET_HEADER 120 /* 802.11 header plus Aironet info. */
86 #define DLT_HHDLC 121 /* Reserved for Siemens HiPath HDLC */
87 #define DLT_IP_OVER_FC 122 /* RFC 2625 IP-over-Fibre Channel */
88 #define DLT_SUNATM 123 /* Solaris+SunATM */
89 #define DLT_RIO 124 /* RapidIO */
90 #define DLT_PCI_EXP 125 /* PCI Express */
91 #define DLT_AURORA 126 /* Xilinx Aurora link layer */
92 #define DLT_IEEE802_11_RADIO 127 /* 802.11 header plus radio info. */
93 #define DLT_TZSP 128 /* Tazmen Sniffer Protocol */
94 #define DLT_ARCNET_LINUX 129 /* ARCNET */
95 #define DLT_JUNIPER_MLPPP 130 /* Juniper-private data link types. */
96 #define DLT_JUNIPER_MLFR 131
97 #define DLT_JUNIPER_ES 132
98 #define DLT_JUNIPER_GGSN 133
99 #define DLT_JUNIPER_MFR 134
100 #define DLT_JUNIPER_ATM2 135
101 #define DLT_JUNIPER_SERVICES 136
102 #define DLT_JUNIPER_ATM1 137
103 #define DLT_APPLE_IP_OVER_IEEE1394 138 /* Apple IP-over-IEEE 1394 */
104
105 /* Various SS7 encapsulations */
106 #define DLT_MTP2_WITH_PHDR 139 /* pseudo-header with various info,
107 followed by MTP2 */
108 #define DLT_MTP2 140 /* MTP2, without pseudo-header */
109 #define DLT_MTP3 141 /* MTP3, without pseudo-header or MTP2 */
110 #define DLT_SCCP 142 /* SCCP, without pseudo-header or MTP2
111 or MTP3 */
112
113 #define DLT_DOCSIS 143 /* Reserved for DOCSIS MAC frames. */
114 #define DLT_LINUX_IRDA 144 /* Linux-IrDA packets */
115
116 /* Reserved for IBM SP switch and IBM Next Federation switch. */
117 #define DLT_IBM_SP 145
118 #define DLT_IBM_SN 146
119
120 #define DLT_IEEE802_11_RADIO_AVS 163 /* 802.11 plus AVS header */
121 #define DLT_JUNIPER_MONITOR 164 /* Juniper-private data link type */
122 #define DLT_BACNET_MS_TP 165
123 #define DLT_PPP_PPPD 166 /* Another PPP variant (Linux? */
124
125 #define DLT_JUNIPER_PPPOE 167
126 #define DLT_JUNIPER_PPPOE_ATM 168
127 #define DLT_JUNIPER_PIC_PEER 174
128 #define DLT_JUNIPER_ETHER 178
129 #define DLT_JUNIPER_PPP 179
130 #define DLT_JUNIPER_FRELAY 180
131 #define DLT_JUNIPER_CHDLC 181
132
133 #define DLT_GPRS_LLC 169 /* GPRS LLC */
134 #define DLT_GPF_T 170 /* GPF-T (ITU-T G.7041/Y.1303) */
135 #define DLT_GPF_F 171 /* GPF-F (ITU-T G.7041/Y.1303) */
136
137 #define DLT_GCOM_T1E1 172
138 #define DLT_GCOM_SERIAL 173
139
140 /* "EndaceRecordFormat" */
141 #define DLT_ERF_ETH 175 /* Ethernet */
142 #define DLT_ERF_POS 176 /* Packet-over-SONET */
143
144 #define DLT_LINUX_LAPD 177 /* Raw LAPD for vISDN */
145
146 /*
147 * Juniper-private data link type, as per request from
148 * Hannes Gredler <hannes (at) juniper.net>.
149 * The DLT_ are used for prepending meta-information
150 * like interface index, interface name
151 * before standard Ethernet, PPP, Frelay & C-HDLC Frames
152 */
153 #define DLT_JUNIPER_ETHER 178
154 #define DLT_JUNIPER_PPP 179
155 #define DLT_JUNIPER_FRELAY 180
156 #define DLT_JUNIPER_CHDLC 181
157
158 /*
159 * Multi Link Frame Relay (FRF.16)
160 */
161 #define DLT_MFR 182
162
163 /*
164 * Juniper-private data link type, as per request from
165 * Hannes Gredler <hannes (at) juniper.net>.
166 * The DLT_ is used for internal communication with a
167 * voice Adapter Card (PIC)
168 */
169 #define DLT_JUNIPER_VP 183
170
171 /*
172 * Arinc 429 frames.
173 * DLT_ requested by Gianluca Varenni <gianluca.varenni (at) cacetech.com>.
174 * Every frame contains a 32bit A429 label.
175 * More documentation on Arinc 429 can be found at
176 * http://www.condoreng.com/support/downloads/tutorials/ARINCTutorial.pdf
177 */
178 #define DLT_A429 184
179
180 /*
181 * Arinc 653 Interpartition Communication messages.
182 * DLT_ requested by Gianluca Varenni <gianluca.varenni (at) cacetech.com>.
183 * Please refer to the A653-1 standard for more information.
184 */
185 #define DLT_A653_ICM 185
186
187 /*
188 * USB packets, beginning with a USB setup header; requested by
189 * Paolo Abeni <paolo.abeni (at) email.it>.
190 */
191 #define DLT_USB 186
192
193 /*
194 * Bluetooth HCI UART transport layer (part H:4); requested by
195 * Paolo Abeni.
196 */
197 #define DLT_BLUETOOTH_HCI_H4 187
198
199 /*
200 * IEEE 802.16 MAC Common Part Sublayer; requested by Maria Cruz
201 * <cruz_petagay (at) bah.com>.
202 */
203 #define DLT_IEEE802_16_MAC_CPS 188
204
205 /*
206 * USB packets, beginning with a Linux USB header; requested by
207 * Paolo Abeni <paolo.abeni (at) email.it>.
208 */
209 #define DLT_USB_LINUX 189
210
211 /*
212 * Controller Area Network (CAN) v. 2.0B packets.
213 * DLT_ requested by Gianluca Varenni <gianluca.varenni (at) cacetech.com>.
214 * Used to dump CAN packets coming from a CAN Vector board.
215 * More documentation on the CAN v2.0B frames can be found at
216 * http://www.can-cia.org/downloads/?269
217 */
218 #define DLT_CAN20B 190
219
220 /*
221 * IEEE 802.15.4, with address fields padded, as is done by Linux
222 * drivers; requested by Juergen Schimmer.
223 */
224 #define DLT_IEEE802_15_4_LINUX 191
225
226 /*
227 * Per Packet Information encapsulated packets.
228 * DLT_ requested by Gianluca Varenni <gianluca.varenni (at) cacetech.com>.
229 */
230 #define DLT_PPI 192
231
232 /*
233 * Header for 802.16 MAC Common Part Sublayer plus a radiotap radio header;
234 * requested by Charles Clancy.
235 */
236 #define DLT_IEEE802_16_MAC_CPS_RADIO 193
237
238 /*
239 * Juniper-private data link type, as per request from
240 * Hannes Gredler <hannes (at) juniper.net>.
241 * The DLT_ is used for internal communication with a
242 * integrated service module (ISM).
243 */
244 #define DLT_JUNIPER_ISM 194
245
246 /*
247 * IEEE 802.15.4, exactly as it appears in the spec (no padding, no
248 * nothing); requested by Mikko Saarnivala <mikko.saarnivala (at) sensinode.com>.
249 */
250 #define DLT_IEEE802_15_4 195
251
252 /*
253 * Various link-layer types, with a pseudo-header, for SITA
254 * (http://www.sita.aero/); requested by Fulko Hew (fulko.hew (at) gmail.com).
255 */
256 #define DLT_SITA 196
257
258 /*
259 * Various link-layer types, with a pseudo-header, for Endace DAG cards;
260 * encapsulates Endace ERF records. Requested by Stephen Donnelly
261 * <stephen (at) endace.com>.
262 */
263 #define DLT_ERF 197
264
265 /*
266 * Special header prepended to Ethernet packets when capturing from a
267 * u10 Networks board. Requested by Phil Mulholland
268 * <phil (at) u10networks.com>.
269 */
270 #define DLT_RAIF1 198
271
272 /*
273 * IPMB packet for IPMI, beginning with the I2C slave address, followed
274 * by the netFn and LUN, etc.. Requested by Chanthy Toeung
275 * <chanthy.toeung (at) ca.kontron.com>.
276 */
277 #define DLT_IPMB 199
278
279 /*
280 * Juniper-private data link type, as per request from
281 * Hannes Gredler <hannes (at) juniper.net>.
282 * The DLT_ is used for capturing data on a secure tunnel interface.
283 */
284 #define DLT_JUNIPER_ST 200
285
286 /*
287 * Bluetooth HCI UART transport layer (part H:4), with pseudo-header
288 * that includes direction information; requested by Paolo Abeni.
289 */
290 #define DLT_BLUETOOTH_HCI_H4_WITH_PHDR 201
291
292 /*
293 * AX.25 packet with a 1-byte KISS header; see
294 *
295 * http://www.ax25.net/kiss.htm
296 *
297 * as per Richard Stearn <richard (at) rns-stearn.demon.co.uk>.
298 */
299 #define DLT_AX25_KISS 202
300
301 /*
302 * LAPD packets from an ISDN channel, starting with the address field,
303 * with no pseudo-header.
304 * Requested by Varuna De Silva <varunax (at) gmail.com>.
305 */
306 #define DLT_LAPD 203
307
308 /*
309 * Variants of various link-layer headers, with a one-byte direction
310 * pseudo-header prepended - zero means "received by this host",
311 * non-zero (any non-zero value) means "sent by this host" - as per
312 * Will Barker <w.barker (at) zen.co.uk>.
313 */
314 #define DLT_PPP_WITH_DIR 204 /* PPP - don't confuse with DLT_PPP_WITH_DIRECTION */
315 #define DLT_C_HDLC_WITH_DIR 205 /* Cisco HDLC */
316 #define DLT_FRELAY_WITH_DIR 206 /* Frame Relay */
317 #define DLT_LAPB_WITH_DIR 207 /* LAPB */
318
319 /*
320 * 208 is reserved for an as-yet-unspecified proprietary link-layer
321 * type, as requested by Will Barker.
322 */
323
324 /*
325 * IPMB with a Linux-specific pseudo-header; as requested by Alexey Neyman
326 * <avn (at) pigeonpoint.com>.
327 */
328 #define DLT_IPMB_LINUX 209
329
330 /*
331 * FlexRay automotive bus - http://www.flexray.com/ - as requested
332 * by Hannes Kaelber <hannes.kaelber (at) x2e.de>.
333 */
334 #define DLT_FLEXRAY 210
335
336 /*
337 * Media Oriented Systems Transport (MOST) bus for multimedia
338 * transport - http://www.mostcooperation.com/ - as requested
339 * by Hannes Kaelber <hannes.kaelber (at) x2e.de>.
340 */
341 #define DLT_MOST 211
342
343 /*
344 * Local Interconnect Network (LIN) bus for vehicle networks -
345 * http://www.lin-subbus.org/ - as requested by Hannes Kaelber
346 * <hannes.kaelber (at) x2e.de>.
347 */
348 #define DLT_LIN 212
349
350 /*
351 * X2E-private data link type used for serial line capture,
352 * as requested by Hannes Kaelber <hannes.kaelber (at) x2e.de>.
353 */
354 #define DLT_X2E_SERIAL 213
355
356 /*
357 * X2E-private data link type used for the Xoraya data logger
358 * family, as requested by Hannes Kaelber <hannes.kaelber (at) x2e.de>.
359 */
360 #define DLT_X2E_XORAYA 214
361
362 /*
363 * IEEE 802.15.4, exactly as it appears in the spec (no padding, no
364 * nothing), but with the PHY-level data for non-ASK PHYs (4 octets
365 * of 0 as preamble, one octet of SFD, one octet of frame length+
366 * reserved bit, and then the MAC-layer data, starting with the
367 * frame control field).
368 *
369 * Requested by Max Filippov <jcmvbkbc (at) gmail.com>.
370 */
371 #define DLT_IEEE802_15_4_NONASK_PHY 215
372
373 /*
374 * David Gibson <david (at) gibson.dropbear.id.au> requested this for
375 * captures from the Linux kernel /dev/input/eventN devices. This
376 * is used to communicate keystrokes and mouse movements from the
377 * Linux kernel to display systems, such as Xorg.
378 */
379 #define DLT_LINUX_EVDEV 216
380
381 /*
382 * GSM Um and Abis interfaces, preceded by a "gsmtap" header.
383 *
384 * Requested by Harald Welte <laforge (at) gnumonks.org>.
385 */
386 #define DLT_GSMTAP_UM 217
387 #define DLT_GSMTAP_ABIS 218
388
389 /*
390 * MPLS, with an MPLS label as the link-layer header.
391 * Requested by Michele Marchetto <michele (at) openbsd.org> on behalf
392 * of OpenBSD.
393 */
394 #define DLT_MPLS 219
395
396 /*
397 * USB packets, beginning with a Linux USB header, with the USB header
398 * padded to 64 bytes; required for memory-mapped access.
399 */
400 #define DLT_USB_LINUX_MMAPPED 220
401
402 /*
403 * DECT packets, with a pseudo-header; requested by
404 * Matthias Wenzel <tcpdump (at) mazzoo.de>.
405 */
406 #define DLT_DECT 221
407
408 /*
409 * From: "Lidwa, Eric (GSFC-582.0)[SGT INC]" <eric.lidwa-1 (at) nasa.gov>
410 * Date: Mon, 11 May 2009 11:18:30 -0500
411 *
412 * DLT_AOS. We need it for AOS Space Data Link Protocol.
413 * I have already written dissectors for but need an OK from
414 * legal before I can submit a patch.
415 *
416 */
417 #define DLT_AOS 222
418
419 /*
420 * Wireless HART (Highway Addressable Remote Transducer)
421 * From the HART Communication Foundation
422 * IES/PAS 62591
423 *
424 * Requested by Sam Roberts <vieuxtech (at) gmail.com>.
425 */
426 #define DLT_WIHART 223
427
428 /*
429 * Fibre Channel FC-2 frames, beginning with a Frame_Header.
430 * Requested by Kahou Lei <kahou82 (at) gmail.com>.
431 */
432 #define DLT_FC_2 224
433
434 /*
435 * Fibre Channel FC-2 frames, beginning with an encoding of the
436 * SOF, and ending with an encoding of the EOF.
437 *
438 * The encodings represent the frame delimiters as 4-byte sequences
439 * representing the corresponding ordered sets, with K28.5
440 * represented as 0xBC, and the D symbols as the corresponding
441 * byte values; for example, SOFi2, which is K28.5 - D21.5 - D1.2 - D21.2,
442 * is represented as 0xBC 0xB5 0x55 0x55.
443 *
444 * Requested by Kahou Lei <kahou82 (at) gmail.com>.
445 */
446 #define DLT_FC_2_WITH_FRAME_DELIMS 225
447
448 /*
449 * Solaris ipnet pseudo-header; requested by Darren Reed <Darren.Reed (at) Sun.COM>.
450 *
451 * The pseudo-header starts with a one-byte version number; for version 2,
452 * the pseudo-header is:
453 *
454 * struct dl_ipnetinfo {
455 * u_int8_t dli_version;
456 * u_int8_t dli_family;
457 * u_int16_t dli_htype;
458 * u_int32_t dli_pktlen;
459 * u_int32_t dli_ifindex;
460 * u_int32_t dli_grifindex;
461 * u_int32_t dli_zsrc;
462 * u_int32_t dli_zdst;
463 * };
464 *
465 * dli_version is 2 for the current version of the pseudo-header.
466 *
467 * dli_family is a Solaris address family value, so it's 2 for IPv4
468 * and 26 for IPv6.
469 *
470 * dli_htype is a "hook type" - 0 for incoming packets, 1 for outgoing
471 * packets, and 2 for packets arriving from another zone on the same
472 * machine.
473 *
474 * dli_pktlen is the length of the packet data following the pseudo-header
475 * (so the captured length minus dli_pktlen is the length of the
476 * pseudo-header, assuming the entire pseudo-header was captured).
477 *
478 * dli_ifindex is the interface index of the interface on which the
479 * packet arrived.
480 *
481 * dli_grifindex is the group interface index number (for IPMP interfaces).
482 *
483 * dli_zsrc is the zone identifier for the source of the packet.
484 *
485 * dli_zdst is the zone identifier for the destination of the packet.
486 *
487 * A zone number of 0 is the global zone; a zone number of 0xffffffff
488 * means that the packet arrived from another host on the network, not
489 * from another zone on the same machine.
490 *
491 * An IPv4 or IPv6 datagram follows the pseudo-header; dli_family indicates
492 * which of those it is.
493 */
494 #define DLT_IPNET 226
495
496 /*
497 * CAN (Controller Area Network) frames, with a pseudo-header as supplied
498 * by Linux SocketCAN. See Documentation/networking/can.txt in the Linux
499 * source.
500 *
501 * Requested by Felix Obenhuber <felix (at) obenhuber.de>.
502 */
503 #define DLT_CAN_SOCKETCAN 227
504
505 /*
506 * Raw IPv4/IPv6; different from DLT_RAW in that the DLT_ value specifies
507 * whether it's v4 or v6. Requested by Darren Reed <Darren.Reed (at) Sun.COM>.
508 */
509 #define DLT_IPV4 228
510 #define DLT_IPV6 229
511
512 /*
513 * NetBSD-specific generic "raw" link type. The upper 16-bits indicate
514 * that this is the generic raw type, and the lower 16-bits are the
515 * address family we're dealing with.
516 */
517 #define DLT_RAWAF_MASK 0x02240000
518 #define DLT_RAWAF(af) (DLT_RAWAF_MASK | (af))
519 #define DLT_RAWAF_AF(x) ((x) & 0x0000ffff)
520 #define DLT_IS_RAWAF(x) (((x) & 0xffff0000) == DLT_RAWAF_MASK)
521
522 #endif /* !_NET_DLT_H_ */
523