diff options
author | Guy Harris <guy@alum.mit.edu> | 2016-12-24 15:22:39 -0800 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2016-12-24 15:22:39 -0800 |
commit | 9a65638f0c05099bd34c09defb368eda17ffc331 (patch) | |
tree | df7bc508c9a1996b31a6bcf8f7cd99bf228a4f4d /pcap-int.h | |
parent | 286997feb3660c16837c2c989435da6287755c59 (diff) | |
download | libpcap-9a65638f0c05099bd34c09defb368eda17ffc331.tar.gz |
Have separate "find device" and "find or add device" routines.
Use the "find device" routine for CSPi's Myricom adapters; those
adapters can appear as regular network interfaces, but, when we
enumerate the Myricom adapters, we want to update the description for
those adapters, rather than adding separate entries for them. While
we're at it, add comments to packet-snf.c explaining this.
Fix some comments and some indentation while we're at it.
Diffstat (limited to 'pcap-int.h')
-rw-r--r-- | pcap-int.h | 11 |
1 files changed, 8 insertions, 3 deletions
@@ -404,14 +404,18 @@ int pcap_check_activated(pcap_t *); /* * Internal interfaces for "pcap_findalldevs()". * - * "pcap_platform_finddevs()" is a platform-dependent routine to + * "pcap_platform_finddevs()" is the platform-dependent routine to * find local network interfaces. * * "pcap_findalldevs_interfaces()" is a helper to find those interfaces * using the "standard" mechanisms (SIOCGIFCONF, "getifaddrs()", etc.). * - * "pcap_add_if()" adds an interface to the list of interfaces, for - * use by various "find interfaces" routines. + * "add_dev()" adds an entry to a pcap_if_list_t. + * + * "find_dev()" tries to find a device, by name, in a pcap_if_list_t. + * + * "find_or_add_dev()" checks whether a device is already in a pcap_if_list_t + * and, if not, adds an entry for it. */ int pcap_platform_finddevs(pcap_if_t **, char *); #if !defined(_WIN32) && !defined(MSDOS) @@ -420,6 +424,7 @@ int pcap_findalldevs_interfaces(pcap_if_t **, char *, #endif pcap_if_t *find_or_add_dev(pcap_if_t **, const char *, bpf_u_int32, const char *, char *); +pcap_if_t *find_dev(pcap_if_t **, const char *); pcap_if_t *add_dev(pcap_if_t **, const char *, bpf_u_int32, const char *, char *); int add_addr_to_dev(pcap_if_t *, struct sockaddr *, size_t, |