diff options
author | Guy Harris <guy@alum.mit.edu> | 2017-01-18 13:36:27 -0800 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2017-01-18 13:36:27 -0800 |
commit | 2a6286aa06b043240dd8c3524668455562d466d8 (patch) | |
tree | 062ee1df238c3e113a0451e60bb2b030867ffb17 /pcap-linux.c | |
parent | 5fa9ce62e3235688ce3ed5928cbce7754ec6291c (diff) |
Have a pcap_if_list_t structure for use by the findalldevs code.
It's not part of the API, but it's an internal structure used by the
findalldevs code. Currently, it just has a pointer to the beginning of
the list, but it could change in order to speed up the process of adding
to the list.
Diffstat (limited to 'pcap-linux.c')
-rw-r--r-- | pcap-linux.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/pcap-linux.c b/pcap-linux.c index b9a4bd77..d48fb8c3 100644 --- a/pcap-linux.c +++ b/pcap-linux.c @@ -2230,7 +2230,7 @@ pcap_stats_linux(pcap_t *handle, struct pcap_stat *stats) } static int -add_linux_if(pcap_if_t **devlistp, const char *ifname, int fd, char *errbuf) +add_linux_if(pcap_if_list_t *devlistp, const char *ifname, int fd, char *errbuf) { const char *p; char name[512]; /* XXX - pick a size */ @@ -2319,7 +2319,7 @@ add_linux_if(pcap_if_t **devlistp, const char *ifname, int fd, char *errbuf) * Otherwise, we return 1 if we don't get an error and -1 if we do. */ static int -scan_sys_class_net(pcap_if_t **devlistp, char *errbuf) +scan_sys_class_net(pcap_if_list_t *devlistp, char *errbuf) { DIR *sys_class_net_d; int fd; @@ -2437,7 +2437,7 @@ scan_sys_class_net(pcap_if_t **devlistp, char *errbuf) * See comments from scan_sys_class_net(). */ static int -scan_proc_net_dev(pcap_if_t **devlistp, char *errbuf) +scan_proc_net_dev(pcap_if_list_t *devlistp, char *errbuf) { FILE *proc_net_f; int fd; @@ -2533,14 +2533,14 @@ can_be_bound(const char *name _U_) } int -pcap_platform_finddevs(pcap_if_t **alldevsp, char *errbuf) +pcap_platform_finddevs(pcap_if_list_t *devlistp, char *errbuf) { int ret; /* * Get the list of regular interfaces first. */ - if (pcap_findalldevs_interfaces(alldevsp, errbuf, can_be_bound) == -1) + if (pcap_findalldevs_interfaces(devlistp, errbuf, can_be_bound) == -1) return (-1); /* failure */ /* @@ -2551,21 +2551,21 @@ pcap_platform_finddevs(pcap_if_t **alldevsp, char *errbuf) * interfaces with no addresses, so you need to read "/sys/class/net" * to get the names of the rest of the interfaces. */ - ret = scan_sys_class_net(alldevsp, errbuf); + ret = scan_sys_class_net(devlistp, errbuf); if (ret == -1) return (-1); /* failed */ if (ret == 0) { /* * No /sys/class/net; try reading /proc/net/dev instead. */ - if (scan_proc_net_dev(alldevsp, errbuf) == -1) + if (scan_proc_net_dev(devlistp, errbuf) == -1) return (-1); } /* * Add the "any" device. */ - if (add_dev(alldevsp, "any", PCAP_IF_UP|PCAP_IF_RUNNING, + if (add_dev(devlistp, "any", PCAP_IF_UP|PCAP_IF_RUNNING, any_descr, errbuf) == NULL) return (-1); |