Merge branch 'vendor/OPENSSH'
[dragonfly.git] / contrib / libpcap / pcap-linktype.manmisc.in
1 .\" @(#) $Header: /tcpdump/master/libpcap/pcap-linktype.manmisc.in,v 1.1.2.4 2008-10-27 22:52:05 guy Exp $
2 .\"
3 .\" Copyright (c) 1987, 1988, 1989, 1990, 1991, 1992, 1994, 1995, 1996, 1997
4 .\"     The Regents of the University of California.  All rights reserved.
5 .\" All rights reserved.
6 .\"
7 .\" Redistribution and use in source and binary forms, with or without
8 .\" modification, are permitted provided that: (1) source code distributions
9 .\" retain the above copyright notice and this paragraph in its entirety, (2)
10 .\" distributions including binary code include the above copyright notice and
11 .\" this paragraph in its entirety in the documentation or other materials
12 .\" provided with the distribution, and (3) all advertising materials mentioning
13 .\" features or use of this software display the following acknowledgement:
14 .\" ``This product includes software developed by the University of California,
15 .\" Lawrence Berkeley Laboratory and its contributors.'' Neither the name of
16 .\" the University nor the names of its contributors may be used to endorse
17 .\" or promote products derived from this software without specific prior
18 .\" written permission.
19 .\" THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
20 .\" WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
21 .\" MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
22 .\"
23 .TH PCAP-LINKTYPE @MAN_MISC_INFO@ "23 October 2008"
24 .SH NAME
25 pcap-linktype \- link-layer header types supported by libpcap
26 .SH DESCRIPTION
27 For a live capture or ``savefile'', libpcap supplies, as the return
28 value of the
29 .BR pcap_datalink (3PCAP)
30 routine, a value that indicates the type of link-layer header at the
31 beginning of the packets it provides.  This is not necessarily the type
32 of link-layer header that the packets being captured have on the network
33 from which they're being captured; for example, packets from an IEEE
34 802.11 network might be provided by libpcap with Ethernet headers that
35 the network adapter or the network adapter driver generates from the
36 802.11 headers.  The names for those values begin with
37 .BR DLT_ ,
38 so they are sometimes called "DLT_ values".
39 .PP
40 The values stored in the link-layer header type field in the savefile
41 header are, in most but not all cases, the same as the values returned
42 by
43 .BR pcap_datalink() .
44 The names for those values begin with
45 .BR LINKTYPE_ .
46 .PP
47 The link-layer header types supported by libpcap are listed here.  The
48 value corresponding to
49 .B LINKTYPE_
50 names are given; the value corresponding to
51 .B DLT_
52 values are, in some cases, platform dependent, and are not given;
53 applications should check for particular
54 .B DLT_
55 values by name.
56 .RS 5
57 .TP 5
58 .BR DLT_NULL "; " LINKTYPE_NULL = 0
59 BSD loopback encapsulation; the link layer header is a 4-byte field, in
60 .I host
61 byte order, containing a PF_ value from
62 .B socket.h
63 for the network-layer protocol of the packet.
64 .IP
65 Note that ``host byte order'' is the byte order of the machine on which
66 the packets are captured, and the PF_ values are for the OS of the
67 machine on which the packets are captured; if a live capture is being
68 done, ``host byte order'' is the byte order of the machine capturing the
69 packets, and the PF_ values are those of the OS of the machine capturing
70 the packets, but if a ``savefile'' is being read, the byte order and PF_
71 values are
72 .I not
73 necessarily those of the machine reading the capture file.
74 .TP 5
75 .BR DLT_EN10MB "; " LINKTYPE_ETHERNET = 1
76 Ethernet (10Mb, 100Mb, 1000Mb, and up); the
77 .B 10MB
78 in the
79 .B DLT_
80 name is historical.
81 .TP 5
82 .BR DLT_IEEE802 "; " LINKTYPE_TOKEN_RING = 6
83 IEEE 802.5 Token Ring; the
84 .B IEEE802
85 in the
86 .B DLT_
87 name is historical.
88 .TP 5
89 .BR DLT_ARCNET "; " LINKTYPE_ARCNET = 7
90 ARCNET
91 .TP 5
92 .BR DLT_SLIP "; " LINKTYPE_SLIP = 8
93 SLIP; the link layer header contains, in order:
94 .RS 10
95 .LP
96 a 1-byte flag, which is 0 for packets received by the machine and 1 for
97 packets sent by the machine;
98 .LP
99 a 1-byte field, the upper 4 bits of which indicate the type of packet,
100 as per RFC 1144:
101 .RS 5
102 .TP 5
103 0x40
104 an unmodified IP datagram (TYPE_IP);
105 .TP 5
106 0x70
107 an uncompressed-TCP IP datagram (UNCOMPRESSED_TCP), with that byte being
108 the first byte of the raw IP header on the wire, containing the
109 connection number in the protocol field;
110 .TP 5
111 0x80
112 a compressed-TCP IP datagram (COMPRESSED_TCP), with that byte being the
113 first byte of the compressed TCP/IP datagram header;
114 .RE
115 .LP
116 for UNCOMPRESSED_TCP, the rest of the modified IP header, and for
117 COMPRESSED_TCP, the compressed TCP/IP datagram header;
118 .RE
119 .RS 5
120 .LP
121 for a total of 16 bytes; the uncompressed IP datagram follows the header.
122 .RE
123 .TP 5
124 .BR DLT_PPP "; " LINKTYPE_PPP = 9
125 PPP; if the first 2 bytes are 0xff and 0x03, it's PPP in HDLC-like
126 framing, with the PPP header following those two bytes, otherwise it's
127 PPP without framing, and the packet begins with the PPP header.
128 .TP 5
129 .BR DLT_FDDI "; " LINKTYPE_FDDI = 10
130 FDDI
131 .TP 5
132 .BR DLT_ATM_RFC1483 "; " LINKTYPE_ATM_RFC1483 = 100
133 RFC 1483 LLC/SNAP-encapsulated ATM; the packet begins with an IEEE 802.2
134 LLC header.
135 .TP 5
136 .BR DLT_RAW "; " LINKTYPE_RAW = 101
137 raw IP; the packet begins with an IP header.
138 .TP 5
139 .BR DLT_PPP_SERIAL "; " LINKTYPE_PPP_HDLC = 50
140 PPP in HDLC-like framing, as per RFC 1662, or Cisco PPP with HDLC
141 framing, as per section 4.3.1 of RFC 1547; the first byte will be 0xFF
142 for PPP in HDLC-like framing, and will be 0x0F or 0x8F for Cisco PPP
143 with HDLC framing.
144 .TP 5
145 .BR DLT_PPP_ETHER "; " LINKTYPE_PPP_ETHER = 51
146 PPPoE; the packet begins with a PPPoE header, as per RFC 2516.
147 .TP 5
148 .BR DLT_C_HDLC "; " LINKTYPE_C_HDLC = 104
149 Cisco PPP with HDLC framing, as per section 4.3.1 of RFC 1547.
150 .TP 5
151 .BR DLT_IEEE802_11 "; " LINKTYPE_IEEE802_11 = 105
152 IEEE 802.11 wireless LAN
153 .TP 5
154 .BR DLT_FRELAY "; " LINKTYPE_FRELAY = 107
155 Frame Relay
156 .TP 5
157 .BR DLT_LOOP "; " LINKTYPE_LOOP = 108
158 OpenBSD loopback encapsulation; the link layer header is a 4-byte field, in
159 .I network
160 byte order, containing a PF_ value from OpenBSD's
161 .B socket.h
162 for the network-layer protocol of the packet.
163 .IP
164 Note that, if a ``savefile'' is being read, those PF_ values are
165 .I not
166 necessarily those of the machine reading the capture file.
167 .TP 5
168 .BR DLT_LINUX_SLL "; " LINKTYPE_LINUX_SLL = 113
169 Linux "cooked" capture encapsulation; the link layer header contains, in
170 order:
171 .RS 10
172 .LP
173 a 2-byte "packet type", in network byte order, which is one of:
174 .RS 5
175 .TP 5
176 0
177 packet was sent to us by somebody else
178 .TP 5
179 1
180 packet was broadcast by somebody else
181 .TP 5
182 2
183 packet was multicast, but not broadcast, by somebody else
184 .TP 5
185 3
186 packet was sent by somebody else to somebody else
187 .TP 5
188 4
189 packet was sent by us
190 .RE
191 .LP
192 a 2-byte field, in network byte order, containing a Linux ARPHRD_ value
193 for the link layer device type;
194 .LP
195 a 2-byte field, in network byte order, containing the length of the
196 link layer address of the sender of the packet (which could be 0);
197 .LP
198 an 8-byte field containing that number of bytes of the link layer header
199 (if there are more than 8 bytes, only the first 8 are present);
200 .LP
201 a 2-byte field containing an Ethernet protocol type, in network byte
202 order, or containing 1 for Novell 802.3 frames without an 802.2 LLC
203 header or 4 for frames beginning with an 802.2 LLC header.
204 .RE
205 .TP 5
206 .BR DLT_LTALK "; " LINKTYPE_LTALK = 104
207 Apple LocalTalk; the packet begins with an AppleTalk LLAP header.
208 .TP 5
209 .BR DLT_PFLOG "; " LINKTYPE_PFLOG = 117
210 OpenBSD pflog; the link layer header contains a
211 .B "struct pfloghdr"
212 structure, as defined by the host on which the file was saved.  (This
213 differs from operating system to operating system and release to
214 release; there is nothing in the file to indicate what the layout of
215 that structure is.)
216 .TP 5
217 .BR DLT_PRISM_HEADER "; " LINKTYPE_PRISM_HEADER = 119
218 Prism monitor mode information followed by an 802.11 header.
219 .TP 5
220 .BR DLT_IP_OVER_FC "; " LINKTYPE_IP_OVER_FC = 122
221 RFC 2625 IP-over-Fibre Channel, with the link-layer header being the
222 Network_Header as described in that RFC.
223 .TP 5
224 .BR DLT_SUNATM "; " LINKTYPE_SUNATM = 123
225 SunATM devices; the link layer header contains, in order:
226 .RS 10
227 .LP
228 a 1-byte flag field, containing a direction flag in the uppermost bit,
229 which is set for packets transmitted by the machine and clear for
230 packets received by the machine, and a 4-byte traffic type in the
231 low-order 4 bits, which is one of:
232 .RS 5
233 .TP 5
234 0
235 raw traffic
236 .TP 5
237 1
238 LANE traffic
239 .TP 5
240 2
241 LLC-encapsulated traffic
242 .TP 5
243 3
244 MARS traffic
245 .TP 5
246 4
247 IFMP traffic
248 .TP 5
249 5
250 ILMI traffic
251 .TP 5
252 6
253 Q.2931 traffic
254 .RE
255 .LP
256 a 1-byte VPI value;
257 .LP
258 a 2-byte VCI field, in network byte order.
259 .RE
260 .TP 5
261 .BR DLT_IEEE802_11_RADIO "; " LINKTYPE_IEEE802_11_RADIO = 127
262 link-layer information followed by an 802.11 header - see
263 http://www.shaftnet.org/~pizza/software/capturefrm.txt for a description
264 of the link-layer information.
265 .TP 5
266 .BR DLT_ARCNET_LINUX "; " LINKTYPE_ARCNET_LINUX = 129
267 ARCNET, with no exception frames, reassembled packets rather than raw
268 frames, and an extra 16-bit offset field between the destination host
269 and type bytes.
270 .TP 5
271 .BR DLT_LINUX_IRDA "; " LINKTYPE_LINUX_IRDA = 144
272 Linux-IrDA packets, with a
273 .B DLT_LINUX_SLL
274 header followed by the IrLAP header.
275 .TP 5
276 .BR DLT_LINUX_LAPD "; " LINKTYPE_LINUX_LAPD = 177
277 LAPD (Q.921) frames, with a
278 .B DLT_LINUX_SLL
279 header captured via vISDN.
280 .RE
281 .SH SEE ALSO
282 pcap_datalink(3PCAP)