Returns the network address and subnet mask for a network device.
pcap Library (libpcap.a)
#include <pcap.h>
int pcap_lookupnet(char * device, bpf_u_int32 * netp, bpf_u_int32 * maskp,
char * errbuf);
Use the pcap_lookupnet subroutine to determine the network address and subnet mask for the network device, device.
Upon successful completion, the pcap_lookupnet subroutine returns 0. If the pcap_lookupnet subroutine is unsuccessful, -1 is returned, and errbuf is filled in with an appropriate error message.
The pcap_compile (pcap_compile Subroutine) subroutine, pcap_geterr (pcap_geterr Subroutine) subroutine, pcap_lookupdev (pcap_lookupdev Subroutine) subroutine, pcap_perror (pcap_perror Subroutine) subroutine.