dect
/
libpcap
Archived
13
0
Fork 0
Commit Graph

392 Commits

Author SHA1 Message Date
guy 9e6fbe3b4b Cut-and-pasteo fix, from Greg Stark <gsstark@mit.edu>. 2002-07-12 07:51:15 +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 5485e981d8 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 07:56:44 +00:00
guy 541d54330f Isn't Linux fun? You might have a distribution whose kernel is a shiny
new 2.2-or-later kernel, with PF_PACKET sockets including SOL_PACKET,
but with an older version of the C library whose headers don't define
SOL_PACKET.

On those systems, define SOL_PACKET to have the value it has in the
2.2.0 kernel; this means we can get rid of the "#ifdef
SOL_PACKET"/#endif stuff wrapped around the code to turn promiscuous
mode on or off (we don't want that #ifdeffed out, as if it's absent we
won't pay attention to the "promiscuous mode" flag argument to
"pcap_open_live()").
2002-07-06 21:22:35 +00:00
guy e61a5c069b Fix up AC_LBL_C_INLINE to put all of the test code into the "inlines"
section - the other section gets stuck in the middle of "main()", and,
although GCC lets you define functions inside functions, other C
compilers don't.

Pick a name more likely to be unique to use as the iterator variable in
AC_LBL_C_INLINE.

Make AC_LBL_C_INLINE print "no" rather than "not supported" if inline
isn't supported, to match what AC_C_INLINE does.
2002-07-02 02:10:50 +00:00
guy 1b2b4e620d Boost some table sizes to make it possible for the HP-UX 11i lex (and
possibly other lexes) to handle it.
2002-06-29 07:44:38 +00:00
guy cb8b3f950d Add a note that Rick Jones reports that HP-UX 11i needs no patches for
outbound promiscuous mode support.
2002-06-29 04:39:03 +00:00
guy 69d070984f Put variables in quotes when testing them in "test" commands, so that
the test doesn't get a syntax error if the variable isn't set or is set
to a null string.
2002-06-29 04:21:09 +00:00
guy f6bcb3d546 Some versions of the HP C compiler can handle inlines, but not if they
return a structure pointer.  Check whether the C compiler can handle
inline functions that return a structure pointer, not whether they can
handle inline functions that return an int, as at least some versions of
autoconf's AC_C_INLINE do.
2002-06-28 10:34:35 +00:00
itojun 5918c491c1 whitespace cleanup 2002-06-11 17:04:44 +00:00
itojun f1183c9b15 tches #454 from yamt@mwd.biglobe.ne.jp
- avoid optimization involving subtract operations
- correct optimization of bitwise operations

TODO: re-introduce subtract optimization
2002-06-11 05:30:39 +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 ffd1e8f4ad Add comments to explain the incomplete definitions of "struct mbuf" and
"struct rtentry".
2002-06-01 23:22:57 +00:00
guy 7ec2e59dc8 Additional per-platform "prototypes for functions for which the OS
doesn't supply a prototype" headers.
2002-06-01 09:37:39 +00:00
guy c26a724029 Fix white space. 2002-06-01 09:36:26 +00:00
guy 5fd91ac78f Fix up some printf calls to cope with both 32-bit and 64-bit longs and
"size_t"s.
2002-05-31 11:03:02 +00:00
guy d8fc192106 Use "%u", not "%lu", to print "u_int" variables. 2002-05-31 10:59:43 +00:00
guy d0dc7ff736 Add updates noting that the BPF devices and BPF driver might not exist
until you run AIX's tcpdump at least once.
2002-05-31 10:16:14 +00:00
guy 23b1f4735e Clean up the discussion of the SourceForge site. 2002-05-29 07:05:37 +00:00
guy f61d28f21f Update to the current version number.
Mention the "README.{system}" files.

Supply all the URLs for the 1993 Winter USENIX paper, including those on
tcpdump.org.

Give all the names DEC OSF/1 has gone through in its life.

Mention that Linux, in 2.2 and later kernels, has a filter mechanism
that supports BPF.

Mention the SourceForge site.
2002-05-29 06:57:29 +00:00
guy d5645c3c5a To quote Hannes Gredler, "tony has moved a while ago". 2002-05-28 09:25:49 +00:00
guy cb633f987b Add a README.hpux file, derived from the Ethereal one, giving
information on working around capture problems on HP-UX.
2002-05-24 11:14:17 +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 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 9e0534ca64 Throw in
#ifdef __cplusplus
	extern "C" {
	#endif

and change

	#if __STDC__

to

	#if __STDC__ || defined(__cplusplus)

around the non-kernel function prototypes, so they work right when
compiling with C++.
2002-04-20 10:02:16 +00:00
guy 4f544108b4 Handle the three types of link layers:
those that always use 802.2;

	those that never use 802.2;

	Ethernet (where 802.2 is used for 802.3 and is not used for
	Ethernet II);

correctly.  This requires having two variables for the offset of the
network layer header, one for use with protocols that would not run atop
802.2 on Ethernet and would run atop 802.2+SNAP on link layers that
always use 802.2, and one for use with protosol that would run atop
raw 802.2 (no SNAP) on Ethernet and on link layers that always use
802.2.

Fix the network layer offset for 802.11, and the link-layer offset for
RFC 1483 ATM (there's no link layer, there's just 802.2 LLC).
2002-04-11 07:38:32 +00:00
guy 734ffc1c85 <pcap.h> includes <sys/types.h>, and "pcap-int.h" includes <pcap.h>, and
"scanner.l" includes "pcap-int.h", so there's no need to include
<sys/types.h> in "scanner.l".
2002-04-09 08:42:39 +00:00
guy 89c05cd79f <pcap.h> include <sys/time.h>, and "pcap-int.h" includes <pcap.h>, so
there's no need to include <sys/time.h> ourselves.

No UNIX-specific functions are used here, so there's no need to include
<unistd.h>.
2002-04-09 07:49:07 +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 55dba26a62 Indicate why we have incomplete definitions for "struct mbuf" and
"struct rtentry" (in <net/if.h> on some systems, e.g.  Digital UNIX 4.0,
there are prototypes for kernel functions that include "struct mbuf *"
and "struct rtentry *" arguments, and they are included even if you're
just user-mode code).

We don't need to include <netinet/if_ether.h> unless we have
"ether_hostton()", and we don't need to include <net/if.h> unless we're
including <netinet/if_ether.h>, and we don't need to define "struct
mbuf" or "struct rtentry" unless we're including <net/if.h>.
2002-04-09 07:41:19 +00:00
guy 9328cdfd19 Indicate why we have incomplete definitions for "struct mbuf" and
"struct rtentry" (in <net/if.h> on some systems, e.g.  Digital UNIX 4.0,
there are prototypes for kernel functions that include "struct mbuf *"
and "struct rtentry *" arguments, and they are included even if you're
just user-mode code).
2002-04-09 07:37:59 +00:00
guy da10d3ec7f Include <netdb.h> before <pcap-namedb.h>, as <netdb.h> is included to
define a structure used by <pcap-namedb.h>, and include <sys/socket.h>
before <netdb.h>, as <sys/socket.h> is included to define a structure
used by <netdb.h> (only a pointer to the first structure is used in
<pcap-namedb.h>, and only a pointer to the second structure is used by
<netdb.h>, so code will compile no matter which order you include them
in, but it's a bit cleaner to include <sys/socket.h> before <netdb.h>
and to include <netdb.h> before <pcap-namedb.h>).  Indicate why we're
including <netdb.h> and <sys/socket.h>.
2002-04-07 00:42:51 +00:00
guy 67a0588585 No need to include <sys/socket.h> twice. 2002-04-07 00:22:30 +00:00
guy 1d35b4b590 Include <netdb.h> before <pcap-namedb.h>, as <netdb.h> is included to
define a structure used by <pcap-namedb.h> (only a pointer to the
structure is used in <pcap-namedb.h>, so code will compile no matter
which order you include them in, but it's a bit cleaner to include
<netdb.h> first).  Indicate why we're including <netdb.h>.
2002-04-07 00:04:37 +00:00
guy 705943d1bc There's no need to include <sys/socket.h> twice. 2002-04-06 23:57:52 +00:00
guy 8d52bdae65 There's no need to include <netdb.h> twice. 2002-04-06 23:27:33 +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 5913ea0fe4 Add a DLT_ value for Fibre Channel, as per a request from Don Lee
<donlee@cray.com>.
2002-03-08 11:16:34 +00:00
guy 1e108f2bca Handle 64-bit mode in IRIX, where "snoop_timestamp" in a "struct
snoopheader" is a "struct irix5_timeval" rather than a "struct timeval",
by copying the "tv_sec" and "tv_usec" members of that structure to the
time stamp in a "struct pcap_hdr".
2002-03-08 11:10:40 +00:00
guy 03550aa8e2 Add support for gigabit Ethernet interfaces on SGI machines, from David
Kaelbling <drk@sgi.com>.
2002-03-07 11:39:13 +00:00
guy a579c1219c Support for ARPHRD_RAWHDLC, as used by, for example, the Cyclades PC300
synchronous board in Raw HDLC mode, from Octavian Cerna
<tavy@ylabs.com>.
2002-03-07 11:27:57 +00:00
guy 0c86142e99 From John Bankier <jbankier@rainfinity.com>: the buffer into which we
read packets is "p->bufsize" bytes long, not MAXDLBUF bytes long
("p->bufsize" is set to (MAXDLBUF * sizeof sizeof(bpf_u_int32))), so
supply that as the "maxlen" value in the "data" argument to "getmsg()".
2002-03-05 04:05:56 +00:00
guy c9f3b70d22 The "sbh_timestamp" member of an "sb_hdr" structure isn't necessarily a
"struct timeval" - on Solaris 7 and 8, when compiling in LP64 or I32LPx
mode, it's a "struct timeval32" (presumably so that bufmod doesn't have
to worry about whether the stream is being read by a 32-bit program or a
64-bit program).  Set the "struct timeval" "pkthdr.ts" by copying the
individual members rather than by doing a structure assignment.
2002-02-22 11:49:13 +00:00
guy 6c3ce3a573 Bug fixes from Graeme Hewson <ghewson@cix.compulink.co.uk>:
1. During termination processing set up by atexit() under a 2.0.x
   kernel, if a socket had been previously closed and the handle freed
   due to an error, pcap_close_all() and pcap_close_linux() would
   nevertheless try to work with these structures and then crash.
   pcap_close_linux() is now called directly when necessary during
   error processing.

2. atexit() could get called more than once because the did_atexit
   flag wasn't being set.

3. If iface_get_arptype() returns an error because the ioctl() call
   failed (probably due to "no such device"), live_open_new() now
   returns a fatal error to pcap_open_live() and the call to
   live_open_old() is short-circuited.

4. Applications using libpcap would appear to listen on an interface
   that was down.

   a. iface_bind() and iface_bind_old() now check for pending errors
      after bind().  In turn, pcap_open_live() now returns an error
      status if there was a pending error after bind().

   b. After draining the socket, set_kernel_filter() now checks to see
      if the error was the expected EAGAIN and returns a fatal error
      to pcap_setfilter() if not.  In turn, pcap_setfilter() now
      returns an error status if there was a network error.

5. pcap_setfilter() was putting an error message into errbuf after a
   failed call to install_bpf_program().  This was unnecessary since
   install_bpf_program() puts its own error message into errbuf.
2002-02-22 09:20:11 +00:00
guy bb0918aeef Have "map_arphrd_to_dlt()" take a flag indicating whether it's OK to
return DLT_LINUX_SLL or not, and, if that flag is false, for those
interface types where we'd used DLT_LINUX_SLL, pick a DLT_ type that
works as well as possible in raw mode, or fail.

Pass 1 as that flag if we're using a PF_PACKET socket; pass 0 as that
flag if we're using a PF_INET/SOCK_PACKET socket.

For PF_INET/SOCK_PACKET sockets, try to get the link-layer type and map
it to a DLT_ value *before* turning promiscuous mode on, so that we
don't try to put the interface into promiscuous mode unless we know we
can handle its link-layer type (and thus that we can use the interface).
2002-02-10 00:05:14 +00:00
guy e1f3b3be1a From Solomon Peachy <pizza@shaftnet.org>: Linux 2.4.18pre4 defines
ARPHRD_IEEE80211_PRISM, for sniffing on Prism II-based 802.11 interfaces
and getting the special Prism header, so we should map it to
DLT_PRISM_HEADER.
2002-02-05 05:47:14 +00:00