1PCAP_LOOKUPDEV(3PCAP)                                    PCAP_LOOKUPDEV(3PCAP)
2
3
4

NAME

6       pcap_lookupdev - find the default device on which to capture
7

SYNOPSIS

9       #include <pcap/pcap.h>
10
11       char errbuf[PCAP_ERRBUF_SIZE];
12
13       [DEPRECATED] char *pcap_lookupdev(char *errbuf);
14

DESCRIPTION

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(3PCAP)  and
23       pcap_activate(3PCAP),   or   with   pcap_open_live(3PCAP),   and   with
24       pcap_lookupnet(3PCAP).   If  there  is  an  error, NULL is returned and
25       errbuf is filled in with  an  appropriate  error  message.   errbuf  is
26       assumed to be able to hold at least PCAP_ERRBUF_SIZE chars.
27

SEE ALSO

29       pcap(3PCAP)
30

BUGS

32       The  pointer  returned  by  pcap_lookupdev() points to a static buffer;
33       subsequent calls to pcap_lookupdev() in the same thread,  or  calls  to
34       pcap_lookupdev() in another thread, may overwrite that buffer.
35
36       In  WinPcap,  this  function  may return a UTF-16 string rather than an
37       ASCII or UTF-8 string.
38
39
40
41
42                               8 September 2017          PCAP_LOOKUPDEV(3PCAP)
Impressum