Lines Matching +defs:device +defs:mode

257 	 * may mean a library is initializing pcap in one mode and
259 * that program, is initializing it in another mode.
264 /* Leave "UTF-8 mode" off. */
275 /* Turn on "UTF-8 mode". */
292 * Turn the appropriate mode on for error messages; those routines
294 * UTF-8 mode flag, so we have to call a routine to set its
295 * UTF-8 mode flag.
344 "This operation isn't properly handled by that device");
426 pcap_setmode_not_initialized(pcap_t *pcap, int mode _U_)
503 * Returns 1 if rfmon mode can be set on the pcap_t, 0 if it can't,
513 * For systems where rfmon mode is never supported.
800 * useful as a sort key for device names with the same prefix, so xyz0
824 * might run the adapter in some flavor of monitor mode.
838 * Sort the "any" device before loopback and disconnected devices,
849 * Try to get a description for a given device.
866 * string based on the device type or something such as that.
977 * a device with a name of the form usbusN, label it as a USB
1017 * Look for a given device in the specified list of devices.
1040 * We don't have IFF_LOOPBACK, so look at the device name to
1041 * see if it looks like a loopback device.
1057 * Attempt to find an entry for this device; if we don't find one,
1065 * Look for a given device in the specified list of devices.
1068 * the list of addresses for the device and return 0.
1094 * Check whether the device exists and, if not, add it.
1235 * Look for a given device in the specified list of devices.
1250 * Is there already an entry in the list for this device?
1265 * Try to get additional flags for the device.
1281 * Look for a given device in the specified list of devices, and return
1290 * Is there an entry in the list for this device?
1311 * Attempt to add an entry for a device, with the specified flags
1439 * Add an entry for the "any" device.
1444 static const char any_descr[] = "Pseudo-device that captures on all interfaces";
1448 * network device, the notion of "connected" vs. "disconnected"
1449 * doesn't apply to the "any" device.
1540 static char device[IF_NAMESIZE + 1];
1544 * We disable this in "new API" mode, because 1) in WinPcap/Npcap,
1564 * There are no devices on the list, or the first device
1565 * on the list is a loopback device, which means there
1567 * we can't return any device.
1569 * XXX - why not return a loopback device? If we can't
1572 * so why not just supply it as the default device?
1574 (void)pcapint_strlcpy(errbuf, "no suitable device found",
1579 * Return the name of the first device on the list.
1581 (void)pcapint_strlcpy(device, alldevs->name, sizeof(device));
1582 ret = device;
1593 * particular device, and use its first IPv4 address, as that's too
1594 * much work to get just one device's netmask.
1596 * If we had an API to get attributes for a given device, we could
1600 pcap_lookupnet(const char *device, bpf_u_int32 *netp, bpf_u_int32 *maskp,
1608 * The pseudo-device "any" listens on all interfaces and therefore
1612 if (!device || strcmp(device, "any") == 0
1614 || strstr(device, "dag") != NULL
1617 || strstr(device, "septel") != NULL
1620 || strstr(device, "bluetooth") != NULL
1623 || strstr(device, "usbmon") != NULL
1626 || strstr(device, "snf") != NULL
1629 || strncmp(device, "netmap:", 7) == 0
1630 || strncmp(device, "vale", 4) == 0
1633 || strncmp(device, "dpdk:", 5) == 0
1651 (void)pcapint_strlcpy(ifr.ifr_name, device, sizeof(ifr.ifr_name));
1667 "%s: no IPv4 address assigned", device);
1670 errno, "SIOCGIFADDR: %s", device);
1682 (void)pcapint_strlcpy(ifr.ifr_name, device, sizeof(ifr.ifr_name));
1690 errno, "SIOCGIFNETMASK: %s", device);
1743 * If source is a URL, and the URL refers to a local device (a special
1745 * to NULL, *pathp is set to point to the device name, and 0 is returned.
1748 * device, and the parse succeeds:
1816 * The source is the device to open.
1818 * host, and port, and return the device as the path.
1836 * We need that in order to distinguish between a local device
1841 * The source is the device to open.
1843 * host, and port, and return the device as the path.
1890 * interface with "rpcap://{device}"; we special-case
1892 * no slashes past the "//", we just return the device.
1900 * Local device.
1903 * host, and port, and return the device as the path.
2208 * Local device.
2234 * rpcap[s]://device
2275 * as a local device.
2298 pcap_create(const char *device, char *errbuf)
2306 * A null device name is equivalent to the "any" device -
2312 if (device == NULL)
2319 * pairs of UTF-16LE device names and local code page
2323 * to get a default device, and hands that to an API
2332 * We disable that check in "new API" mode, because:
2348 * That's why we disable this in "new API" mode.
2349 * We keep it around in legacy mode for backwards
2352 if (!pcapint_new_api && device[0] != '\0' && device[1] == '\0') {
2355 length = wcslen((wchar_t *)device);
2365 (const wchar_t *)device);
2368 device_str = strdup(device);
2379 * device or run out of types.
2387 * The device name refers to a device of the
2390 * later activate for the device, or it
2402 p->opt.device = device_str;
2418 p->opt.device = device_str;
2423 * Set nonblocking mode on an unactivated pcap_t; this sets a flag
2424 * checked by pcap_activate(), which sets the mode after calling
2539 * Default to "can't set rfmon mode"; if it's supported by
2542 * device supports it.
2549 * on non-blocking mode when activated.
2770 * If somebody requested non-blocking mode before
2808 pcap_open_live(const char *device, int snaplen, int promisc, int to_ms, char *errbuf)
2819 * A null device name is equivalent to the "any" device -
2825 if (device == NULL)
2826 device = "any";
2837 if (pcap_parsesrcstr(device, &srctype, host, port, name, errbuf))
2843 * to pass only 'device' to pcap_open_rpcap(), so that it has
2847 return (pcap_open_rpcap(device, snaplen,
2857 * If it starts with rpcap://, that refers to a local device
2861 if (strncmp(device, PCAP_SRC_IF_STRING, strlen(PCAP_SRC_IF_STRING)) == 0) {
2862 size_t len = strlen(device) - strlen(PCAP_SRC_IF_STRING) + 1;
2865 device += strlen(PCAP_SRC_IF_STRING);
2870 p = pcap_create(device, errbuf);
2886 * when not in monitor mode. That allows existing applications
2890 * the adapter is in monitor mode or not.
2906 snprintf(errbuf, PCAP_ERRBUF_SIZE, "%s: %.*s", device,
2923 device, pcap_statustostr(status),
2927 device, pcap_statustostr(status));
2930 snprintf(errbuf, PCAP_ERRBUF_SIZE, "%s: %s", device,
3022 * containing only the DLT this device supports.
3095 * This is presumably an Ethernet device, as the first
3117 "%s is not one of the DLTs supported by this device",
3121 "DLT %d is not one of the DLTs supported by this device",
3602 * Get the current non-blocking mode setting, under the assumption that
3647 * Set non-blocking mode, under the assumption that it's just the
3649 * per-platform non-blocking-mode routine if that routine also
3690 return ("That type of time stamp is not supported by that device");
3693 return ("That device doesn't support promiscuous mode");
3708 return ("No such device exists");
3711 return ("That device doesn't support monitor mode");
3714 return ("That operation is supported only in monitor mode");
3717 return ("You don't have permission to perform this capture on that device");
3720 return ("That device is not up");
3723 return ("That device doesn't support setting the time stamp type");
3726 return ("You don't have permission to capture in promiscuous mode on that device");
3729 return ("That device doesn't support that time stamp precision");
3732 return ("Packet capture is not supported on that device");
3849 "Setting direction is not supported on this device");
3893 pcap_setmode(pcap_t *p, int mode)
3895 return (p->setmode_op(p, mode));
4003 "This isn't an AirPcap device");
4010 * On some platforms, we need to clean up promiscuous or monitor mode
4011 * when we close a device - and we want that to happen even if the
4127 if (p->opt.device != NULL) {
4128 free(p->opt.device);
4129 p->opt.device = NULL;
4310 "Rfmon mode doesn't apply on a pcap_open_dead pcap_t");
4373 "A pcap_open_dead pcap_t does not have a non-blocking mode setting");
4381 "A pcap_open_dead pcap_t does not have a non-blocking mode setting");
4411 pcap_setmode_dead(pcap_t *p, int mode _U_)
4414 "impossible to set mode on a pcap_open_dead pcap_t");