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-usb-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-usb-linux.c')
-rw-r--r-- | pcap-usb-linux.c | 12 |
1 files changed, 6 insertions, 6 deletions
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); |