]> The Tcpdump Group git mirrors - libpcap/blobdiff - pcap-linux.c
Added initial support for canusb devices.
[libpcap] / pcap-linux.c
index c722badf5704b45021ac65c915ba3f164345a3aa..3994c30a03f691fc1f35f6c6ae85fafa3f8e9793 100644 (file)
@@ -166,6 +166,10 @@ static const char rcsid[] _U_ =
 #include "pcap-can-linux.h"
 #endif
 
+#if PCAP_SUPPORT_CANUSB
+#include "pcap-canusb-linux.h"
+#endif
+
 #ifdef PCAP_SUPPORT_NETFILTER
 #include "pcap-netfilter-linux.h"
 #endif
@@ -418,6 +422,13 @@ pcap_create(const char *device, char *ebuf)
        }
 #endif
 
+#if PCAP_SUPPORT_CANUSB
+  if (strstr(device, "canusb")) {
+    return canusb_create(device, ebuf);
+  }
+#endif
+
+
 #ifdef PCAP_SUPPORT_CAN
        if (strstr(device, "can") || strstr(device, "vcan")) {
                return can_create(device, ebuf);
@@ -2299,6 +2310,11 @@ pcap_platform_finddevs(pcap_if_t **alldevsp, char *errbuf)
                return (-1);
 #endif
 
+#if PCAP_SUPPORT_CANUSB
+  if (canusb_platform_finddevs(alldevsp, errbuf) < 0)
+    return (-1);
+#endif
+
        return (0);
 }