dect
/
libpcap
Archived
13
0
Fork 0
Commit Graph

400 Commits

Author SHA1 Message Date
guy 3d856fe865 Leave it up to the platform-dependent "get interface list" code to
figure out how big the addresses are, as the way that's done is, well,
platform-dependent....
2002-07-30 08:12:13 +00:00
guy 1f419aeb14 It appears that SIOCGIFMTU returns the MTU in the sense of "maximum
amount of payload you can put in a link-layer packet", i.e. "maximum
size of a link-layer packet minus the link-layer header size", rather
than returning the maximum size of a link-layer packet.

The snapshot length is the maximum amount of data to capture from the
entire packet, so it should be clipped at the MTU plus the link-layer
header, not at the MTU.
2002-07-30 07:48:20 +00:00
guy 2dcac1bb6b Put the different implementations of "pcap_findalldevs()" into separate
source files, rather than having a pile of #ifdefs in "inet.c".  Add
code to the configure script to determine which implementation to use on
the platform for which libpcap is being built.

Add a "pcap_findalldevs()" implementation for Solaris 8 and later that
handles IPv6 addresses.
2002-07-27 18:45:34 +00:00
guy 5b8139d3d4 Set the correct member of a YYSTYPE for an IPv6 address - it's returned
as a string, rather than as a binary address.  This removes a warning
from the Sun C compiler, although it probably doesn't change the
generated code (the "e" and "s" members of the union probably have the
same data representation and reside in the same part of the union; if
they didn't, the old code wouldn't have worked).
2002-07-27 18:41:23 +00:00
guy 1d0879987d Make "flags" in a "struct pcap_if" a "bpf_u_int32", as requested by
Fulvio Risso.
2002-07-20 23:50:21 +00:00
guy 721e3db2ed An additional update. 2002-07-16 05:03:34 +00:00
guy ff15c1f4d9 Update and fix up the list of files. 2002-07-16 05:00:00 +00:00
guy 0fa1dfb0b3 Make static the structure to which the test program checking what to use
for "inlines", so that we don't get tripped up by compilers complaining
that we're returning a pointer to an automatic variable.
2002-07-13 09:34:59 +00:00
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