From 2a6286aa06b043240dd8c3524668455562d466d8 Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Wed, 18 Jan 2017 13:36:27 -0800 Subject: 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. --- pcap-usb-linux.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'pcap-usb-linux.c') diff --git a/pcap-usb-linux.c b/pcap-usb-linux.c index 14305a77..bf9a4e5a 100644 --- a/pcap-usb-linux.c +++ b/pcap-usb-linux.c @@ -225,7 +225,7 @@ have_binary_usbmon(void) /* facility to add an USB device to the device list*/ static int -usb_dev_add(pcap_if_t** alldevsp, int n, char *err_str) +usb_dev_add(pcap_if_list_t *devlistp, int n, char *err_str) { char dev_name[10]; char dev_descr[30]; @@ -235,13 +235,13 @@ usb_dev_add(pcap_if_t** alldevsp, int n, char *err_str) else pcap_snprintf(dev_descr, 30, "USB bus number %d", n); - if (add_dev(alldevsp, dev_name, 0, dev_descr, err_str) == NULL) + if (add_dev(devlistp, dev_name, 0, dev_descr, err_str) == NULL) return -1; return 0; } int -usb_findalldevs(pcap_if_t **alldevsp, char *err_str) +usb_findalldevs(pcap_if_list_t *devlistp, char *err_str) { char usb_mon_dir[PATH_MAX]; char *usb_mon_prefix; @@ -292,7 +292,7 @@ usb_findalldevs(pcap_if_t **alldevsp, char *err_str) if (sscanf(&name[usb_mon_prefix_len], "%d", &n) == 0) continue; /* failed */ - ret = usb_dev_add(alldevsp, n, err_str); + ret = usb_dev_add(devlistp, n, err_str); } closedir(dir); @@ -329,7 +329,7 @@ usb_findalldevs(pcap_if_t **alldevsp, char *err_str) if (sscanf(&name[3], "%d", &n) == 0) continue; - ret = usb_dev_add(alldevsp, n, err_str); + ret = usb_dev_add(devlistp, n, err_str); } closedir(dir); @@ -350,7 +350,7 @@ usb_findalldevs(pcap_if_t **alldevsp, char *err_str) if (sscanf(&name[len+1], "%d", &n) != 1) continue; - ret = usb_dev_add(alldevsp, n, err_str); + ret = usb_dev_add(devlistp, n, err_str); } closedir(dir); -- cgit v1.2.3