April 2005
Intermediate to advanced
344 pages
11h 59m
English
pcap_lookupnet — Prototype: int pcap_lookupnet(const char *device, bpf_u_int32 *netp, bpf_u_int32
*maskp, char *errbuf)
Purpose: pcap_lookupnet returns the network
address and network mask of the device supplied in the device
parameter. The function returns 0 if successful
and netp and maskp point to the
network interface address and netmask, respectively. If an error
occurs, pcap_lookupnet returns
-1, and errbuf is populated
with a human-readable error message. You can find an example of using
the pcap_lookupnet function in the Section 10.2.4
section earlier in this chapter.
Read now
Unlock full access