Obtains the name of a network device on the system.
pcap Library (libpcap.a)
char *pcap_lookupdev(char * errbuf);
The pcap_lookupdev subroutine gets a network device suitable for use with the pcap_open_live and the pcap_lookupnet subroutines. If no interface can be found, or none are configured to be up, Null is returned. In the case of multiple network devices attached to the system, the pcap_lookupdev subroutine returns the first one it finds to be up, other than the loopback interface. (Loopback is always ignored.)
|errbuf||Returns error text and is only set when the pcap_lookupdev subroutine fails.|
Upon successful completion, the pcap_lookupdev subroutine returns a pointer to the name of a network device attached to the system. If pcap_lookupdev subroutine is unsuccessful, Null is returned, and text indicating the specific error is written to errbuf.
The pcap_geterr (pcap_geterr Subroutine) subroutine, pcap_lookupnet (pcap_lookupnet Subroutine) subroutine, pcap_open_live (pcap_open_live Subroutine) subroutine, pcap_perror (pcap_perror Subroutine) subroutine.