dect
/
libpcap
Archived
13
0
Fork 0
Commit Graph

62 Commits

Author SHA1 Message Date
Gianluca Varenni cc1a80e41e Fixes to compile WinPcap under MINGW32 and MINGW64. 2010-10-15 01:42:59 -07:00
Guy Harris cc7b2f2e42 Add support for "wlan ra" and "wlan ta".
The RA field is absent from management frames (addr1 is DA there), and
addr1 in other frames.

The TA field is absent from management frames (addr2 is SA there), and
addr2, if present, in other frames.

While we're at it, fix a font glitch in the pcap-filter man page.
2010-07-03 13:15:01 -07:00
Guy Harris 1f436f90eb Include headers that should cause u_int64_t to be defined. 2010-01-27 00:56:18 -08:00
Guy Harris 34d7963f7e If we have lex but not flex, we assign a "const char *" to "in_buffer";
make it a "const char *" as well.
2009-05-24 13:22:03 -07:00
Guy Harris 664e4a16bb From Robert Edmonds: in the lexical analyzer, free up any addrinfo
structure we got back from getaddrinfo().

Plug some other getaddrinfo() leaks while we're at it.

Fail if you try to use "gateway" on ATM if we're not checking for ATM
LANE.
2009-04-18 13:53:52 -07:00
guy f8f7ec5ace From Arien Vijn: support various notions for MAC addresses. 2008-02-06 10:21:30 +00:00
guy 740fb4355d Support OpenBSD's "addr1", "addr2", "addr3", and "addr4" link-layer
address types for 802.11.

Support the OpenBSD names for some of the 802.11 frame types.

Support OpenBSD's "dir" keyword for 802.11 frame directions.
2007-11-18 02:03:52 +00:00
guy a6186fa56d Pick up changes from NetBSD:
several files:

	date: 2006/02/27 15:53:24;  author: drochner;  state: Exp;
	avoid shadowing globals, for WARNS=2

	date: 2006/02/27 15:55:30;  author: drochner;  state: Exp;
	minor constification, good for WARNS=3 now

	date: 2006/02/27 15:57:17;  author: drochner;  state: Exp;
	NetBSD adaption:

		...

	-const pcap_strerror() for consistency


    gencode.c:

	date: 2006/04/26 09:24:33;  author: tron;  state: Exp;
	Add missing "const" keywords to match declarations in "pcap.h".

	date: 2006/10/15 19:27:21;  author: christos;  state: Exp;
	add a volatile variable to prevent vfork/longjmp clobbering.

    optimize.c:

	date: 2006/05/17 17:48:36;  author: drochner;  state: Exp;
	Make the optimizer use unsigned numbers as the kernel does.
	While it is not agreed on that purely unsigned arithmetics is nice,
	different behaviour of optimized and unoptimized code is less desirable.

    pcap-bpf.c:

	date: 2006/02/27 15:51:38;  author: drochner;  state: Exp;
	pull in from NetBSD's libpcap: use cloning bpf device on NetBSD

Have the configure script check for paths.h, so that we can include it
only if we have it, and use the cloning BPF device only if we're on
NetBSD *and* _PATH_BPF is defined (hopefully this will keep us from
using it on versions of NetBSD that don't have a cloning BPF device; if,
in the future, other OSes with BPF get cloning BPF devices, we can make
this work for them as well).
2007-06-11 10:04:24 +00:00
guy 885670183d From Sepherosa Ziehau: additional filter operations for 802.11 frame
types.  Modified to add ieee80211.h from FreeBSD, rather than depending
on the OS supplying the header, and to support all 802.11 radio header
types.

Clean up some link-layer type checks and the messages for failing those
checks.
2007-03-11 04:35:23 +00:00
guy d02424cd4c From Florent Drouin: a Link Status Signal Unit is called an LSSU, not an
LSU.  (Leave "lsu" as an alias for backwards compatibility.)
2007-02-08 07:15:27 +00:00
guy 7589e0abc3 From Florent Drouin: add support for filtering on MTP2 frame types. 2006-12-21 19:44:06 +00:00
guy 084bcf12ea Put the public libpcap headers into a pcap subdirectory in both the
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.
2006-10-04 18:09:21 +00:00
guy 907283b793 Previous change was applied by hand, and deleted one line. Put that
line back.
2005-11-09 23:49:30 +00:00
guy f33fbd4b19 From Rick Jones: crank up some limits so the HP-UX lex can handle this
file.
2005-11-08 02:32:55 +00:00
guy 7fb15ab846 Add "pppoed" and "pppoes" keywords, for PPPoE Discovery and Session
packets (based on the Ethernet type).  "pppoes" has the side-effect that
subsequent filter expressions will test the PPP header and headers
in the PPP payload, not the link-layer header and headers in the
link-layer payload.
2005-09-05 09:06:58 +00:00
guy a0a4852137 From Gilbert Hoyek <gil_hoyek@hotmail.com>: support for capturing SS7
traffic on Intel Septel cards, and for filtering on SS7 MTP3 fields.

Clean up indentation.
2005-06-20 21:27:07 +00:00
guy 875df1a937 Make "link[N:M]" refer to the 802.11 header for all 802.11 DLT_ values,
including those with fixed-length radio headers (it already refers to
the 802.11 header for radiotap).

Add a new "radio" keyword, to allow access to the radio header.  In
theory, something to allow testing for specific signal strengths, etc.
might be useful, but radiotap makes that difficult as the code can't
loop through the header looking for the signal strength field, the loop
has to be unrolled, and some of the other headers might not have
standardized the meaning of some of the fields, so we require the user
to construct such a filter themselves, for now.
2005-05-02 21:13:08 +00:00
guy 97a8e5112d From Patrick Marie <mycroft@virgaria.org>: add support for port ranges
in tests - "portrange X-Y" matches all ports in the range [X,Y].

Support added for port ranges with IPv6.

Fix some comments.
2005-04-19 04:25:00 +00:00
hannes 405ab1a931 add baseline support for MPLS protocol and per-label filtering 2004-06-16 08:20:28 +00:00
fenner 8177eec7d9 Handle the new OpenBSD pf format (DLT 117), which is now being used
by other systems as they adopt pf.
Don't bother trying to be backwards compatible with DLT 17.
2004-03-28 20:27:12 +00:00
guy 9aa42d6e5c On Mac OS X 10.3, including <sys/socket.h> eventually drags in a header
file that defines MASK, so when compiling the lexical analyzer, if INET6
is defined you get a redefinition warning.  Use NETMASK rather than MASK
for the token "mask".
2003-12-16 05:19:56 +00:00
guy 30e89f192a Add _U_ to "rcsid[]" definitions, to eliminate "unused variable"
warnings from newer versions of GCC.
2003-11-15 23:23:57 +00:00
guy 69c370ff8a As per a suggestion by Alex Medvedev, boost %a to 16000 to let AIX 5.2's
Lex handle scanner.l.
2003-07-03 18:39:10 +00:00
guy 23d8b7205b Add support for OpenBSD DLT_PFLOG.
Get rid of bogus newline in BPF error string.
2003-03-11 06:23:52 +00:00
guy 39c13cd5ee Boost some table sizes even more, as the HP-UX lex requires it. 2003-03-08 05:53:11 +00:00
guy 52866495a0 From Gisle Vanem <giva@bgnett.no>: treat CR as white space in
expressions.
2003-02-08 19:27:00 +00:00
hannes bd4881668c add BPF_ filters for misc. IS-IS PDU Types 2002-12-06 00:01:33 +00:00
guy 949aa751a1 Add support for operations that test 802.11 SA or DA fields, and for
"wlan" as an alias for "link".
2002-08-08 08:22:45 +00:00
guy 309e386870 Use <pcap-stdinc.h> only on Windows; on UNIX, selectively include, in
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.
2002-08-02 03:44:19 +00:00
risso 6831542ec7 Added support for Win32, based on WinPcap. 2002-08-01 08:33:01 +00:00
guy 5b8139d3d4 Set the correct member of a YYSTYPE for an IPv6 address - it's returned
as a string, rather than as a binary address.  This removes a warning
from the Sun C compiler, although it probably doesn't change the
generated code (the "e" and "s" members of the union probably have the
same data representation and reside in the same part of the union; if
they didn't, the old code wouldn't have worked).
2002-07-27 18:41:23 +00:00
guy 243b20ec55 Add SunATM support, based on code from Yen Yen Lim at North Dakota State
University.
2002-07-11 09:06:30 +00:00
guy 1b2b4e620d Boost some table sizes to make it possible for the HP-UX 11i lex (and
possibly other lexes) to handle it.
2002-06-29 07:44:38 +00:00
guy 734ffc1c85 <pcap.h> includes <sys/types.h>, and "pcap-int.h" includes <pcap.h>, and
"scanner.l" includes "pcap-int.h", so there's no need to include
<sys/types.h> in "scanner.l".
2002-04-09 08:42:39 +00:00
guy 89c05cd79f <pcap.h> include <sys/time.h>, and "pcap-int.h" includes <pcap.h>, so
there's no need to include <sys/time.h> ourselves.

No UNIX-specific functions are used here, so there's no need to include
<unistd.h>.
2002-04-09 07:49:07 +00:00
guy da10d3ec7f Include <netdb.h> before <pcap-namedb.h>, as <netdb.h> is included to
define a structure used by <pcap-namedb.h>, and include <sys/socket.h>
before <netdb.h>, as <sys/socket.h> is included to define a structure
used by <netdb.h> (only a pointer to the first structure is used in
<pcap-namedb.h>, and only a pointer to the second structure is used by
<netdb.h>, so code will compile no matter which order you include them
in, but it's a bit cleaner to include <sys/socket.h> before <netdb.h>
and to include <netdb.h> before <pcap-namedb.h>).  Indicate why we're
including <netdb.h> and <sys/socket.h>.
2002-04-07 00:42:51 +00:00
fenner 9156c4fbfd Revert to catching only bogus ethernet addresses that end in a colon,
since the updated expression caught the "4:2" in "ip[4:2]".
2001-09-14 01:40:57 +00:00
fenner 6b8e18fa5a The rev 1.79 commit somehow undid the changes from 1.75.
Put them back.
2001-08-20 18:24:16 +00:00
fenner 144240e695 Fix some lexer bugs:
- Bad ethernet addresses no longer have to end with a colon
- Host names no longer have to be at least two characters long
- Bad tokens no longer have to end with an "i"
2001-08-20 18:17:29 +00:00
fenner c3d1fa6983 Allow "ip6 proto ___" constructs.
Don't parse "ip6" if not compiled with ip6 support.
2001-05-30 01:27:21 +00:00
fenner 283da6d726 SCTP support from Armando L. Caro Jr. <acaro@mail.eecis.udel.edu> 2001-05-10 14:48:01 +00:00
guy 38b97b7e84 ARCNet support, from NetBSD. 2001-04-17 08:25:21 +00:00
mcr 4ed17921a9 added english versions of many common fields (from thorpej) 2001-02-24 18:21:14 +00:00
guy cae3c555e6 Patch from NetBSD, by Klaus Klein <kleink@netbsd.org>, to support "vrrp"
as an IP protocol, like "udp", "tcp", "icmp", "pim", etc..
2001-02-21 09:33:03 +00:00
guy b0dcde29f7 Add a "netbeui" keyword, which selects NetBEUI packets (LLC packets with
0xf0 as the DSAP and SSAP).

Let "ipx" work on non-Ethernet 802.2 frames - we assume they're always
frames with the IPX DSAP.
2001-01-28 09:44:48 +00:00
guy d17596dbd9 Add "ipx", which checks for the LLC SAP for IPX as well as, on Ethernet,
for "Novell 802.3" frames, which are 802.3 frames (i.e., the type/length
field is a length field, i.e. it's <= ETHERMTU) with 0xFFFF as the first
2 bytes.  We don't yet check for ETHERTYPE_IPX as well.

When checking for OSI packets on Linux cooked captures, check for 802.2
frames by testing the packet type for LINUX_SLL_P_802_2 rather than by
checking whether the type field is <= ETHERMTU (it's always a type field
in DLT_LINUX_SLL captures).
2001-01-14 07:57:47 +00:00
guy 2b3dac284e Support checking for protocols specified by an LLC SAP on FDDI, Token
Ring, and RFC 1483-style ATM, as well as on Ethernet.

Support checking for LLC SAP protocols other than OSI protocols on
Ethernet - for now, we check only the DSAP on those, rather than
checking both the DSAP and SSAP as we do for OSI, as I think, in some
cases, the SSAP isn't the same as the DSAP.

When generating protocol type checks on link-layer types with no type
field, where packets are always IP (SLIP, BSD/OS SLIP, raw IP), generate
a "test" that always succeeds if the protocol being checked for is IP or
IPv6 and a "test" that always fails otherwise.  (We originally did
"gen_true()" if the protocol is IP, and bogusly generated code to check
the field at an offset of -1 otherwise; a subsequent change caused us
always to do "gen_true()", but that doesn't properly handle attempts to
check for other protocols - those attempts should generate code that
always fails, meaning that if you try to look for ARP packets in such a
capture the BPF compiler will return "expression rejects all packets" as
an error - and still generated extra code not all of which was removed
by the optimizer.  The current code generates no *more* BPF code.)

Add "stp", which checks for the LLC SAP for the Spanning Tree Protocol.
2001-01-14 04:34:51 +00:00
guy 195ad572d1 Allow "clnp", as well as "esis" and "isis", as OSI protocols for which
we can check.
2000-10-28 10:18:39 +00:00
guy af30d75a3e Tony Li's changes, from FreeBSD, to support filtering for OSI packets
and for ESIS and ISIS packets.
2000-10-28 09:30:20 +00:00
guy 54b2ab13c2 Patch from Monroe Williams <monroe@pobox.com>, submitted with NetBSD PR
#5228, to correctly check for Appletalk for EtherTalk phase II - they
use 802.3 with LLC SNAP packets, rather than D/I/X Ethernet packets.

His patch made "atalk" check for Appletalk ARP as well as other
Appletalk packets; I've instead added a separate "aarp" packet type,
leaving "atalk" checking only for ETHERTYPE_ATALK, so you can check for
ETHERTYPE_ATALK, ETHERTYPE_AARP, or both.
2000-10-28 08:19:29 +00:00