1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/boardsupport/emulator/emulatorbsp/wpdpack/include/pcap-bpf.h Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,736 @@
1.4 +/*-
1.5 + * Copyright (c) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997
1.6 + * The Regents of the University of California. All rights reserved.
1.7 + *
1.8 + * This code is derived from the Stanford/CMU enet packet filter,
1.9 + * (net/enet.c) distributed as part of 4.3BSD, and code contributed
1.10 + * to Berkeley by Steven McCanne and Van Jacobson both of Lawrence
1.11 + * Berkeley Laboratory.
1.12 + *
1.13 + * Redistribution and use in source and binary forms, with or without
1.14 + * modification, are permitted provided that the following conditions
1.15 + * are met:
1.16 + * 1. Redistributions of source code must retain the above copyright
1.17 + * notice, this list of conditions and the following disclaimer.
1.18 + * 2. Redistributions in binary form must reproduce the above copyright
1.19 + * notice, this list of conditions and the following disclaimer in the
1.20 + * documentation and/or other materials provided with the distribution.
1.21 + * 3. All advertising materials mentioning features or use of this software
1.22 + * must display the following acknowledgement:
1.23 + * This product includes software developed by the University of
1.24 + * California, Berkeley and its contributors.
1.25 + * 4. Neither the name of the University nor the names of its contributors
1.26 + * may be used to endorse or promote products derived from this software
1.27 + * without specific prior written permission.
1.28 + *
1.29 + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
1.30 + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
1.31 + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
1.32 + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
1.33 + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
1.34 + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
1.35 + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
1.36 + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
1.37 + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
1.38 + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
1.39 + * SUCH DAMAGE.
1.40 + *
1.41 + * @(#)bpf.h 7.1 (Berkeley) 5/7/91
1.42 + *
1.43 + * @(#) $Header: /tcpdump/master/libpcap/pcap-bpf.h,v 1.34.2.11 2006/07/27 21:06:17 gianluca Exp $ (LBL)
1.44 + */
1.45 +
1.46 +/*
1.47 + * This is libpcap's cut-down version of bpf.h; it includes only
1.48 + * the stuff needed for the code generator and the userland BPF
1.49 + * interpreter, and the libpcap APIs for setting filters, etc..
1.50 + *
1.51 + * "pcap-bpf.c" will include the native OS version, as it deals with
1.52 + * the OS's BPF implementation.
1.53 + *
1.54 + * XXX - should this all just be moved to "pcap.h"?
1.55 + */
1.56 +
1.57 +#ifndef BPF_MAJOR_VERSION
1.58 +
1.59 +#ifdef __cplusplus
1.60 +extern "C" {
1.61 +#endif
1.62 +
1.63 +/* BSD style release date */
1.64 +#define BPF_RELEASE 199606
1.65 +
1.66 +#ifdef MSDOS /* must be 32-bit */
1.67 +typedef long bpf_int32;
1.68 +typedef unsigned long bpf_u_int32;
1.69 +#else
1.70 +typedef int bpf_int32;
1.71 +typedef u_int bpf_u_int32;
1.72 +#endif
1.73 +
1.74 +/*
1.75 + * Alignment macros. BPF_WORDALIGN rounds up to the next
1.76 + * even multiple of BPF_ALIGNMENT.
1.77 + */
1.78 +#ifndef __NetBSD__
1.79 +#define BPF_ALIGNMENT sizeof(bpf_int32)
1.80 +#else
1.81 +#define BPF_ALIGNMENT sizeof(long)
1.82 +#endif
1.83 +#define BPF_WORDALIGN(x) (((x)+(BPF_ALIGNMENT-1))&~(BPF_ALIGNMENT-1))
1.84 +
1.85 +#define BPF_MAXINSNS 512
1.86 +#define BPF_MAXBUFSIZE 0x8000
1.87 +#define BPF_MINBUFSIZE 32
1.88 +
1.89 +/*
1.90 + * Structure for "pcap_compile()", "pcap_setfilter()", etc..
1.91 + */
1.92 +struct bpf_program {
1.93 + u_int bf_len;
1.94 + struct bpf_insn *bf_insns;
1.95 +};
1.96 +
1.97 +/*
1.98 + * Struct return by BIOCVERSION. This represents the version number of
1.99 + * the filter language described by the instruction encodings below.
1.100 + * bpf understands a program iff kernel_major == filter_major &&
1.101 + * kernel_minor >= filter_minor, that is, if the value returned by the
1.102 + * running kernel has the same major number and a minor number equal
1.103 + * equal to or less than the filter being downloaded. Otherwise, the
1.104 + * results are undefined, meaning an error may be returned or packets
1.105 + * may be accepted haphazardly.
1.106 + * It has nothing to do with the source code version.
1.107 + */
1.108 +struct bpf_version {
1.109 + u_short bv_major;
1.110 + u_short bv_minor;
1.111 +};
1.112 +/* Current version number of filter architecture. */
1.113 +#define BPF_MAJOR_VERSION 1
1.114 +#define BPF_MINOR_VERSION 1
1.115 +
1.116 +/*
1.117 + * Data-link level type codes.
1.118 + *
1.119 + * Do *NOT* add new values to this list without asking
1.120 + * "tcpdump-workers@tcpdump.org" for a value. Otherwise, you run the
1.121 + * risk of using a value that's already being used for some other purpose,
1.122 + * and of having tools that read libpcap-format captures not being able
1.123 + * to handle captures with your new DLT_ value, with no hope that they
1.124 + * will ever be changed to do so (as that would destroy their ability
1.125 + * to read captures using that value for that other purpose).
1.126 + */
1.127 +
1.128 +/*
1.129 + * These are the types that are the same on all platforms, and that
1.130 + * have been defined by <net/bpf.h> for ages.
1.131 + */
1.132 +#define DLT_NULL 0 /* BSD loopback encapsulation */
1.133 +#define DLT_EN10MB 1 /* Ethernet (10Mb) */
1.134 +#define DLT_EN3MB 2 /* Experimental Ethernet (3Mb) */
1.135 +#define DLT_AX25 3 /* Amateur Radio AX.25 */
1.136 +#define DLT_PRONET 4 /* Proteon ProNET Token Ring */
1.137 +#define DLT_CHAOS 5 /* Chaos */
1.138 +#define DLT_IEEE802 6 /* IEEE 802 Networks */
1.139 +#define DLT_ARCNET 7 /* ARCNET, with BSD-style header */
1.140 +#define DLT_SLIP 8 /* Serial Line IP */
1.141 +#define DLT_PPP 9 /* Point-to-point Protocol */
1.142 +#define DLT_FDDI 10 /* FDDI */
1.143 +
1.144 +/*
1.145 + * These are types that are different on some platforms, and that
1.146 + * have been defined by <net/bpf.h> for ages. We use #ifdefs to
1.147 + * detect the BSDs that define them differently from the traditional
1.148 + * libpcap <net/bpf.h>
1.149 + *
1.150 + * XXX - DLT_ATM_RFC1483 is 13 in BSD/OS, and DLT_RAW is 14 in BSD/OS,
1.151 + * but I don't know what the right #define is for BSD/OS.
1.152 + */
1.153 +#define DLT_ATM_RFC1483 11 /* LLC-encapsulated ATM */
1.154 +
1.155 +#ifdef __OpenBSD__
1.156 +#define DLT_RAW 14 /* raw IP */
1.157 +#else
1.158 +#define DLT_RAW 12 /* raw IP */
1.159 +#endif
1.160 +
1.161 +/*
1.162 + * Given that the only OS that currently generates BSD/OS SLIP or PPP
1.163 + * is, well, BSD/OS, arguably everybody should have chosen its values
1.164 + * for DLT_SLIP_BSDOS and DLT_PPP_BSDOS, which are 15 and 16, but they
1.165 + * didn't. So it goes.
1.166 + */
1.167 +#if defined(__NetBSD__) || defined(__FreeBSD__)
1.168 +#ifndef DLT_SLIP_BSDOS
1.169 +#define DLT_SLIP_BSDOS 13 /* BSD/OS Serial Line IP */
1.170 +#define DLT_PPP_BSDOS 14 /* BSD/OS Point-to-point Protocol */
1.171 +#endif
1.172 +#else
1.173 +#define DLT_SLIP_BSDOS 15 /* BSD/OS Serial Line IP */
1.174 +#define DLT_PPP_BSDOS 16 /* BSD/OS Point-to-point Protocol */
1.175 +#endif
1.176 +
1.177 +/*
1.178 + * 17 is used for DLT_OLD_PFLOG in OpenBSD;
1.179 + * OBSOLETE: DLT_PFLOG is 117 in OpenBSD now as well. See below.
1.180 + * 18 is used for DLT_PFSYNC in OpenBSD; don't use it for anything else.
1.181 + */
1.182 +
1.183 +#define DLT_ATM_CLIP 19 /* Linux Classical-IP over ATM */
1.184 +
1.185 +/*
1.186 + * Apparently Redback uses this for its SmartEdge 400/800. I hope
1.187 + * nobody else decided to use it, too.
1.188 + */
1.189 +#define DLT_REDBACK_SMARTEDGE 32
1.190 +
1.191 +/*
1.192 + * These values are defined by NetBSD; other platforms should refrain from
1.193 + * using them for other purposes, so that NetBSD savefiles with link
1.194 + * types of 50 or 51 can be read as this type on all platforms.
1.195 + */
1.196 +#define DLT_PPP_SERIAL 50 /* PPP over serial with HDLC encapsulation */
1.197 +#define DLT_PPP_ETHER 51 /* PPP over Ethernet */
1.198 +
1.199 +/*
1.200 + * The Axent Raptor firewall - now the Symantec Enterprise Firewall - uses
1.201 + * a link-layer type of 99 for the tcpdump it supplies. The link-layer
1.202 + * header has 6 bytes of unknown data, something that appears to be an
1.203 + * Ethernet type, and 36 bytes that appear to be 0 in at least one capture
1.204 + * I've seen.
1.205 + */
1.206 +#define DLT_SYMANTEC_FIREWALL 99
1.207 +
1.208 +/*
1.209 + * Values between 100 and 103 are used in capture file headers as
1.210 + * link-layer types corresponding to DLT_ types that differ
1.211 + * between platforms; don't use those values for new DLT_ new types.
1.212 + */
1.213 +
1.214 +/*
1.215 + * This value was defined by libpcap 0.5; platforms that have defined
1.216 + * it with a different value should define it here with that value -
1.217 + * a link type of 104 in a save file will be mapped to DLT_C_HDLC,
1.218 + * whatever value that happens to be, so programs will correctly
1.219 + * handle files with that link type regardless of the value of
1.220 + * DLT_C_HDLC.
1.221 + *
1.222 + * The name DLT_C_HDLC was used by BSD/OS; we use that name for source
1.223 + * compatibility with programs written for BSD/OS.
1.224 + *
1.225 + * libpcap 0.5 defined it as DLT_CHDLC; we define DLT_CHDLC as well,
1.226 + * for source compatibility with programs written for libpcap 0.5.
1.227 + */
1.228 +#define DLT_C_HDLC 104 /* Cisco HDLC */
1.229 +#define DLT_CHDLC DLT_C_HDLC
1.230 +
1.231 +#define DLT_IEEE802_11 105 /* IEEE 802.11 wireless */
1.232 +
1.233 +/*
1.234 + * 106 is reserved for Linux Classical IP over ATM; it's like DLT_RAW,
1.235 + * except when it isn't. (I.e., sometimes it's just raw IP, and
1.236 + * sometimes it isn't.) We currently handle it as DLT_LINUX_SLL,
1.237 + * so that we don't have to worry about the link-layer header.)
1.238 + */
1.239 +
1.240 +/*
1.241 + * Frame Relay; BSD/OS has a DLT_FR with a value of 11, but that collides
1.242 + * with other values.
1.243 + * DLT_FR and DLT_FRELAY packets start with the Q.922 Frame Relay header
1.244 + * (DLCI, etc.).
1.245 + */
1.246 +#define DLT_FRELAY 107
1.247 +
1.248 +/*
1.249 + * OpenBSD DLT_LOOP, for loopback devices; it's like DLT_NULL, except
1.250 + * that the AF_ type in the link-layer header is in network byte order.
1.251 + *
1.252 + * OpenBSD defines it as 12, but that collides with DLT_RAW, so we
1.253 + * define it as 108 here. If OpenBSD picks up this file, it should
1.254 + * define DLT_LOOP as 12 in its version, as per the comment above -
1.255 + * and should not use 108 as a DLT_ value.
1.256 + */
1.257 +#define DLT_LOOP 108
1.258 +
1.259 +/*
1.260 + * Encapsulated packets for IPsec; DLT_ENC is 13 in OpenBSD, but that's
1.261 + * DLT_SLIP_BSDOS in NetBSD, so we don't use 13 for it in OSes other
1.262 + * than OpenBSD.
1.263 + */
1.264 +#ifdef __OpenBSD__
1.265 +#define DLT_ENC 13
1.266 +#else
1.267 +#define DLT_ENC 109
1.268 +#endif
1.269 +
1.270 +/*
1.271 + * Values between 110 and 112 are reserved for use in capture file headers
1.272 + * as link-layer types corresponding to DLT_ types that might differ
1.273 + * between platforms; don't use those values for new DLT_ types
1.274 + * other than the corresponding DLT_ types.
1.275 + */
1.276 +
1.277 +/*
1.278 + * This is for Linux cooked sockets.
1.279 + */
1.280 +#define DLT_LINUX_SLL 113
1.281 +
1.282 +/*
1.283 + * Apple LocalTalk hardware.
1.284 + */
1.285 +#define DLT_LTALK 114
1.286 +
1.287 +/*
1.288 + * Acorn Econet.
1.289 + */
1.290 +#define DLT_ECONET 115
1.291 +
1.292 +/*
1.293 + * Reserved for use with OpenBSD ipfilter.
1.294 + */
1.295 +#define DLT_IPFILTER 116
1.296 +
1.297 +/*
1.298 + * OpenBSD DLT_PFLOG; DLT_PFLOG is 17 in OpenBSD, but that's DLT_LANE8023
1.299 + * in SuSE 6.3, so we can't use 17 for it in capture-file headers.
1.300 + *
1.301 + * XXX: is there a conflict with DLT_PFSYNC 18 as well?
1.302 + */
1.303 +#ifdef __OpenBSD__
1.304 +#define DLT_OLD_PFLOG 17
1.305 +#define DLT_PFSYNC 18
1.306 +#endif
1.307 +#define DLT_PFLOG 117
1.308 +
1.309 +/*
1.310 + * Registered for Cisco-internal use.
1.311 + */
1.312 +#define DLT_CISCO_IOS 118
1.313 +
1.314 +/*
1.315 + * For 802.11 cards using the Prism II chips, with a link-layer
1.316 + * header including Prism monitor mode information plus an 802.11
1.317 + * header.
1.318 + */
1.319 +#define DLT_PRISM_HEADER 119
1.320 +
1.321 +/*
1.322 + * Reserved for Aironet 802.11 cards, with an Aironet link-layer header
1.323 + * (see Doug Ambrisko's FreeBSD patches).
1.324 + */
1.325 +#define DLT_AIRONET_HEADER 120
1.326 +
1.327 +/*
1.328 + * Reserved for Siemens HiPath HDLC.
1.329 + */
1.330 +#define DLT_HHDLC 121
1.331 +
1.332 +/*
1.333 + * This is for RFC 2625 IP-over-Fibre Channel.
1.334 + *
1.335 + * This is not for use with raw Fibre Channel, where the link-layer
1.336 + * header starts with a Fibre Channel frame header; it's for IP-over-FC,
1.337 + * where the link-layer header starts with an RFC 2625 Network_Header
1.338 + * field.
1.339 + */
1.340 +#define DLT_IP_OVER_FC 122
1.341 +
1.342 +/*
1.343 + * This is for Full Frontal ATM on Solaris with SunATM, with a
1.344 + * pseudo-header followed by an AALn PDU.
1.345 + *
1.346 + * There may be other forms of Full Frontal ATM on other OSes,
1.347 + * with different pseudo-headers.
1.348 + *
1.349 + * If ATM software returns a pseudo-header with VPI/VCI information
1.350 + * (and, ideally, packet type information, e.g. signalling, ILMI,
1.351 + * LANE, LLC-multiplexed traffic, etc.), it should not use
1.352 + * DLT_ATM_RFC1483, but should get a new DLT_ value, so tcpdump
1.353 + * and the like don't have to infer the presence or absence of a
1.354 + * pseudo-header and the form of the pseudo-header.
1.355 + */
1.356 +#define DLT_SUNATM 123 /* Solaris+SunATM */
1.357 +
1.358 +/*
1.359 + * Reserved as per request from Kent Dahlgren <kent@praesum.com>
1.360 + * for private use.
1.361 + */
1.362 +#define DLT_RIO 124 /* RapidIO */
1.363 +#define DLT_PCI_EXP 125 /* PCI Express */
1.364 +#define DLT_AURORA 126 /* Xilinx Aurora link layer */
1.365 +
1.366 +/*
1.367 + * Header for 802.11 plus a number of bits of link-layer information
1.368 + * including radio information, used by some recent BSD drivers as
1.369 + * well as the madwifi Atheros driver for Linux.
1.370 + */
1.371 +#define DLT_IEEE802_11_RADIO 127 /* 802.11 plus radiotap radio header */
1.372 +
1.373 +/*
1.374 + * Reserved for the TZSP encapsulation, as per request from
1.375 + * Chris Waters <chris.waters@networkchemistry.com>
1.376 + * TZSP is a generic encapsulation for any other link type,
1.377 + * which includes a means to include meta-information
1.378 + * with the packet, e.g. signal strength and channel
1.379 + * for 802.11 packets.
1.380 + */
1.381 +#define DLT_TZSP 128 /* Tazmen Sniffer Protocol */
1.382 +
1.383 +/*
1.384 + * BSD's ARCNET headers have the source host, destination host,
1.385 + * and type at the beginning of the packet; that's what's handed
1.386 + * up to userland via BPF.
1.387 + *
1.388 + * Linux's ARCNET headers, however, have a 2-byte offset field
1.389 + * between the host IDs and the type; that's what's handed up
1.390 + * to userland via PF_PACKET sockets.
1.391 + *
1.392 + * We therefore have to have separate DLT_ values for them.
1.393 + */
1.394 +#define DLT_ARCNET_LINUX 129 /* ARCNET */
1.395 +
1.396 +/*
1.397 + * Juniper-private data link types, as per request from
1.398 + * Hannes Gredler <hannes@juniper.net>. The DLT_s are used
1.399 + * for passing on chassis-internal metainformation such as
1.400 + * QOS profiles, etc..
1.401 + */
1.402 +#define DLT_JUNIPER_MLPPP 130
1.403 +#define DLT_JUNIPER_MLFR 131
1.404 +#define DLT_JUNIPER_ES 132
1.405 +#define DLT_JUNIPER_GGSN 133
1.406 +#define DLT_JUNIPER_MFR 134
1.407 +#define DLT_JUNIPER_ATM2 135
1.408 +#define DLT_JUNIPER_SERVICES 136
1.409 +#define DLT_JUNIPER_ATM1 137
1.410 +
1.411 +/*
1.412 + * Apple IP-over-IEEE 1394, as per a request from Dieter Siegmund
1.413 + * <dieter@apple.com>. The header that's presented is an Ethernet-like
1.414 + * header:
1.415 + *
1.416 + * #define FIREWIRE_EUI64_LEN 8
1.417 + * struct firewire_header {
1.418 + * u_char firewire_dhost[FIREWIRE_EUI64_LEN];
1.419 + * u_char firewire_shost[FIREWIRE_EUI64_LEN];
1.420 + * u_short firewire_type;
1.421 + * };
1.422 + *
1.423 + * with "firewire_type" being an Ethernet type value, rather than,
1.424 + * for example, raw GASP frames being handed up.
1.425 + */
1.426 +#define DLT_APPLE_IP_OVER_IEEE1394 138
1.427 +
1.428 +/*
1.429 + * Various SS7 encapsulations, as per a request from Jeff Morriss
1.430 + * <jeff.morriss[AT]ulticom.com> and subsequent discussions.
1.431 + */
1.432 +#define DLT_MTP2_WITH_PHDR 139 /* pseudo-header with various info, followed by MTP2 */
1.433 +#define DLT_MTP2 140 /* MTP2, without pseudo-header */
1.434 +#define DLT_MTP3 141 /* MTP3, without pseudo-header or MTP2 */
1.435 +#define DLT_SCCP 142 /* SCCP, without pseudo-header or MTP2 or MTP3 */
1.436 +
1.437 +/*
1.438 + * DOCSIS MAC frames.
1.439 + */
1.440 +#define DLT_DOCSIS 143
1.441 +
1.442 +/*
1.443 + * Linux-IrDA packets. Protocol defined at http://www.irda.org.
1.444 + * Those packets include IrLAP headers and above (IrLMP...), but
1.445 + * don't include Phy framing (SOF/EOF/CRC & byte stuffing), because Phy
1.446 + * framing can be handled by the hardware and depend on the bitrate.
1.447 + * This is exactly the format you would get capturing on a Linux-IrDA
1.448 + * interface (irdaX), but not on a raw serial port.
1.449 + * Note the capture is done in "Linux-cooked" mode, so each packet include
1.450 + * a fake packet header (struct sll_header). This is because IrDA packet
1.451 + * decoding is dependant on the direction of the packet (incomming or
1.452 + * outgoing).
1.453 + * When/if other platform implement IrDA capture, we may revisit the
1.454 + * issue and define a real DLT_IRDA...
1.455 + * Jean II
1.456 + */
1.457 +#define DLT_LINUX_IRDA 144
1.458 +
1.459 +/*
1.460 + * Reserved for IBM SP switch and IBM Next Federation switch.
1.461 + */
1.462 +#define DLT_IBM_SP 145
1.463 +#define DLT_IBM_SN 146
1.464 +
1.465 +/*
1.466 + * Reserved for private use. If you have some link-layer header type
1.467 + * that you want to use within your organization, with the capture files
1.468 + * using that link-layer header type not ever be sent outside your
1.469 + * organization, you can use these values.
1.470 + *
1.471 + * No libpcap release will use these for any purpose, nor will any
1.472 + * tcpdump release use them, either.
1.473 + *
1.474 + * Do *NOT* use these in capture files that you expect anybody not using
1.475 + * your private versions of capture-file-reading tools to read; in
1.476 + * particular, do *NOT* use them in products, otherwise you may find that
1.477 + * people won't be able to use tcpdump, or snort, or Ethereal, or... to
1.478 + * read capture files from your firewall/intrusion detection/traffic
1.479 + * monitoring/etc. appliance, or whatever product uses that DLT_ value,
1.480 + * and you may also find that the developers of those applications will
1.481 + * not accept patches to let them read those files.
1.482 + *
1.483 + * Also, do not use them if somebody might send you a capture using them
1.484 + * for *their* private type and tools using them for *your* private type
1.485 + * would have to read them.
1.486 + *
1.487 + * Instead, ask "tcpdump-workers@tcpdump.org" for a new DLT_ value,
1.488 + * as per the comment above, and use the type you're given.
1.489 + */
1.490 +#define DLT_USER0 147
1.491 +#define DLT_USER1 148
1.492 +#define DLT_USER2 149
1.493 +#define DLT_USER3 150
1.494 +#define DLT_USER4 151
1.495 +#define DLT_USER5 152
1.496 +#define DLT_USER6 153
1.497 +#define DLT_USER7 154
1.498 +#define DLT_USER8 155
1.499 +#define DLT_USER9 156
1.500 +#define DLT_USER10 157
1.501 +#define DLT_USER11 158
1.502 +#define DLT_USER12 159
1.503 +#define DLT_USER13 160
1.504 +#define DLT_USER14 161
1.505 +#define DLT_USER15 162
1.506 +
1.507 +/*
1.508 + * For future use with 802.11 captures - defined by AbsoluteValue
1.509 + * Systems to store a number of bits of link-layer information
1.510 + * including radio information:
1.511 + *
1.512 + * http://www.shaftnet.org/~pizza/software/capturefrm.txt
1.513 + *
1.514 + * but it might be used by some non-AVS drivers now or in the
1.515 + * future.
1.516 + */
1.517 +#define DLT_IEEE802_11_RADIO_AVS 163 /* 802.11 plus AVS radio header */
1.518 +
1.519 +/*
1.520 + * Juniper-private data link type, as per request from
1.521 + * Hannes Gredler <hannes@juniper.net>. The DLT_s are used
1.522 + * for passing on chassis-internal metainformation such as
1.523 + * QOS profiles, etc..
1.524 + */
1.525 +#define DLT_JUNIPER_MONITOR 164
1.526 +
1.527 +/*
1.528 + * Reserved for BACnet MS/TP.
1.529 + */
1.530 +#define DLT_BACNET_MS_TP 165
1.531 +
1.532 +/*
1.533 + * Another PPP variant as per request from Karsten Keil <kkeil@suse.de>.
1.534 + *
1.535 + * This is used in some OSes to allow a kernel socket filter to distinguish
1.536 + * between incoming and outgoing packets, on a socket intended to
1.537 + * supply pppd with outgoing packets so it can do dial-on-demand and
1.538 + * hangup-on-lack-of-demand; incoming packets are filtered out so they
1.539 + * don't cause pppd to hold the connection up (you don't want random
1.540 + * input packets such as port scans, packets from old lost connections,
1.541 + * etc. to force the connection to stay up).
1.542 + *
1.543 + * The first byte of the PPP header (0xff03) is modified to accomodate
1.544 + * the direction - 0x00 = IN, 0x01 = OUT.
1.545 + */
1.546 +#define DLT_PPP_PPPD 166
1.547 +
1.548 +/*
1.549 + * Names for backwards compatibility with older versions of some PPP
1.550 + * software; new software should use DLT_PPP_PPPD.
1.551 + */
1.552 +#define DLT_PPP_WITH_DIRECTION DLT_PPP_PPPD
1.553 +#define DLT_LINUX_PPP_WITHDIRECTION DLT_PPP_PPPD
1.554 +
1.555 +/*
1.556 + * Juniper-private data link type, as per request from
1.557 + * Hannes Gredler <hannes@juniper.net>. The DLT_s are used
1.558 + * for passing on chassis-internal metainformation such as
1.559 + * QOS profiles, cookies, etc..
1.560 + */
1.561 +#define DLT_JUNIPER_PPPOE 167
1.562 +#define DLT_JUNIPER_PPPOE_ATM 168
1.563 +
1.564 +#define DLT_GPRS_LLC 169 /* GPRS LLC */
1.565 +#define DLT_GPF_T 170 /* GPF-T (ITU-T G.7041/Y.1303) */
1.566 +#define DLT_GPF_F 171 /* GPF-F (ITU-T G.7041/Y.1303) */
1.567 +
1.568 +/*
1.569 + * Requested by Oolan Zimmer <oz@gcom.com> for use in Gcom's T1/E1 line
1.570 + * monitoring equipment.
1.571 + */
1.572 +#define DLT_GCOM_T1E1 172
1.573 +#define DLT_GCOM_SERIAL 173
1.574 +
1.575 +/*
1.576 + * Juniper-private data link type, as per request from
1.577 + * Hannes Gredler <hannes@juniper.net>. The DLT_ is used
1.578 + * for internal communication to Physical Interface Cards (PIC)
1.579 + */
1.580 +#define DLT_JUNIPER_PIC_PEER 174
1.581 +
1.582 +/*
1.583 + * Link types requested by Gregor Maier <gregor@endace.com> of Endace
1.584 + * Measurement Systems. They add an ERF header (see
1.585 + * http://www.endace.com/support/EndaceRecordFormat.pdf) in front of
1.586 + * the link-layer header.
1.587 + */
1.588 +#define DLT_ERF_ETH 175 /* Ethernet */
1.589 +#define DLT_ERF_POS 176 /* Packet-over-SONET */
1.590 +
1.591 +/*
1.592 + * Requested by Daniele Orlandi <daniele@orlandi.com> for raw LAPD
1.593 + * for vISDN (http://www.orlandi.com/visdn/). Its link-layer header
1.594 + * includes additional information before the LAPD header, so it's
1.595 + * not necessarily a generic LAPD header.
1.596 + */
1.597 +#define DLT_LINUX_LAPD 177
1.598 +
1.599 +/*
1.600 + * Juniper-private data link type, as per request from
1.601 + * Hannes Gredler <hannes@juniper.net>.
1.602 + * The DLT_ are used for prepending meta-information
1.603 + * like interface index, interface name
1.604 + * before standard Ethernet, PPP, Frelay & C-HDLC Frames
1.605 + */
1.606 +#define DLT_JUNIPER_ETHER 178
1.607 +#define DLT_JUNIPER_PPP 179
1.608 +#define DLT_JUNIPER_FRELAY 180
1.609 +#define DLT_JUNIPER_CHDLC 181
1.610 +
1.611 +/*
1.612 + * Multi Link Frame Relay (FRF.16)
1.613 + */
1.614 +#define DLT_MFR 182
1.615 +
1.616 +/*
1.617 + * Juniper-private data link type, as per request from
1.618 + * Hannes Gredler <hannes@juniper.net>.
1.619 + * The DLT_ is used for internal communication with a
1.620 + * voice Adapter Card (PIC)
1.621 + */
1.622 +#define DLT_JUNIPER_VP 183
1.623 +
1.624 +/*
1.625 + * Arinc 429 frames.
1.626 + * DLT_ requested by Gianluca Varenni <gianluca.varenni@cacetech.com>.
1.627 + * Every frame contains a 32bit A429 label.
1.628 + * More documentation on Arinc 429 can be found at
1.629 + * http://www.condoreng.com/support/downloads/tutorials/ARINCTutorial.pdf
1.630 + */
1.631 +#define DLT_A429 184
1.632 +
1.633 +/*
1.634 + * Arinc 653 Interpartition Communication messages.
1.635 + * DLT_ requested by Gianluca Varenni <gianluca.varenni@cacetech.com>.
1.636 + * Please refer to the A653-1 standard for more information.
1.637 + */
1.638 +#define DLT_A653_ICM 185
1.639 +
1.640 +/*
1.641 + * Controller Area Network (CAN) v. 2.0B packets.
1.642 + * DLT_ requested by Gianluca Varenni <gianluca.varenni@cacetech.com>.
1.643 + * Used to dump CAN packets coming from a CAN Vector board.
1.644 + * More documentation on the CAN v2.0B frames can be found at
1.645 + * http://www.can-cia.org/downloads/?269
1.646 + */
1.647 +#define DLT_CAN20B 190
1.648 +
1.649 +
1.650 +/*
1.651 + * The instruction encodings.
1.652 + */
1.653 +/* instruction classes */
1.654 +#define BPF_CLASS(code) ((code) & 0x07)
1.655 +#define BPF_LD 0x00
1.656 +#define BPF_LDX 0x01
1.657 +#define BPF_ST 0x02
1.658 +#define BPF_STX 0x03
1.659 +#define BPF_ALU 0x04
1.660 +#define BPF_JMP 0x05
1.661 +#define BPF_RET 0x06
1.662 +#define BPF_MISC 0x07
1.663 +
1.664 +/* ld/ldx fields */
1.665 +#define BPF_SIZE(code) ((code) & 0x18)
1.666 +#define BPF_W 0x00
1.667 +#define BPF_H 0x08
1.668 +#define BPF_B 0x10
1.669 +#define BPF_MODE(code) ((code) & 0xe0)
1.670 +#define BPF_IMM 0x00
1.671 +#define BPF_ABS 0x20
1.672 +#define BPF_IND 0x40
1.673 +#define BPF_MEM 0x60
1.674 +#define BPF_LEN 0x80
1.675 +#define BPF_MSH 0xa0
1.676 +
1.677 +/* alu/jmp fields */
1.678 +#define BPF_OP(code) ((code) & 0xf0)
1.679 +#define BPF_ADD 0x00
1.680 +#define BPF_SUB 0x10
1.681 +#define BPF_MUL 0x20
1.682 +#define BPF_DIV 0x30
1.683 +#define BPF_OR 0x40
1.684 +#define BPF_AND 0x50
1.685 +#define BPF_LSH 0x60
1.686 +#define BPF_RSH 0x70
1.687 +#define BPF_NEG 0x80
1.688 +#define BPF_JA 0x00
1.689 +#define BPF_JEQ 0x10
1.690 +#define BPF_JGT 0x20
1.691 +#define BPF_JGE 0x30
1.692 +#define BPF_JSET 0x40
1.693 +#define BPF_SRC(code) ((code) & 0x08)
1.694 +#define BPF_K 0x00
1.695 +#define BPF_X 0x08
1.696 +
1.697 +/* ret - BPF_K and BPF_X also apply */
1.698 +#define BPF_RVAL(code) ((code) & 0x18)
1.699 +#define BPF_A 0x10
1.700 +
1.701 +/* misc */
1.702 +#define BPF_MISCOP(code) ((code) & 0xf8)
1.703 +#define BPF_TAX 0x00
1.704 +#define BPF_TXA 0x80
1.705 +
1.706 +/*
1.707 + * The instruction data structure.
1.708 + */
1.709 +struct bpf_insn {
1.710 + u_short code;
1.711 + u_char jt;
1.712 + u_char jf;
1.713 + bpf_int32 k;
1.714 +};
1.715 +
1.716 +/*
1.717 + * Macros for insn array initializers.
1.718 + */
1.719 +#define BPF_STMT(code, k) { (u_short)(code), 0, 0, k }
1.720 +#define BPF_JUMP(code, k, jt, jf) { (u_short)(code), jt, jf, k }
1.721 +
1.722 +#if __STDC__ || defined(__cplusplus)
1.723 +extern int bpf_validate(struct bpf_insn *, int);
1.724 +extern u_int bpf_filter(struct bpf_insn *, u_char *, u_int, u_int);
1.725 +#else
1.726 +extern int bpf_validate();
1.727 +extern u_int bpf_filter();
1.728 +#endif
1.729 +
1.730 +/*
1.731 + * Number of scratch memory words (for BPF_LD|BPF_MEM and BPF_ST).
1.732 + */
1.733 +#define BPF_MEMWORDS 16
1.734 +
1.735 +#ifdef __cplusplus
1.736 +}
1.737 +#endif
1.738 +
1.739 +#endif