dect
/
libpcap
Archived
13
0
Fork 0
Commit Graph

36 Commits

Author SHA1 Message Date
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
guy 98a503e843 Improved VLAN support, from Peter Jeremy - "vlan" filtering keyword,
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-10-22 04:15:55 +00:00
guy c8c2e7e65b Token Ring support, from various patches. Also add "tr" as an alias for
"ether", "fddi", "link", etc..
2000-07-25 05:50:08 +00:00
guy 0d0297bdd1 Older versions of Flex (e.g., 2.5.2, which at least one user had) dump
core if the YY_FLUSH_BUFFER macro is called when there's no current
buffer (e.g., before any scanning has been done).

So, instead, when using Flex, we use "yy_scan_string()" to specify that
the scanner should read from the filter expression string, rather than
defining our own YY_INPUT macro, and we add a "lex_cleanup()" routine,
called after parsing is complete, to delete the buffer allocated by
"yy_scan_string()", which arranges that, when we next hand the scanner a
string, it doesn't then return to the parser cruft left over from the
previous parse.
2000-07-13 06:51:56 +00:00
assar 0e2f8c8892 add config.h, remove gnuc.h. remove __dead 2000-07-11 00:37:04 +00:00
assar 06d84775e0 (lex_init): call YY_FLUSH_BUFFER when using flex. From Guy Harris
<gharris@flashcom.net>
2000-06-10 14:42:27 +00:00
assar 3417c26e0c add %n 2000 to make it acceptable to lex. From Rick Jones <raj@cup.hp.com> 2000-03-31 16:59:07 +00:00
mcr dd89824a8b patch to compile on AIX 2000-01-25 03:21:29 +00:00
assar 3c8d26ffc4 add some parameters to help old lexes in handling this file 1999-11-17 04:09:58 +00:00
itojun 03464b3109 * libpcap/scanner.l: make IPv6 parsing more strict.
this makes arp[0:1] to work again ("0:1" was mistakingly
  considered as IPv6 address).  Uses very ugly regex...
1999-11-09 12:19:22 +00:00
itojun 5b7ead9173 add configure option --disable-protochain, to make Arne happier. 1999-11-01 15:56:40 +00:00
itojun 7fe3c1111a IPv6 packet filtering code.
./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
1999-10-19 15:18:28 +00:00
mcr b11ddf8a9b Initial revision 1999-10-07 23:46:40 +00:00