dect
/
libpcap
Archived
13
0
Fork 0
Commit Graph

71 Commits

Author SHA1 Message Date
guy 655045ea51 OK, we'll be putting out 0.9.2 soon, so add the API changes back in
again.
2005-07-07 02:04:33 +00:00
guy 3e2be26ee9 0.9's already been released, so, for better or worse, we're stuck with
the old names.
2005-07-05 22:33:16 +00:00
guy 35a2ab9527 Rename "direction_t" to "pcap_direction_t", and rename "D_IN" and
"D_OUT" to "PCAP_D_IN" and "PCAP_D_OUT", to avoid potential namespace
collisions, as per a suggestion by Dean Gaudet.
2005-07-05 22:14:06 +00:00
guy 9be574504c Add a "pcap_dump_ftell()" routine, to fetch the current offset of a
pcap_dumper_t.  (Just doing an "ftell()" on the result of
"pcap_dump_file()" won't necessarily work on Windows, as Microsoft, in
their infinite wisdom, have multiple different versions of the C library
runtime, and if a DLL is built using one version, and another DLL or an
executable is built with another version, file descriptors and FILE *'s
opened in one of them cannot be used in the other.)
2005-06-03 20:36:56 +00:00
guy f076c1d329 Note that "pcap_setdirection()" isn't supported on savefiles. 2005-05-23 20:38:06 +00:00
guy 345029aaf9 From Pawel Pokrywka: add support for requesting that only received
packets, only sent packets, or all packets be accepted, with an
implementation for Linux.

Add an implementation for BPF platforms that support BIOCSSEESENT.
2005-05-03 18:54:33 +00:00
guy 4c4d7df517 Propagate
revision 1.65
	date: 2005/04/13 18:59:41;  author: mcr;  state: Exp;  lines: +5 -1
		include typedef for pcap_handler in documentation.

from the main branch.
2005-04-17 00:58:23 +00:00
guy 14eb2792bd Don't boldface the period at the end of a sentence. 2004-12-17 21:27:54 +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
guy c4e76ddd83 Note that not all the addresses in the list of addresses are
necessarily IPv4 or IPv6 addresses, and that you must check the address
family before interpreting the address.
2004-04-20 20:42:36 +00:00
guy 60268b4b61 Add a note indicating that there are platforms where the source address
in the link-layer header is, on packets sent with "pcap_inject()",
changed to the address of the interface on which the packet is sent.
2004-04-09 21:16:44 +00:00
fenner 8177eec7d9 Handle the new OpenBSD pf format (DLT 117), which is now being used
by other systems as they adopt pf.
Don't bother trying to be backwards compatible with DLT 17.
2004-03-28 20:27:12 +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
guy 7dea26c4b6 Document "pcap_get_selectable_fd()" - and give some details on the stuff
you might have to do with that FD to work around the brokenness of
"select()"/"poll()" on most versions of most BSDs.
2004-02-28 02:51:26 +00:00
guy 3c677e1380 Update the date. 2004-01-26 02:11:06 +00:00
guy 4f9b1a6238 Note that "pcap_breakloop()" won't break another thread out of a
blocking call to get packets.
2003-12-01 02:43:45 +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 ba73faeef3 Add "pcap_datalink_val_to_description()", which returns, for a DLT_
type, a short description intended for humans.

Fix up some man page typoes.
2003-11-18 22:14:24 +00:00
guy ecaf2b3929 Update the date.
Add some periods to the ends of long DLT_ descriptions.

Add some missing DLT_ values.
2003-11-18 21:51:11 +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 849c3c660e Add in some notes warning people about things they must do if using
"pcap_breakloop()".  (tcpdump had to be fixed to do both of them.)
2003-11-04 07:37:02 +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 7b3d3c4ba0 Describe the return value of "pcap_findalldevs()". 2003-10-10 00:27:45 +00:00
guy f102bd132c Add documentation for "pcap_next_ex()". 2003-04-10 06:21:00 +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 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 1445ed8be1 From NetBSD, as checked in by Antti Kantee <pooka@netbsd.org>: fix the
documentation for "pcap_next()" to indicate that it returns a "const
u_char *", not just a "u_char *".
2003-01-16 07:29:15 +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 8cd68a0fa4 From Yoann Vandoorselaere <yoann@prelude-ids.org>: make the "device"
argument to "pcap_open_live()" a "const" pointer.

Constify some additional device name arguments, and update the man page
to reflect some arguments that were already consts.
2002-12-22 02:36:48 +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 482fa426bc NetBSD support for multiple data link types on an interface, from David
Young <dyoung@ojctech.com>, with some minor changes by Jason R.  Thorpe
<thorpej@netbsd.org>, and further changes by me to support it on BPF
systems lacking BIOCGDLTLIST and other platforms lacking an equivalent
feature.

Update Jason Thorpe's e-mail address (Zembu is going away, if it hasn't
done so already).

Add APIs to map DLT names to DLT values and vice versa.
2002-12-19 09:05:45 +00:00
guy 1e574aa6fd Indicate when "pcap_next()" returns NULL, and that, unfortunately, you
don't know whether that happens because of an error or because no
packets were available at the time.
2002-12-17 07:32:55 +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 7a30eb46ce On Solaris, if the "to_ms" argument is zero, we don't do an SBIOCSTIME;
if, as I suspect is the case, that causes no timeout to be set, and if
that's the same as explicitly clearing the timeout with SBIOCCTIME, that
would appear to mean that it'd wait forever for a full chunk's worth of
packets to arrive.
2002-09-18 19:07:57 +00:00
guy 6782a9f4a7 Document that a zero value of the timeout argument to "pcap_open_live()"
can have one of two different behaviors, depending on the OS (it means
"don't return from a read until enough data has arrived" on BSD and
Digital/Tru64 UNIX, and means "return immediately" on Solaris, for
example, at least according to the man pages on Digital/Tru64 UNIX and
Solaris and the code in BSD).
2002-09-18 18:56:57 +00:00
guy ffabca7439 Emphasize that you get only "caplen" bytes of data in the callback from
"pcap_dispatch()" and "pcap_loop()", give more details on the effect of
the "snaplen" argument to "pcap_open_live()", and suggest 65535 as a
value if you want to capture the entire packet.
2002-09-12 19:42:03 +00:00
guy 23bfb470c5 Explain, in more detail, the "netmask" argument to "pcap_compile()"; in
particular, point out that it's only used when checking for IPv4
broadcast addresses, and that if you don't care whether those checks are
done correctly, you can supply 0 if the netmask isn't known or isn't
available.
2002-09-06 21:14:46 +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 0d02000200 Add support for Frame Relay as a link-layer type; the header is the
standard Q.922 Frame Relay header with a 2-byte address field.
2002-07-11 08:12:34 +00:00
guy c546e795dd Expand the description of the arguments to the callback for
"pcap_dispatch()", giving the members of a "struct pcap_pkthdr", and
specifying which of those arguments are "const" pointers.

Describe the return value of "pcap_loop()".
2002-05-22 08:03:36 +00:00
guy 86c2a855bf Minor tweak to the synopsis for "pcap_setnonblock()" to make it look
more like the other synopses, and note that it returns 0 on success.
2001-12-29 21:57:07 +00:00
guy 4ad66bbfb4 Note that "pcap_stats()" isn't supported on savefiles, as savefiles
don't include statistics.
2001-12-10 06:35:00 +00:00
guy fde2e99495 Move the description of "pcap_[sg]etnonblock()" immediately after the
description of the routines to open captures, so that non-blocking mode
is described before "pcap_dispatch()" is described.
2001-12-09 08:58:28 +00:00
guy a82f1618b8 Add APIs to put a "pcap_t" into or out of non-blocking mode, and to get
the current state of non-blocking mode; this allows us to implement, for
example, memory-mapped capture devices, where "pcap_read()" uses
"select()" or "poll()" to wait for packets to arrive, and hide that
implementation detail from applications using this API
("pcap_setnonblock()" would set or clear a non-blocking mode flag in the
"pcap_t", and the "select()" or "poll()" would not be done if the
"pcap_t" is in non-blocking mode).
2001-12-09 05:10:02 +00:00
guy d71c1c4045 In the description of "pcap_datalink()", enumerate the link-layer types,
and give a description of the link-layer header if it's not directly
implied by the link-layer type.
2001-10-28 03:54:57 +00:00
guy db79c69108 Make the "is_loopback" field of a "pcap_if" structure a general "flags"
field, and make a PCAP_IF_LOOPBACK flag be the first flag bit in that
field, specifying whether the interface is a loopback interface; this
allows us to add more flags without changing the layout of the
structure.
2001-10-28 02:31:49 +00:00
guy 6e796fb8ba Fix a typo and a formatting nit. 2001-10-13 06:28:53 +00:00
mcr f3d3a0b363 clarified use of pcap_dump(3) parameters. 2001-10-12 21:43:29 +00:00
guy 9c0a593a2e From Scott Gifford:
Add a new "pcap_findalldevs()" routine to get a list of all
	interfaces that can be opened with "pcap_open_live()", and a
	"pcap_freealldevs()" routine to free the list.

	Make "pcap_lookupdev()" use it, which also arranges that it will
	not return a device that cannot be opened by "pcap_open_live()".

	Allow the "any" device to be opened, on Linux, with "promisc"
	non-zero; ignore the request for promiscuity, and return a
	warning message indicating that promiscuous mode isn't supported
	on the "any" device.

Document "pcap_findalldevs()" and "pcap_lookupdev()", and clean up some
items in the libpcap man page.
2001-10-08 01:06:20 +00:00
guy 0c2cc33435 Fix a typo. 2001-07-04 07:34:50 +00:00