aboutsummaryrefslogtreecommitdiffstats
path: root/scanner.l
AgeCommit message (Collapse)AuthorFilesLines
2010-01-27Include headers that should cause u_int64_t to be defined.Guy Harris1-0/+14
2009-05-24If we have lex but not flex, we assign a "const char *" to "in_buffer";Guy Harris1-1/+1
make it a "const char *" as well.
2009-04-18From Robert Edmonds: in the lexical analyzer, free up any addrinfoGuy Harris1-0/+1
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.
2008-02-06From Arien Vijn: support various notions for MAC addresses.guy1-3/+8
2007-11-18Support OpenBSD's "addr1", "addr2", "addr3", and "addr4" link-layerguy1-1/+6
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-06-11Pick up changes from NetBSD:guy1-2/+2
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-03-11From Sepherosa Ziehau: additional filter operations for 802.11 frameguy1-1/+4
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-02-08From Florent Drouin: a Link Status Signal Unit is called an LSSU, not anguy1-2/+3
LSU. (Leave "lsu" as an alias for backwards compatibility.)
2006-12-21From Florent Drouin: add support for filtering on MTP2 frame types.guy1-1/+4
2006-10-04Put the public libpcap headers into a pcap subdirectory in both theguy1-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.
2005-11-09Previous change was applied by hand, and deleted one line. Put thatguy1-1/+2
line back.
2005-11-08From Rick Jones: crank up some limits so the HP-UX lex can handle thisguy1-7/+6
file.
2005-09-05Add "pppoed" and "pppoes" keywords, for PPPoE Discovery and Sessionguy1-1/+3
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-06-20From Gilbert Hoyek <gil_hoyek@hotmail.com>: support for capturing SS7guy1-1/+6
traffic on Intel Septel cards, and for filtering on SS7 MTP3 fields. Clean up indentation.
2005-05-02Make "link[N:M]" refer to the 802.11 header for all 802.11 DLT_ values,guy1-1/+2
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-04-19From Patrick Marie <mycroft@virgaria.org>: add support for port rangesguy1-1/+2
in tests - "portrange X-Y" matches all ports in the range [X,Y]. Support added for port ranges with IPv6. Fix some comments.
2004-06-16add baseline support for MPLS protocol and per-label filteringhannes1-1/+2
2004-03-28Handle the new OpenBSD pf format (DLT 117), which is now being usedfenner1-1/+3
by other systems as they adopt pf. Don't bother trying to be backwards compatible with DLT 17.
2003-12-16On Mac OS X 10.3, including <sys/socket.h> eventually drags in a headerguy1-2/+2
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-11-15Add _U_ to "rcsid[]" definitions, to eliminate "unused variable"guy1-2/+2
warnings from newer versions of GCC.
2003-07-03As per a suggestion by Alex Medvedev, boost %a to 16000 to let AIX 5.2'sguy1-2/+2
Lex handle scanner.l.
2003-03-11Add support for OpenBSD DLT_PFLOG.guy1-1/+6
Get rid of bogus newline in BPF error string.
2003-03-08Boost some table sizes even more, as the HP-UX lex requires it.guy1-2/+2
2003-02-08From Gisle Vanem <giva@bgnett.no>: treat CR as white space inguy1-2/+2
expressions.
2002-12-06add BPF_ filters for misc. IS-IS PDU Typeshannes1-1/+9
2002-08-08Add support for operations that test 802.11 SA or DA fields, and forguy1-2/+2
"wlan" as an alias for "link".
2002-08-02Use <pcap-stdinc.h> only on Windows; on UNIX, selectively include, inguy1-1/+6
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-01Added support for Win32, based on WinPcap.risso1-4/+8
2002-07-27Set the correct member of a YYSTYPE for an IPv6 address - it's returnedguy1-2/+2
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-11Add SunATM support, based on code from Yen Yen Lim at North Dakota Stateguy1-1/+16
University.
2002-06-29Boost some table sizes to make it possible for the HP-UX 11i lex (andguy1-3/+3
possibly other lexes) to handle it.
2002-04-09<pcap.h> includes <sys/types.h>, and "pcap-int.h" includes <pcap.h>, andguy1-3/+1
"scanner.l" includes "pcap-int.h", so there's no need to include <sys/types.h> in "scanner.l".
2002-04-09<pcap.h> include <sys/time.h>, and "pcap-int.h" includes <pcap.h>, soguy1-3/+1
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-07Include <netdb.h> before <pcap-namedb.h>, as <netdb.h> is included toguy1-4/+4
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>.
2001-09-14Revert to catching only bogus ethernet addresses that end in a colon,fenner1-2/+2
since the updated expression caught the "4:2" in "ip[4:2]".
2001-08-20The rev 1.79 commit somehow undid the changes from 1.75.fenner1-1/+25
Put them back.
2001-08-20Fix some lexer bugs:fenner1-29/+5
- 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-05-30Allow "ip6 proto ___" constructs.fenner1-3/+15
Don't parse "ip6" if not compiled with ip6 support.
2001-05-10SCTP support from Armando L. Caro Jr. <acaro@mail.eecis.udel.edu>fenner1-1/+2
2001-04-17ARCNet support, from NetBSD.guy1-1/+3
2001-02-24 added english versions of many common fields (from thorpej)mcr1-1/+25
2001-02-21Patch from NetBSD, by Klaus Klein <kleink@netbsd.org>, to support "vrrp"guy1-1/+2
as an IP protocol, like "udp", "tcp", "icmp", "pim", etc..
2001-01-28Add a "netbeui" keyword, which selects NetBEUI packets (LLC packets withguy1-1/+3
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-14Add "ipx", which checks for the LLC SAP for IPX as well as, on Ethernet,guy1-1/+3
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-14Support checking for protocols specified by an LLC SAP on FDDI, Tokenguy1-1/+3
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.
2000-10-28Allow "clnp", as well as "esis" and "isis", as OSI protocols for whichguy1-1/+2
we can check.
2000-10-28Tony Li's changes, from FreeBSD, to support filtering for OSI packetsguy1-1/+7
and for ESIS and ISIS packets.
2000-10-28Patch from Monroe Williams <monroe@pobox.com>, submitted with NetBSD PRguy1-1/+2
#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-22Improved VLAN support, from Peter Jeremy - "vlan" filtering keyword,guy1-1/+3
letting you filter based on the VLAN to which a packet belongs, and an improvement to the printing of VLAN packets (adding an extra space to separate the VLAN priority and flags from the next stuff printed).
2000-07-25Token Ring support, from various patches. Also add "tr" as an alias forguy1-2/+2
"ether", "fddi", "link", etc..