1PCAP_LOOKUPDEV(3PCAP) PCAP_LOOKUPDEV(3PCAP)
2
3
4
6 pcap_lookupdev - find the default device on which to capture
7
9 #include <pcap/pcap.h>
10
11 char errbuf[PCAP_ERRBUF_SIZE];
12
13 [DEPRECATED] char *pcap_lookupdev(char *errbuf);
14
16 This interface is obsoleted by pcap_findalldevs(3PCAP). To find a
17 default device on which to capture, call pcap_findalldevs() and, if the
18 list it returns is not empty, use the first device in the list. (If
19 the list is empty, there are no devices on which capture is possible.)
20
21 pcap_lookupdev() returns a pointer to a string giving the name of a
22 network device suitable for use with pcap_create() and pcap_activate(),
23 or with pcap_open_live(), and with pcap_lookupnet(). If there is an
24 error, NULL is returned and errbuf is filled in with an appropriate
25 error message. errbuf is assumed to be able to hold at least
26 PCAP_ERRBUF_SIZE chars.
27
29 pcap(3PCAP), pcap_create(3PCAP), pcap_activate(3PCAP),
30 pcap_open_live(3PCAP), pcap_lookupnet(3PCAP)
31
33 The pointer returned by pcap_lookupdev() points to a static buffer;
34 subsequent calls to pcap_lookupdev() in the same thread, or calls to
35 pcap_lookupdev() in another thread, may overwrite that buffer.
36
37 In WinPcap, this function may return a UTF-16 string rather than an
38 ASCII or UTF-8 string.
39
40
41
42
43 8 September 2017 PCAP_LOOKUPDEV(3PCAP)