1PCAP_LOOKUPNET(3PCAP) PCAP_LOOKUPNET(3PCAP)
2
3
4
6 pcap_lookupnet - find the IPv4 network number and netmask for a device
7
9 #include <pcap/pcap.h>
10
11 char errbuf[PCAP_ERRBUF_SIZE];
12
13 int pcap_lookupnet(const char *device, bpf_u_int32 *netp,
14 bpf_u_int32 *maskp, char *errbuf);
15
17 pcap_lookupnet() is used to determine the IPv4 network number and mask
18 associated with the network device device. Both netp and maskp are
19 bpf_u_int32 pointers.
20
22 pcap_lookupnet() returns 0 on success and -1 on failure. If -1 is
23 returned, errbuf is filled in with an appropriate error message.
24 errbuf is assumed to be able to hold at least PCAP_ERRBUF_SIZE chars.
25
27 pcap(3PCAP)
28
29
30
31 3 January 2014 PCAP_LOOKUPNET(3PCAP)