dect
/
libpcap
Archived
13
0
Fork 0
Commit Graph

520 Commits

Author SHA1 Message Date
guy f102bd132c Add documentation for "pcap_next_ex()". 2003-04-10 06:21:00 +00:00
guy 401b04f629 Style cleanups, data type fix (make the "pkt_data" argument to
"pcap_next_ex()" a pointer to pointer to const u_char, to squelch
compiler warnings and to let the caller know that they're not supposed
to modify the data), and additional explanation in "pcap_next_ex()" of
the return-code conflict.
2003-04-10 06:10:37 +00:00
guy e0967f7bbc Add a prototype for "pcap_next_ex()", to squelch compiler complaints,
and to make it available to applications using it.
2003-04-10 06:08:06 +00:00
guy 82b59d865f Add a prototype for "pcap_strcasecmp()", to squelch compiler complaints. 2003-04-10 06:07:08 +00:00
risso 33bca3b31c Removed the _DEBUG definition that was erroneusly set in the release version of the Win32 project. Replaced it with NDEBUG 2003-04-09 10:10:04 +00:00
risso a0ef4ee0df Added a pcap_pkthdr field to the pcap structure. It is needed by pcap_next_ex().
sf_next_packet(), which was used by pcap_read_ex(), is no more exported under Win32.
2003-04-09 10:06:44 +00:00
risso 8103ed43f8 Added the definition of the bpf_hdr structure needed to compile under Win32. This definition was previously in bpf.h. 2003-04-09 10:01:10 +00:00
risso 66ed3857c4 Added the new pcap_next_ex() function and its support routines 2003-04-09 09:58:16 +00:00
risso 5e88d9288b uncommented the static modifier before sf_next_packet() in Win32. It was needed by pcap_read_ex(), which is now replaced by pcap_next_ex() 2003-04-09 09:55:20 +00:00
guy b3833482d0 Don't turn allmulti mode on if "promisc" isn't set; that causes problems
with some interfaces (see bug 599857 in the SourceForge list of libpcap
bugs), and, even if it doesn't cause problems, it's different from
what's done on other platforms.
2003-04-09 07:19:49 +00:00
guy 2edba7705d From Paul Mundt <lethal@linux-sh.org>: add SuperH to the list of CPUs
where we wire in the idea that it can't handle unaligned accesses.  (I
don't know why the test program doesn't work - but perhaps the test
program is the wrong answer anyway, as it doesn't work when
cross-compiling.)
2003-03-28 08:28:26 +00:00
guy 4175af1a53 Add support for "link broadcast" and "link multicast" for RFC 2625
IP-over-FC.

Clean up some error messages.
2003-03-28 08:09:48 +00:00
guy ef67e8fa3f Add support for loopback devices on AIX (under the assumption that they
have a DLT_NULL-style link-layer header).
2003-03-28 08:08:11 +00:00
guy dc0242b509 Note that if this is ever compiled on a SuperH platform where LBL_ALIGN
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.
2003-03-22 07:24:49 +00:00
risso dfa68b1635 Fixed some compiler warnings 2003-03-12 13:28:54 +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 d5c3be9ab6 FreeBSD also defines DLT_SLIP_BSDOS as 13 and DLT_PPP_BSDOS as 14, so we
define them that way on FreeBSD as well as NetBSD.
2003-03-08 09:21:37 +00:00
guy cb73be0549 Check for OpenBSD and, if we're building on OpenBSD, #define various
DLT_ values to have the same value they have in OpenBSD.
2003-03-08 09:13:39 +00:00
guy 786403c0a7 Add support for OpenBSD DLT_ENC - and map it to a value of 109, as its
value in OpenBSD, 13, is Yet Another DLT_ Value That Other OSes Use For
Their Own Purposes.
2003-03-08 08:42:13 +00:00
guy 78da480204 From clodder@acm.org, via OpenBSD: add checks for memory allocation
failure.
2003-03-08 08:26:31 +00:00
guy 8c2a3a235c From clodder@acm.org, via OpenBSD: add a check for memory allocation
failure.
2003-03-08 08:23:47 +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 a9c93b1828 From Motonori Shindo: version.h is a generated file, ignore it when
doing CVS operations.
2003-03-01 05:04:40 +00:00
fenner c5419d46c8 Only look up "tcp" and "udp" in pcap_nametoport(). This fixes the
case in e.g. FreeBSD where /etc/services lists port 4 for the ddp "echo"
 service.

Submitted by:	Alan Bawden <Alan@LCS.MIT.EDU>
2003-02-25 22:12:03 +00:00
fenner bb7cf360b1 Don't make the bpf buffer smaller than the default. 2003-02-25 21:58:48 +00:00
guy 164af2f0bf Alas, there are some versions of GNU libc that don't have "SA_LEN()"; at
least for those that also have "getifaddrs()", we have to get the size
by looking at the address family.
2003-02-25 07:50:28 +00:00
guy 463507912d Include "config.h", so that LBL_ALIGN is defined as appropriate, and add
"__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).
2003-02-23 00:22:00 +00:00
guy 0e96f354ca From Andrew Brown: make "pcap.o" depend on "version.h", so that even in
non-".devel" builds, with no automatically-generated dependencies,
"version.h" will be built before we try to build "pcap.o" ("pcap.c"
includes "version.h", so we need it to be built).
2003-02-21 03:19:19 +00:00
guy e592efb3bc According to the bufmod man page for Solaris 2.4 and 9 (meaning it's
probably true in all versions), "sbh_drops" is "the cumulative number of
input messages that this instance of bufmod has dropped due to flow
control or resource exhaustion."

"Cumulative" presumably means "don't add it to the count of drops, as
it's *already* a count since the capture started; just set the count of
drops to the value".  Do so.
2003-02-19 08:06:26 +00:00
guy 4244b90c15 Unfortunately, there is no direction flag for DLT_PPP. 2003-02-14 07:48:25 +00:00
guy 896263cfdc The comment in the rules for "version.h" was getting printed when
"version.h" was getting built; put the comment before the rules.
2003-02-13 07:56:38 +00:00
guy 694746f160 At least on SunOS 5.x, Digital UNIX 4.0, AIX 4.3, FreeBSD 3.4, some
version of Red Hat Linux, HP-UX 11.00, and MacOS X 10.1, if a string in
a shared library is static, and returned by a function in that library,
the return value of that function, when called from a program, will
reflect the contents of the string in the version of the shared library
with which the program is running, not the version with which it's
linked.

Therefore we can just generate a definition of the version string and
put it into "version.h", which means that VERSION can contain any string
(as long as " and \ are escaped with \) rather than having to be N.M or
N.M.MM.
2003-02-13 07:54:59 +00:00
hannes 9378712f13 allocate a bunch of DLT_ and LINKTYPES_ for Juniper-internal chassis encapsulation 2003-02-11 17:03:22 +00:00
guy 2807261207 Don't describe the string returned by "pcap_lib_version()" as a version
number - it has more than just a version number in it (and may have two
version numbers for WinPcap).
2003-02-11 08:03:21 +00:00
guy be8c1efc2c Support dot-dot version numbers.
Generate version.h before generating dependencies.
2003-02-11 08:01:40 +00:00
guy c3d7575735 Handle Win32/WinPcap differently when generating the version string. 2003-02-11 07:50:03 +00:00
guy e13c350417 Add a "pcap_lib_version()" routine to return a version string for
libpcap; it generates the string at run time on the first call, so that
it's not a constant string - in at least some UNIXes, constant data in a
shared library is kept separate from the library code, and is bound into
applications linked with that library at link time, not at run time, so
a constant string (such as "pcap_version[]") can reflect the version of
the library with which the application was built, not the version with
which it's running.

Document it, in the hopes that vendors will be less likely to omit it
from their libpcaps (unlike "pcap_version[]", which is absent from some
vendors' libpcaps).
2003-02-11 07:40:09 +00:00
guy 725f1b9d27 Before testing for DLPI, test for "/usr/include/odmi.h", so that, on
AIX, we choose BPF, not DLPI, by default; we won't necessarily choose
BPF if no libpcap-based program has been run since booting, as libpcap
(both IBM's and, now, ours) create BPF devices and load the driver if
that hasn't already been done since booting).
2003-02-11 06:21:00 +00:00
guy f4129e990d Use "odm_err_msg()" to get the error message string corresponding to ODM
errors.

Check for "odm_terminate()" failing.

Fix a typo.

Remove spaces between casts and variables, to match the style used
elsewhere.
2003-02-11 06:19:26 +00:00
guy d4b09f9421 Put in Shaun Clowes' full name. 2003-02-11 02:07:20 +00:00
guy aedf01b20f From Shaun <delius@progsoc.uts.edu.au>: on AIX, load the BPF driver and
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".
2003-02-11 01:46:05 +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
guy 6efec806a4 For DLT_ATM_RFC1483, the network-layer header starts 8 bytes from the
beginning of the packet if the packet has an 802.2+SNAP header (3 bytes
802.2, 5 bytes SNAP), and 3 bytes from the beginning of the packet if it
has only an 802.2 header, just as is the case for DLT_ATM_CLIP, so go
back to handling them both with the same case.

Restore some comments asking whether we need to check the SSAP when
testing the 802.2 header for protocol types.

Clean up white space.

RFC 1188, RFC 1042, and RFCs 1483 and 2225 specify that SNAP
encapsulation is used for IP, not LLC encapsulation with LLCSAP_IP and,
in fact, that's what most if not all IP traffic over FDDI, 802 networks,
and LLC-encapsulated ATM use; go back to treating those link-layer types
the same way other link-layer types are handled.
2003-02-05 01:53:29 +00:00
guy 8b31d709a2 If we have bufmod, allocate a buffer big enough to hold the size of
chunk we ask bufmod to send upstream.

Yes, uint_t is always 32 bits, at least as I read the Solaris 8 code.

The chunk size is 8192, not 0, by default.

Don't do the chunk size stuff if we don't have bufmod.
2003-02-05 01:46:58 +00:00
risso c6c36989f7 Added a const modifier to the first argument of pcap_lookupnet() for Win32. Without it, libpcap didn't compile under Cygwin. 2003-02-04 09:51:38 +00:00
guy 2256aabb91 As per suggestions from the anonymous SourceForge user who submitted bug
673958, make two changes on Solaris:

	don't set SB_NO_DROPS - doing so means that bufmod doesn't drop
	packets, so it can't report the number of drops, but packets
	probably still get dropped *somewhere*, if for no other reason
	than that the system refuses to allocate more mblks/dblks, even
	if it doesn't discard messages that arrive at the stream head if
	it's full;

	set the chunk size to 65536, as otherwise packets are dropped
	too easily.

snoop also appears not to set SB_NO_DROPS and also appears to set the
chunk size to 65536, so that's probably the right thing to do.
2003-02-04 05:42:03 +00:00
guy 04672f261b Put in break statements after every case in the switch on the NDIS
medium type.
2003-01-23 09:40:09 +00:00
guy 2d1ac3b4d5 From Peter Fales <peter@fales-lorenz.net>: support for Linux ARCNET,
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".
2003-01-23 07:24:51 +00:00
guy 4c88bf1f3e Add DLT_ARCNET_LINUX and LINKTYPE_ARCNET_LINUX; the link-layer headers
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.)
2003-01-21 04:39:05 +00:00
guy 5b474ef2bb Move the freeing of "p->dlt_list" to the proper place. 2003-01-16 07:44:27 +00:00