dect
/
libpcap
Archived
13
0
Fork 0
Commit Graph

81 Commits

Author SHA1 Message Date
guy efca1c6d92 Report short reads on the file header (as opposed to errors on it)
correctly.
2004-12-15 09:00:11 +00:00
guy 3573dfdacc Put the FDDI padding (if any) into the pcap_t structure on platforms
that require it, and make pcap_fddipad private to the code generator, as
that's the only place that needs it (ideally, all *its* state should be
local as well).  This makes opening an FDDI device, on platforms where
the padding is supplied as part of the packet, and opening other types
of devices or opening savefiles in the same program work better, as you
don't have to be sure you compile the filter for a given pcap_t before
opening the next pcap_t.
2004-12-15 00:25:08 +00:00
guy 84819baa2b Add new DLT_ values and LINKTYPE_ values for G.7041/Y.1303 Generic
Framing Procedure, as per Dumas Hwang (dumas.hwang@navtelcom.com).
2004-12-09 19:03:36 +00:00
guy 1e5f231e7b New link-layer header type for raw GPRS LLC frames, as per a request by
Marc Hermstein <mhermstein@yahoo.com>.
2004-12-07 17:27:45 +00:00
guy 6dc4f10b78 From Dug Song <dugsong@monkey.org>: don't fetch the filter code until
we're about to apply the filter, so that if it's changed by a callback
routine, we get the current filter, rather than the one in effect when
we started the loop.
2004-11-30 10:51:41 +00:00
guy cccbf10006 From Chris Lightfoot <cwrl@users.sourceforge.net>: add
"pcap_dump_fopen()" to open a pcap_t given a FILE *, and add
"pcap_dump_fopen()" to open a pcap_dumper_t given a FILE *.

On Windows, if we're opening the standard input, put it in binary mode.

Check for errors from "sf_write_header()" and return an error if we get
an error.
2004-11-07 21:40:48 +00:00
hannes 00384d8605 allocate DLT_ and LINKTYPE_ 167,168 for Juniper Networks, Inc. 2004-10-20 14:28:49 +00:00
guy e49ca1f08b If we get an error trying to open a capture file, don't close the
capture file if the standard I/O stream is stdin (i.e., if the file name
was "-").  Thanks to Joshua Blanton <jblanton@masaka.cs.ohiou.edu> for
catching this one.
2004-09-28 01:09:52 +00:00
hannes 4017783b36 add support for another PPP variant as per request from Karsten Keil <kkeil@suse.de>
the first byte (0xff) of the PPP header (0xff03) is tweaked to accomodate
the direction 0x00 = IN, 0x01 = OUT

the DLT_ supports the libpcap tokens "inbound" and "outbound"
2004-08-18 14:25:01 +00:00
guy 3f7430de17 Add in another magic number, reserved for Francisco Mesquita
<francisco.mesquita@radiomovel.pt>.

Rename the Kuznetzov magic to note what it is, and add and expand some
comments.
2004-08-17 17:50:33 +00:00
guy 93306079a3 Add a DLT_ value and LINKTYPE_ value for BACnet MS/TP.
Clean up some white space.
2004-06-07 20:00:08 +00:00
guy 2d2890dd37 Add support for sending packets; includes contributions from Mark
Pizzolato <List-tcpdump-workers@subscriptions.pizzolato.net>.
2004-03-23 19:18:04 +00:00
risso fe6b7f8e33 Avoid a null pointer access in pcap_dump_open if fname is a read only file 2004-03-16 19:27:55 +00:00
guy 2f74e436ab Put the LINKTYPE_ values in numerical order, to make it easier to make
sure that all values from 100 to the current maximum value are in use;
put in comments to indicate for what purpose the reserved ones are
reserved.

Note in the "don't just grab a value and use it yourself" comment why
you shouldn't use values below 100 or above the maximum value you see in
the file.
2004-03-11 23:40:54 +00:00
guy 9876992f2c Add support for 99 as a linktype in a capture file. 2004-03-11 19:56:45 +00:00
hannes 673ea44790 assign DLT_ and LINKTYPE_ 164 to Juniper Networks Inc. 2004-02-11 22:06:58 +00:00
guy 7ac8a0a75b DLT_IEEE802_11_RADIO is used for the BSD radio header; add a new
DLT_IEEE802_11_RADIO_AVS for future use with the AVS radio header.

Fix a comment.

Put in reserved LINKTYPE_USERn values corresponding to the reserved
DLT_USERn values.
2004-01-29 10:36:43 +00:00
guy 175b9d75e8 "selectable_fd" doesn't make sense on Windows. 2003-12-21 21:58:50 +00:00
guy 808a1fd8e1 Reserve two DLT_ values for IBM's use. 2003-12-03 21:34:21 +00:00
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