diff options
Diffstat (limited to 'pcap_lookupdev.3pcap')
-rw-r--r-- | pcap_lookupdev.3pcap | 35 |
1 files changed, 27 insertions, 8 deletions
diff --git a/pcap_lookupdev.3pcap b/pcap_lookupdev.3pcap index 79dda42..29f09e3 100644 --- a/pcap_lookupdev.3pcap +++ b/pcap_lookupdev.3pcap @@ -17,7 +17,7 @@ .\" WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF .\" MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. .\" -.TH PCAP_LOOKUPDEV 3PCAP "5 April 2008" +.TH PCAP_LOOKUPDEV 3PCAP "8 September 2017" .SH NAME pcap_lookupdev \- find the default device on which to capture .SH SYNOPSIS @@ -32,20 +32,28 @@ char errbuf[PCAP_ERRBUF_SIZE]; .ft .LP .ft B -char *pcap_lookupdev(char *errbuf); +[DEPRECATED] char *pcap_lookupdev(char *errbuf); .ft .fi .SH DESCRIPTION +.B This interface is obsoleted by +.BR pcap_findalldevs (3PCAP). +To find a default device on which to capture, call +.B pcap_findalldevs() +and, if the list it returns is not empty, use the first device in the +list. (If the list is empty, there are no devices on which capture is +possible.) +.LP .B pcap_lookupdev() returns a pointer to a string giving the name of a network device suitable for use with -.B pcap_create() +.B pcap_create(3PCAP) and -.BR pcap_activate() , +.BR \%pcap_activate(3PCAP) , or with -.BR pcap_open_live() , +.BR pcap_open_live(3PCAP) , and with -.BR pcap_lookupnet() . +.BR pcap_lookupnet(3PCAP) . If there is an error, .B NULL is returned and @@ -56,5 +64,16 @@ is assumed to be able to hold at least .B PCAP_ERRBUF_SIZE chars. .SH SEE ALSO -pcap(3PCAP), pcap_create(3PCAP), pcap_activate(3PCAP), -pcap_open_live(3PCAP), pcap_lookupnet(3PCAP) +pcap(3PCAP) +.SH BUGS +The pointer returned by +.B pcap_lookupdev() +points to a static buffer; subsequent calls to +.B pcap_lookupdev() +in the same thread, or calls to +.B pcap_lookupdev() +in another thread, may overwrite that buffer. +.LP +In WinPcap, this function may return a UTF-16 string rather than an +ASCII or UTF-8 string. + |