From: Guy Harris Date: Fri, 8 Sep 2017 10:42:39 +0000 (-0700) Subject: Deprecate this function, and indicate why it's not a good function. X-Git-Tag: libpcap-1.9-bp~745 X-Git-Url: https://git.tcpdump.org/libpcap/commitdiff_plain/1a50c82211fce5bc5a3e12744b25161999b703d8 Deprecate this function, and indicate why it's not a good function. --- diff --git a/pcap_lookupdev.3pcap b/pcap_lookupdev.3pcap index aaa3a201..45c4ef8b 100644 --- a/pcap_lookupdev.3pcap +++ b/pcap_lookupdev.3pcap @@ -32,10 +32,18 @@ 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 @@ -58,3 +66,15 @@ chars. .SH SEE ALSO pcap(3PCAP), pcap_create(3PCAP), pcap_activate(3PCAP), pcap_open_live(3PCAP), pcap_lookupnet(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. +