summaryrefslogtreecommitdiff
path: root/bpf
Commit message (Collapse)AuthorAgeFilesLines
* Put the public libpcap headers into a pcap subdirectory in both theguy2006-10-041-2/+2
| | | | | | | | source directory and the target include directory, and have include files at the top-level directory to include those headers, for backwards compatibility. Update the FILES and INSTALL.txt files to reflect current reality.
* Add _U_ to "rcsid[]" definitions, to eliminate "unused variable"guy2003-11-151-2/+2
| | | | warnings from newer versions of GCC.
* Note that if this is ever compiled on a SuperH platform where LBL_ALIGNguy2003-03-221-1/+3
| | | | | | is not defined by the configure or build procedure, e.g. building for WinCE SuperH, this probably won't work, as it'll assume unaligned accesses are OK.
* Include "config.h", so that LBL_ALIGN is defined as appropriate, and addguy2003-02-231-2/+11
| | | | | | "__arm__" to the list of #defines we check for if LBL_ALIGN isn't defined, so that on ARM we assume unaligned accesses are unsafe (which they are, on at least some ARM processors).
* From Shaun <delius@progsoc.uts.edu.au>: on AIX, load the BPF driver andguy2003-02-112-518/+2
| | | | | | | | | | create the BPF device nodes if necessary, and rename our "bpf.h" to "pcap-bpf.h" and install it in "/usr/include", so that "pcap-bpf.c" gets the system's bpf.h file if it includes <net/bpf.h> - on AIX, it needs to get an AIX-specific structure from that header in order to support loading the driver and creating the nodes. Update "packaging/pcap.spec".
* From Peter Fales <peter@fales-lorenz.net>: support for Linux ARCNET,guy2003-01-231-3/+3
| | | | | | | | | | | which supplies different headers from BSD ARCNET, and fixes to the ARCNET code generator (the protocol ID field is 1 byte, so the values for it shouldn't be byte-swapped). Whitespace cleanups. The "NetBSD-style" ARCNET headers are used in other BSDs as well, so just call them "BSD-style".
* Add DLT_ARCNET_LINUX and LINKTYPE_ARCNET_LINUX; the link-layer headersguy2003-01-211-2/+15
| | | | | | | | | supplied by Linux's ARCNET code aren't the same as the ones supplied by NetBSD's ARCNET code. Fix up some LINKTYPE_ values to match the corresponding DLT_ values. (There is no released version of libpcap/tcpdump that supports their previous values.)
* Oops - fix a typo.guy2003-01-101-3/+3
|
* Test both for "sparc" and "__sparc__" in the case where LBL_ALIGN isn'tguy2003-01-101-2/+2
| | | | | | defined - Debian bug 171210 says that "sparc" isn't defined by GCC, which presumably means "with the compiler we're using on Debian" as there are versions of GCC that *do* define "sparc" on SPARC.
* from Chris Waters chris.waters[AT]networkchemistry.com:hannes2002-12-261-1/+11
| | | | | reserve DLT and LINKTYPE for the Tazmen Sniffer Protocol (TZSP).
* Add new DLT_ type for AVS's WLAN header.guy2002-12-111-3/+13
|
* Add support for RFC 2625 IP-over-Fibre Channel, mapping all the Linuxguy2002-10-181-3/+2
| | | | ARPHRD_FC* types to it.
* Reserved as per request from Kent Dahlgren <kent@praesum.com> for private usehannes2002-10-091-1/+10
|
* Use <pcap-stdinc.h> only on Windows; on UNIX, selectively include, inguy2002-08-021-1/+14
| | | | | | | | | | | | | | | | | | | | | | each source file, only the headers that file needs, and all the headers it needs in order to compile on various platforms and not to get any avoidable compiler warnings on those platforms (as well as any incomplete structure definitions needed to avoid those warnings). That also means that <pcap.h> doesn't include <pcap-stdinc.h> on UNIX; we don't want it to include <pcap-stdinc.h>, at least on UNIX, as doing so 1) would mean we'd have to install that, so that programs can build with libpcap and 2) would mean that programs including <pcap.h> would drag in a bunch of header files that they don't need. Put a newline at the end of "inet.c" - the Sun C compiler doesn't like it if the last line doesn't end with a newline.
* Added support for Win32, based on WinPcap.risso2002-08-011-5/+2
|
* Add SunATM support, based on code from Yen Yen Lim at North Dakota Stateguy2002-07-111-2/+13
| | | | University.
* Add support for Frame Relay as a link-layer type; the header is theguy2002-07-111-4/+5
| | | | standard Q.922 Frame Relay header with a 2-byte address field.
* whitespace cleanupitojun2002-06-111-18/+18
|
* We'd already reserved 107 for Frame Relay; use that instead of a newguy2002-06-071-10/+12
| | | | value.
* Reserve a DLT_ value for Frame Relay, and map BSD/OS's DLT_FR to it.guy2002-06-071-1/+7
|
* Reserve a DLT_ value for capturing on Solaris with SunATM.guy2002-06-061-1/+6
|
* Don Lee was doing IP-over-FC, with the link-layer header from theguy2002-04-201-4/+9
| | | | | | | capture device having only an RFC 2625 Network_Header field, not a Fibre Channel frame header; rename the constants to emphasize this and to leave room for another "raw Fibre Channel" link-layer type, if it's ever needed.
* Throw inguy2002-04-201-2/+10
| | | | | | | | | | | | | | | | | #ifdef __cplusplus extern "C" { #endif and change #if __STDC__ to #if __STDC__ || defined(__cplusplus) around the non-kernel function prototypes, so they work right when compiling with C++.
* Add a DLT_ value for Fibre Channel, as per a request from Don Leeguy2002-03-081-1/+7
| | | | <donlee@cray.com>.
* Link-layer type 121 reserved for Siemens HiPath HDLC, as per a requestguy2002-01-251-1/+6
| | | | from Tomas Kukosa <tomas.kukosa@anfdata.cz>.
* #ifdef to work around NetBSD dlt.h problem.mcr2002-01-221-1/+8
|
* Reserve link-layer types for Prism II 802.11 chip monitor modeguy2001-11-281-1/+14
| | | | | | information plus 802.11 header (as per Tim Newsham's stuff) and for some flavor of Aironet 802.11 link-layer header (as per Doug Ambrisko's FreeBSD patches).
* Reserve DLT_ type 118 for Cisco internal use, as per a request fromguy2001-11-021-8/+16
| | | | | | Gilbert Ramirez of Cisco. More explicitly reserve 116 and 117 as well.
* Reserve 116 for IP Filter capture files and 117 for OpenBSD DLT_PFLOG.guy2001-09-091-3/+14
|
* LINKTYPE_IEEE802_11 and LINKTYPE_LOOP, and DLT_IEEE802_11, are no longerguy2001-09-091-11/+7
| | | | | | | | | | reserved for future use; they're being used. Move other currently-being-used LINKTYPE_ values above the "reserved for future use" comment, to make it clear which types are reserved and which are already in use. Note that 100 through 103 shouldn't be used for new DLT_ types.
* Add a DLT_ value and a link-layer type value for savefiles for Acornguy2001-09-051-1/+6
| | | | Econet.
* DLT_ value and capture file header LINKTYPE_ value reserved for Appleguy2001-06-051-1/+6
| | | | LocalTalk hardware.
* Add support for NetBSD DLT_PPP_ETHER, as per the NetBSD libpcap.guy2001-04-171-4/+5
|
* Add support for a new link layer type DLT_LINUX_SLL, for use when doingguy2000-12-211-2/+7
| | | | | | | | | | | | live captures with a "cooked" (SOCK_DGRAM) rather than a "raw" (SOCK_RAW) PF_PACKET socket; it includes a bunch of the fields from the "struct sockaddr_ll" you get in a "recvfrom()", including the Ethernet protocol field. This requires us to rewrite the BPF program if we're stuffing it into the kernel; as long as we're doing *ex post facto* rewriting, we might as well also do the "ret <snaplen>" -> "ret 65535" fixup there as well, rather than in the code generator.
* Use 50, not 113, for the link layer type in NetBSD DLT_PPP_SERIALguy2000-12-161-2/+2
| | | | | capture files; NetBSD uses 50, and, hopefully, nobody else will use 50 for something else.
* Handle DLT_NULL correctly - the AF_ value is in host byte order, whichguy2000-12-161-2/+27
| | | | | | | | | | | | | means that we should "htonl()" it before using it in BPF expressions *but*, if we're reading a capture file from a machine with the opposite byte order from ours, we should byte-swap it before "htonl()"ing it. Handle OpenBSD DLT_LOOP as well - it's like DLT_NULL except that the AF_ value is in *network* byte order. Don't support checking for inbound or outbound packets except on those data link types that supply an inbound/outbound qualifier (DLT_SLIP and DLT_PPP) - this came from OpenBSD's libpcap, delta 1.12 to "gencode.c".
* Add a DLT_IEEE802_11 for use by any platform that provides raw 802.11guy2000-11-151-1/+13
| | | | | | link-layer headers on capture. (Nothing uses it yet, but hopefully this will make it less likely that they'll use different DLT_ names or values.)
* Eliminate __P().fenner2000-10-231-2/+1
|
* Get rid of the PCAP_ENCAP_ values - if an application uses them, thatguy2000-10-121-26/+46
| | | | | | | | | | | | | | | | | | application won't build with any other version of libpcap, which means that a lot of applications won't use them. In addition, "pcap_linktype()" needs to return DLT_ values, so that platforms that build libpcap as a shared library won't break binary compatibility if they update to this version of libpcap. Instead, we map from DLT_ values to LINKTYPE_ values when writing savefiles, and map from LINKTYPE_ values to DLT_ values when reading savefiles, so that savefiles don't have platform-dependent DLT_ values in the header as the link type, they have platform-independent LINKTYPE_ values. This means we don't need to make DLT_ATM_RFC1483, DLT_RAW, etc. have platform-independent values starting at 100 - only the values in the savefile header need to be like that.
* Introduce a set of PCAP_ENCAP_ codes to specify packet encapsulations.guy2000-09-171-9/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For those PCAP_ENCAP_ codes corresponding to DLT_ codes that are (believed to be) the same in all BSDs, the PCAP_ENCAP_ codes have the same values as the corresponding DLT_ codes. For those PCAP_ENCAP_ codes corresponding to DLT_ codes that were added in libpcap 0.5 as "non-kernel" DLT_ codes, or had their values changed in libpcap 0.5 in order to cope with the fact that those DLT_ codes have different values in different systems, the PCAP_ENCAP_ codes have the same values as the corresponding DLT_ codes. We add some additional PCAP_ENCAP_ codes to handle IEEE 802.11 (which currently has its link-layer information turned into an Ethernet header by at least some of the BSDs, but John Hawkinson at MIT wants to add a DLT_ value for 802.11 and pass up the full link-layer header) and the Classical IP encapsulation for ATM on Linux (which isn't always the same as DLT_ATM_RFC1483, from what I can tell, alas). "pcap-bpf.c" maps DLT_ codes to PCAP_ENCAP_ codes, so as not to supply to libpcap's callers any DLT_ codes other than the ones that have the same values on all platforms; it supplies PCAP_ENCAP_ codes for all others. In libpcap's "bpf/net/bpf.h", we define the DLT_ values that aren't the same on all platforms with the new values starting at 100 (to keep them out of the way of the values various BSDs might assign to them), as we did in 0.5, but do so only if they're not already defined; platforms with <net/bpf.h> headers that come with the kernel (e.g., the BSDs) should define them with the values that they have always had on that platform, *not* with the values we used in 0.5. (Code using this version of libpcap should check for the new PCAP_ENCAP_ codes; those are given the values that the corresponding DLT_ values had in 0.5, so code that checks for them will handle 0.5 libpcap files correctly even if the platform defines DLT_RAW, say, as something other than 101. If that code also checks for DLT_RAW - which means it can't just use a switch statement, as DLT_RAW might be defined as 101 if the platform doesn't itself define DLT_RAW with some other value - then it will also handle old DLT_RAW captures, as long as they were made on the same platform or on another platform that used the same value for DLT_RAW. It can't handle captures from a platform that uses that value for another DLT_ code, but that's always been the case, and isn't easily fixable.) The intent here is to decouple the values that are returned by "pcap_datalink()" and put into the header of tcpdump/libpcap save files from the DLT_ values returned by BIOCGDLT in BSD kernels, allowing the BSDs to assign values to DLT_ codes, in their kernels, as they choose, without creating more incompatibilities between tcpdump/libpcap save files from different platforms.
* make it compile under solaris and hp-uxassar2000-06-261-59/+72
| | | | | (bpf_filter): clarify comment From Darren Reed <darrenr@reed.wattle.id.au>
* handle both KERNEL and _KERNEL.assar2000-06-261-7/+21
| | | | | add prototypes for functions. From Darren Reed <darrenr@reed.wattle.id.au>
* IPv6 packet filtering code.itojun1999-10-191-4/+19
| | | | | | | | | | ./configure --enable-ipv6 (requires getaddrinfo(3) and getnameinfo(3)). TODO: make it work even without getaddrinfo(3) or getnameinfo(3) (or, tcpdump/configure.in should provide alternative version by AC_REPLACE_FUNCS) TODO: make IPv6 filtering code work by default TODO: make "protochain" friendly with optimization
* Initial revisionmcr1999-10-072-0/+796