Returns the network address and subnet mask for a network device.
pcap Library (libpcap.a)
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.
|device||Specifies the name of the network device to use for the network lookup, for example, en0.|
|errbuf||Returns error text and is only set when the pcap_lookupnet subroutine fails.|
|maskp||Holds the subnet mask associated with device.|
|netp||Holds the network address for the 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.