dect
/
libpcap
Archived
13
0
Fork 0
Commit Graph

62 Commits

Author SHA1 Message Date
guy c98ffbcabf Add a "pcap_get_selectable_fd()" API to get an FD on which you can do a
"select()" or "poll()" - or -1 if that won't work.
2003-11-21 10:19:33 +00:00
guy 2c618b93a0 Add "getnonblock" and "setnonblock" operations, and set the function
pointers appropriately, rather than using #ifdefs and run-time checks.

Get rid of declaration of non-existent "pcap_set_datalink_platform()"
routine.
2003-11-20 02:02:38 +00:00
guy a08248f680 From Jean Tourrilhes <jean2@sourceforge.net>: IrDA capture support for
Linux.
2003-11-18 21:06:50 +00:00
guy 0eac66d65e Add a "pcap_dump_file()" API to get the "FILE *" corresponding to a
"pcap_dumper_t".
2003-11-16 10:07:35 +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 84217ae06c Add a DLT_ value for DOCSIS frames.
Note in "pcap-bpf.h" that DLT_ values 139 through 142 are reserved for
SS7.
2003-11-13 01:35:47 +00:00
guy 991d444f71 Add a "pcap_breakloop()" API to break out of the loop in
"pcap_dispatch()" and "pcap_loop()".
2003-11-04 07:05:32 +00:00
guy 4246a40e00 From a Debian patch by Eric Anderson <anderse@hpl.hp.com>, give more
detail if we get a premature EOF when reading packet data.

Also, do the same check when reading the packet *header*, and check for
I/O errors as well.
2003-11-04 01:49:07 +00:00
guy f580b78bae Handle DG/UX's wacky tcpdump format (major version 543, minor version 0,
caplen and len fields in the pre-2.3 order).

Move the version number checking to the open-file code; store a
tri-state (definitely swapped, definitely not swapped, maybe swapped)
value in the savefile information and use that when processing packets.
2003-10-24 23:55:06 +00:00
mcr c8573ae67f allocated SS7 links types to raw captures. 2003-09-09 17:10:15 +00:00
guy 4321cb1b08 Packets are *not* written in network byte order; the bytes of the packet
are written in the order in which they're received.  The old comment
saying that they're written in network byte order misled at least one
person.
2003-08-22 18:27:36 +00:00
guy 3e221afd71 Squelch signed vs. unsigned comparison warnings. 2003-08-18 22:16:13 +00:00
guy cd0d893ef9 Add a "read" function pointer to the pcap_t structure, which handles
reading packets from a pcap_t, and make "pcap_read()" call it.  That
removes the last place where we have to check for a pcap_t that refers
to a DAG card rather than a live capture, so get rid of the "is_dag" flag.
2003-07-25 05:32:02 +00:00
guy 08658f1c93 Add a "set_datalink" function pointer to the pcap_t structure, whichhandles
setting a filter for a pcap_t.  Have "pcap_set_datalink()" call it,
rather than explicitly calling "pcap_set_datalink_platform()".
2003-07-25 05:07:01 +00:00
guy cd2807e08d Add a "setfilter" function pointer to the pcap_t structure, which
handles setting a filter for a pcap_t.  Have "pcap_setfilter()" call it,
rather than being a per-platform function.  The per-platform functions
don't need to check for an offline capture any more, as they're not
called for an offline capture (and the ones that just call
"install_bpf_program()" don't need to exist at all).
2003-07-25 04:42:02 +00:00
guy 9792990eb8 Add a "stats" function pointer to the pcap_t structure, which handles
getting statistics for a pcap_t.  Have "pcap_stats()" call it, rather
than being a per-platform function; have stats routines for non-live
pcap_t's that return an error.
2003-07-25 04:04:56 +00:00
guy e648c9e593 Add a "close" function pointer to the pcap_t structure, which handles
the platform-dependent part of closing a pcap_t (and the
live-vs-savefile part as well, so that function must close the file
descriptor and free up any buffers allocated).

In the Digital UNIX support, add in a check for a memory allocation
failure.
2003-07-25 03:25:45 +00:00
guy 21fd0c41cb Reserve a DLT_ value for Apple IP-over-IEEE 1394 cooked headers, as per
a request from Dieter Sigmund <dieter@apple.com>.
2003-06-27 07:57:09 +00:00
hannes 7fcfe91807 allocate a DLT_ and LINKTYPE_ for Juniper-internal chassis encapsulation 2003-04-28 08:20:24 +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 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 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
hannes 9378712f13 allocate a bunch of DLT_ and LINKTYPES_ for Juniper-internal chassis encapsulation 2003-02-11 17:03:22 +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
hannes 79c4d5bc62 from Chris Waters chris.waters[AT]networkchemistry.com:
reserve DLT and LINKTYPE for the Tazmen Sniffer
Protocol (TZSP).
2002-12-26 08:53:07 +00:00
guy dc9d85f819 Make "pcap_dump_flush()" return a success-vs-failure indication;
unfortunately, we can't fix "pcap_dump()" and "pcap_dump_close()" to do
that, as any application that tests the return value would fail to work
correctly if linked at runtime with an older libpcap, but we should
perhaps introduce "pcap_dump_ex()" and "pcap_dump_close_ex()" routines
that do return a success-vs-vailure indication.
2002-12-22 23:05:52 +00:00
guy eca5a61ef1 From Andrew Brown <atatat@atatdot.net>: add a "pcap_dump_flush()" call,
to flush the standard I/O buffer for a "pcap_dumper_t" and force all
packets written with "pcap_dump()" to the savefile.
2002-12-21 23:38:51 +00:00
guy cb1f8ef14d Add new DLT_ type for AVS's WLAN header. 2002-12-11 22:43:31 +00:00
risso 8b5f7cc99e There was a bug in pcap_open_offline: in case of error, the returned pointer was freed but the open file was not closed. Thus, a handle on the opened file was kept and could not be released as the returned pointer was null. 2002-10-24 08:09:42 +00:00
guy d1d0fe1d98 Add support for RFC 2625 IP-over-Fibre Channel, mapping all the Linux
ARPHRD_FC* types to it.
2002-10-18 08:46:13 +00:00
guy f8a3b72cd9 Add LINKTYPE_ values and mapping table entries for the new DLT_ values
added for Kent Dahlgren.
2002-10-09 19:02:56 +00:00
guy 24481411c8 The Frame Realay and SunATM link-layer types are no longer reserved for
future use, they're being used.
2002-08-06 06:27:49 +00:00
risso 6831542ec7 Added support for Win32, based on WinPcap. 2002-08-01 08:33:01 +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 5095d581ec We'd already reserved 107 for Frame Relay; use that instead of a new
value.
2002-06-07 04:31:12 +00:00
guy 562499a65d Reserve a DLT_ value for Frame Relay, and map BSD/OS's DLT_FR to it. 2002-06-07 04:17:15 +00:00
guy d041ab8109 Reserve a DLT_ value for capturing on Solaris with SunATM. 2002-06-06 08:57:03 +00:00
guy 0a4e47d8be Don Lee was doing IP-over-FC, with the link-layer header from the
capture device having only an RFC 2625 Network_Header field, not a Fibre
Channel frame header; rename the constants to emphasize this and to
leave room for another "raw Fibre Channel" link-layer type, if it's ever
needed.
2002-04-20 21:01:57 +00:00
guy 5ba1adf267 No UNIX-specific functions are used here, so there's no need to include
<unistd.h>.
2002-04-09 07:44:46 +00:00
guy fdaba9c2a6 <pcap.h> includes <sys/types.h> and <sys/time.h>; there's no need to
include it in these files, as they either include "pcap-int.h", which
includes <pcap.h>, or they include <pcap.h> directly.
2002-03-24 23:21:51 +00:00
guy 7346580de5 Add a LINKTYPE_ value for Fibre Channel, as per a request from Don Lee
<donlee@cray.com>.
2002-03-08 11:24:32 +00:00
guy da21ca14ff Link-layer type 121 reserved for Siemens HiPath HDLC, as per a request
from Tomas Kukosa <tomas.kukosa@anfdata.cz>.
2002-01-25 08:27:33 +00:00
guy cabc9945d9 Add in items for the new savefile types. 2001-11-28 07:16:53 +00:00
guy 7acd15ba8d Reserve 116 for IP Filter capture files and 117 for OpenBSD DLT_PFLOG. 2001-09-09 05:02:28 +00:00
guy b57608cf35 LINKTYPE_IEEE802_11 and LINKTYPE_LOOP, and DLT_IEEE802_11, are no longer
reserved for future use; they're being used.

Move other currently-being-used LINKTYPE_ values above the "reserved for
future use" comment, to make it clear which types are reserved and which
are already in use.

Note that 100 through 103 shouldn't be used for new DLT_ types.
2001-09-09 04:27:18 +00:00
guy ba047e2bd0 Add a DLT_ value and a link-layer type value for savefiles for Acorn
Econet.
2001-09-05 04:27:23 +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
guy 80788ad380 Add support for NetBSD DLT_PPP_ETHER, as per the NetBSD libpcap. 2001-04-17 08:10:00 +00:00
guy 5b0a98d641 Add support for a new link layer type DLT_LINUX_SLL, for use when doing
live captures with a "cooked" (SOCK_DGRAM) rather than a "raw"
(SOCK_RAW) PF_PACKET socket; it includes a bunch of the fields from the
"struct sockaddr_ll" you get in a "recvfrom()", including the Ethernet
protocol field.

This requires us to rewrite the BPF program if we're stuffing it into
the kernel; as long as we're doing *ex post facto* rewriting, we might
as well also do the "ret <snaplen>" -> "ret 65535" fixup there as well,
rather than in the code generator.
2000-12-21 10:29:21 +00:00