dect
/
libpcap
Archived
13
0
Fork 0
Commit Graph

278 Commits

Author SHA1 Message Date
guy 380a3dbf49 From Scott Barron <sb125499@ohiou.edu>: use the
SOL_PACKET/PACKET_STATISTICS "getsockopt()" call, on Linux kernels that
support it, to get packet statistics, so that we can report the number
of dropped packets, and always use <linux/if_packet.h> to get
definitions for PF_PACKET sockets, so that we don't depend on glibc's
header files having been updated to support all the latest shiniest
kernel features (many systems with 2.4[.x] kernels don't have a
<netpacket/packet.h> that defines "struct tpacket_stats", for example,
so we wouldn't have been able to support that kernel feature on those
systems).
2001-07-29 18:25:46 +00:00
guy 11c1cf8ee2 Add comments to "pcap_stats()" indicating what the counters mean on the
various platforms (assuming the vendors' documentation is correct and
that I've correctly interpreted it).
2001-07-29 01:22:40 +00:00
guy a891a1d5d0 On AIX, if binding to the SAP 1537 fails, try binding to 0; Token Ring
devices appear to reject attempts to bind to 1537, perhaps because Token
Ring devices use SAPs rather than Ethertypes and 1537 isn't a valid SAP
value.

Try to supply a string rather than a numerical value for various DLPI
errors, and to supply a string rather than a numerical value for
unexpected DLPI primitives.

Cast the argument to <ctype.h> macros to "unsigned char", to eliminate
GCC warnings and to keep the macros from referring outside an array when
handed bytes with the 8th bit set.
2001-07-28 23:12:48 +00:00
guy b92ebafe8e Cast the argument to <ctype.h> macros to "unsigned char", to eliminate
GCC warnings and to keep the macros from referring outside an array when
handed bytes with the 8th bit set.
2001-07-28 22:56:34 +00:00
guy 7fd1de18e7 Add ENDT_SLIP, ENDT_PPP, ENDT_LOOPBACK, and ENDT_TRN to the case
statement checking the link-layer type.

Give an error if we see a link-layer type we don't handle, rather than
assuming Ethernet - there's no guarantee that the framing is Ethernet
framing.

If we succeeded in opening the packetfilter device, but had an error
later, close the device before returning from "pcap_open_live()".
2001-07-28 22:53:07 +00:00
guy 0c2cc33435 Fix a typo. 2001-07-04 07:34:50 +00:00
guy ca3fec5964 Fix a memory leak found by Miklos Szeredi
<Miklos.Szeredi@eth.ericsson.se> - "pcap_ether_aton()" allocates memory
for the MAC address, but we don't free it when we're done with it.

Code inspection revealed that there's a similar problem with
"pcap_ether_hostton()"; fix that as well.
2001-07-03 19:15:47 +00:00
guy db2a1d1e5e The "dl_module_id_1" and "dl_module_id_2" members of a
"dl_hp_ppa_info_t" are arrays of "u_char" (or "u_int8_t"), presumably to
get around the problems of signed characters; this causes complaints
from HP's C compiler if we pass them as an argument to "strcmp()", so
cast them to "const char *".
2001-06-27 05:22:44 +00:00
guy 70836ff6e9 Put a "return (0);" into "__pcap_nametodnaddr()" to squelch complaints
the Digital^H^H^H^H^H^H^HTru64 UNIX C compiler.
2001-06-27 05:11:48 +00:00
guy 7aa547ff09 Change from NetBSD, by Martin Husemann <martin@netbsd.org>:
Adapt to (temporary) DLT_PPP_ETHER useage by the pppoe code in tree
	now. This needs to be fixed when a generic PPP sheme is implemented.
2001-06-20 07:12:38 +00:00
itojun b63de9ed9e bsdi3 does not have IF_NAMESIZE (kame/bsdi3 has it). have last-resort #define. 2001-06-18 23:43:16 +00:00
guy 77d52cac81 Support for LocalTalk hardware, from Uns Lider <unslider@miranda.org>. 2001-06-18 08:46:28 +00:00
guy 6cd32e5cef 802.11 support, from Javier Achirica <achirica@ttd.net>. 2001-06-10 01:11:39 +00:00
guy 9f302b1f7f Support for capturing on encrypted CIPE tunnels in IRIX, from Franz
Schaefer <schaefer@mond.at>.
2001-06-05 03:48:41 +00:00
guy 8b26b4e6ef Documentation fixes from Chris Pepper <pepper@mail.reppep.com>.
Update the note on libpcap being "not very well suited for interactive
programs" to note that at least some of what it says is necessary is
already supported.
2001-06-05 03:45:53 +00:00
guy e83123b1eb DLT_ value and capture file header LINKTYPE_ value reserved for Apple
LocalTalk hardware.
2001-06-05 03:09:39 +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
guy 469dc3588b Put the code to get a unit number from a device name into a common
routine, and use it both on HP-UX and other DLPI systems; this means
that, in case there is ever a network device on HP-UX with a number in
the device type name, we'll properly extract the unit number (i.e.,
we'll extract the last number from the name, not the first number) - I
don't think that'll ever happen, but putting it into a common routine is
cleaner in any case.
2001-05-21 07:33:56 +00:00
guy 60673d8144 Patch from Xianjie Zhang <xzhang@cup.hp.com> to handle HP-UX systems
with a large number of PPA's.
2001-05-21 03:50:08 +00:00
guy c711e1de8d Patch from Stefan Hudson <hudson@mbay.net> to handle, on Solaris, device
class names with digits in them.
2001-05-21 03:35:04 +00:00
fenner 283da6d726 SCTP support from Armando L. Caro Jr. <acaro@mail.eecis.udel.edu> 2001-05-10 14:48:01 +00:00
mcr e1de1941ed newest config.guess and config.sub from ftp://sunsite.utk.edu/pub/gnu/ftp/config/ 2001-05-05 20:50:41 +00:00
mcr e5faebb3e7 RPM spec file 2001-05-05 00:57:33 +00:00
mcr 6da97d192d renamed INSTALL to INSTALL.txt 2001-05-05 00:57:10 +00:00
fenner 0cc259467a Allow pcap_open_live() to return warnings in ebuf. 2001-04-30 16:10:51 +00:00
guy 42f0938c7c Fix up the RCS ID, and put in a line indicating the NetBSD header file
we got this stuff from.
2001-04-24 02:17:52 +00:00
guy 38b97b7e84 ARCNet support, from NetBSD. 2001-04-17 08:25:21 +00:00
guy 80788ad380 Add support for NetBSD DLT_PPP_ETHER, as per the NetBSD libpcap. 2001-04-17 08:10:00 +00:00
guy 5522fb3b20 Update the version number. 2001-04-11 05:18:28 +00:00
guy 5f649f110e Patch from Marcus Felipe Pereira <marcus@task.com.br> to map ARPHRD_HDLC
to DLT_C_HDLC.

Arrange that if "map_arphrd_to_dlt()" supplies DLT_LINUX_SLL as the
link-layer DLT_ value, we capture in cooked mode.

Return DLT_LINUX_SLL for ARPHRD_PPP, as some PPP code in the kernel
supplies no link-layer header whatsoever to PF_PACKET sockets, other PPP
code supplies PPP link-layer headers ("syncppp.c"), and PPP-over-ISDN
appears to supply random link-layer headers (there's code in Ethereal,
for example, to cope with PPP-over-ISDN captures with which the Ethereal
developers have had to cope, heuristically trying to determine which of
the oddball link-layer headers particular packets have).
2001-04-09 05:55:39 +00:00
guy 15cc8e524f Fix the man page's description of "pcap_file()" and "pcap_fileno()" to
reflect reality.
2001-03-26 10:21:31 +00:00
guy 534381a041 Attempt to put the link-layer payload of packets on a 4-byte boundary,
as is done in some other "pcap-XXX.c" modules.
2001-03-20 05:50:33 +00:00
guy 67e19bff40 Add Jason Thorpe's name to the list of contributors. 2001-02-25 00:54:05 +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 bc0425f86c Patch from Onno van der Linden <onno@simplex.nl> to support Token Ring
on DLPI systems.
2001-02-21 09:07:40 +00:00
itojun ae09ab3412 ignore non-IP address. 2001-02-12 09:33:21 +00:00
guy fa4449caf2 Clarify what "pcap_next()" does, as per a suggestion by Michael T.
Stolarchuk.
2001-02-09 04:50:17 +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 e191909508 Pick up the "README.tru64" file from Ethereal, and change it to refer to
tcpdump, for the benefit of Digital^H^H^H^H^H^H^HTru64 UNIX users.
2001-01-24 06:52:52 +00:00
guy a6e177c611 Patch from Igor Khristophorov <igor@atdot.org> to handle adaptive SLIP
interfaces on Linux just like standard SLIP interfaces.
2001-01-20 07:47:53 +00:00
guy 1ae6bd52d5 Note that captures on the "any" device won't be done in promiscuous
mode, regardless of the value of "promisc".
2001-01-18 04:41:45 +00:00
guy fa766cfb0c Patch from Lorenzo Cavallaro <sullivan@sikurezza.org> to create
$(DESTDIR)/$(mandir)/man3 before installing the libpcap man page, if
that directory doesn't already exist.
2001-01-18 04:05:12 +00:00
guy 952a563412 Some platforms that lack <netpacket/packet.h> define PF_PACKET but don't
support PF_PACKET sockets, and, in particular, don't define in
<linux/if_packet.h> any of the stuff needed by the code to handle
PF_PACKET sockets.  Define HAVE_PF_PACKET_SOCKETS if either

	1) we have <netpacket/packet.h>

or

	2) PF_PACKET is defined *and* PACKET_HOST is defined by
	   <linux/if_packet.h>

and use HAVE_PF_PACKET_SOCKETS, not PF_PACKET, be what we use in #ifdefs
to conditionally compile in support for PF_PACKET sockets.

Not all platforms define ARPHRD_SIT, either; #define it if it's not
already defined.
2001-01-18 03:58:22 +00:00
guy 8a6db7a7d5 Sigh. Not all systems have <netinet/if_ether.h> - for example, at least
some libc5 Linux systems don't - so we have to check whether it exists,
and include it only if it does.
2001-01-17 18:18:48 +00:00
guy 9c3650645f At least some libc5 systems don't have <netinet/if_ether.h> but do have
<net/if_arp.h>, and the stuff we want is in <net/if_arp.h>, so include
that rather than <netinet/if_ether.h>.

At least some libc5 systems don't have <netpacket/packet.h>, but have a
<sys/socket.h> that includes <linux/socket.h>, and the latter defines
SO_ATTACH_FILTER if the kernel is a 2.2 or later kernel, so there exist
systems that have SO_ATTACH_FILTER defined but don't have
<netpacket/packet.h>.  Work around that by:

	checking whether we have PF_PACKET sockets by checking whether
	PF_PACKET is defined, not whether we have <netpacket/packet.h>
	(but we still check whether we have <netpacket/packet.h> before
	including it);

	if PF_PACKET is defined but we don't have <netpacket/packet.h>,
	include <linux/if_packet.h> to get the relevant definitions.
2001-01-17 07:42:37 +00:00
guy 2f454fd004 Check for all four types of IPX frame on DLT_LINUX_SLL captures. 2001-01-15 00:03:40 +00:00
guy 79762d33da I've seen captures with all four different flavors of IPX frames on
Ethernet, so, at least on Ethernet, when checking for IPX frames, check
for all of them, including Ethernet_II and Ethernet_SNAP.

Add an "llc.h" file with LLC SAP values, taken from tcpdump's "llc.h"
file, and use those, rather than defining them ourselves in "gencode.c".
2001-01-14 21:26:52 +00:00
guy d4869582d0 Handle STP (under the assumption that the "Bridging PDU"s that go over
PPP are Spanning Tree Protocol Bridging PDUs) and IPX over PPP.
2001-01-14 08:09:58 +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