dect
/
libpcap
Archived
13
0
Fork 0
Commit Graph

25 Commits

Author SHA1 Message Date
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 c781d3d992 Fix a call to "pcap_add_if()" that wasn't give a null-pointer
description argument.
2001-10-28 20:40:43 +00:00
guy dfc0d14d3b Add a description to the entry for the "any" device. 2001-10-28 20:31:05 +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 d5735e2448 Split off the code to scan "/proc/net/dev" into a separate routine, and
don't call it if we've already had an error.
2001-10-10 06:46:50 +00:00
guy 519b0b5a59 If we have "/proc/net/dev", and don't have <ifaddrs.h> (i.e., don't have
"getifaddrs()"), after processing the list returned by SIOCGIFCONF, scan
"/proc/net/dev" for interface names, and add to the list of interfaces
entries for those interfaces, with no associated addresses (if the
interfaces were already added, with addresses, from the list returned by
SIOCGIFCONF, they won't get added again).

Clean up the error handling a bit.
2001-10-09 05:43:19 +00:00
guy 5a85948f80 We don't actually use HAVE_FREEIFADDRS, so there's no point in checking
whether we have "freeifaddrs()" (we don't check whether we have
"getifaddrs()", and if we have "getifaddrs()" but not "freeifaddrs()",
we're stuck with leaking memory).

Give the "any" device an instance number of INT_MAX, so it shows up
after all other non-loopback devices.

"getifaddrs()" sometimes appears to supply a destination address even
for non-point-to-point interfaces (it did so on a FreeBSD 4.1 system);
don't use the broadcast address it supplies if an interface isn't a
broadcast interface, and don't use the destination address it supplies
if an interface isn't a point-to-point interface.

If we had an error constructing the list of interfaces, don't attempt to
add the "any" device to the list.
2001-10-09 03:53:38 +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 b92ebafe8e Cast the argument to <ctype.h> macros to "unsigned char", to eliminate
GCC warnings and to keep the macros from referring outside an array when
handed bytes with the 8th bit set.
2001-07-28 22:56:34 +00:00
itojun b63de9ed9e bsdi3 does not have IF_NAMESIZE (kame/bsdi3 has it). have last-resort #define. 2001-06-18 23:43:16 +00:00
torsten 45b3cb247a Added support for an "any" device based on a patch from Sebastian Krahmer. 2000-09-20 15:10:28 +00:00
assar 6019517c9b ISLOOPBACK_IFA: add
(pcap_lookupdev): handle device names without numbers.  based on a
patch from Rafal Maszkowski <rzm@icm.edu.pl>
2000-07-29 07:42:48 +00:00
assar 0e2f8c8892 add config.h, remove gnuc.h. remove __dead 2000-07-11 00:37:04 +00:00
assar ae9e9d40b5 remove non-STDC code 2000-07-01 03:33:48 +00:00
itojun 466c37aaa3 s/PCAP_ERRBUFF_SIZE/PCAP_ERRBUF_SIZE/ (fatal typo) 2000-04-27 14:24:11 +00:00
itojun c867b499b0 strncpy -> strlcpy where more appropriate 2000-04-27 11:18:02 +00:00
itojun 20d9e08cde do not use sprintf(). always use snprintf().
from NetBSD/OpenBSD src/lib/libpcap.

use freeifaddrs() if exists.
2000-04-27 09:11:11 +00:00
itojun 14b709dd48 make loopback interface detection consistent. /^(lo|lo[0-9])$/ 2000-04-13 04:58:09 +00:00
assar 00031c93a7 (pcap_lookupdev): solaris seems to return EINVAL when the buffer is
not large enough, so interpret that as that we should try again with a
larger buffer
2000-04-09 20:59:31 +00:00
itojun 03cc04a438 use getifaddrs whenever available.
SIOCGIFCONF is very complex API, so it would be good to avoid it whenever
possible.
2000-02-23 11:39:44 +00:00
mcr dba6e9e734 fix to problem with buf being referenced after it is freed. 2000-01-14 23:55:31 +00:00
itojun f1456fa8f9 change warning message on SIOCGIFADDR failure.
tcpdump: WARNING: gif0: no IPv4 address assigned
2000-01-13 17:08:59 +00:00
assar f6b3da8cbc (pcap_lookupdev): fix stupid bug in previous commit 1999-11-17 06:10:06 +00:00
assar 58b8bd4a26 (pcap_lookupdev): rewrite the SIOCGIFCONF to dynamically allocate
memory
1999-11-17 06:06:25 +00:00
mcr b11ddf8a9b Initial revision 1999-10-07 23:46:40 +00:00