Lines Matching defs:device
62 #define AUTO_CLONE_IF_DESCRIPTION "libpcap auto cloned device"
70 char device[sizeof "/dev/bpf0000000000"];
75 * Find an available device
78 (void)snprintf(device, sizeof(device), "/dev/bpf%d", n++);
80 fd = open(device, O_RDONLY);
151 pcap_setup_pktap_interface(const char *device, char *ebuf)
180 if (strncmp(device, PKTAP_IFNAME, strlen(PKTAP_IFNAME)) == 0) {
187 pktap_param = strchr(device, ',');
193 tocopy = pktap_param - device;
195 tocopy = strlen(device);
197 snprintf(ebuf, PCAP_ERRBUF_SIZE, "device name too long: %s",
201 bcopy(device, ifname, tocopy);
205 * Create a device instance when no unit number is specified
208 } else if (strcmp(device, "all") == 0 || strcmp(device, "any") == 0) {
212 } else if (strncmp(device, IPTAP_IFNAME, strlen(IPTAP_IFNAME)) == 0) {
218 if (strlcpy(ifname, device, PKTAP_IFXNAMESIZE) >= PKTAP_IFXNAMESIZE) {
219 snprintf(ebuf, PCAP_ERRBUF_SIZE, "device name too long: %s",
224 * Create a device instance when no unit number is specified
228 snprintf(ebuf, PCAP_ERRBUF_SIZE, "bad device name: %s",
404 pcap_create_pktap_device(const char *device, char *ebuf, size_t size)
409 ifname = pcap_setup_pktap_interface(device, ebuf);