Returns the network address and subnet mask for a network device.
pcap Library (libpcap.a)
Use the pcap_lookupnet subroutine to determine the network address and subnet mask for the network device, device.
| Item | Description |
|---|---|
| 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.