1 .TH IPSEC_SUBNETOF 3 "11 June 2001"
2 .\" RCSID $Id: subnetof.3,v 1.5 2001/06/11 23:08:00 henry Exp $
4 ipsec subnetof \- given Internet address and subnet mask, return subnet number
6 ipsec hostof \- given Internet address and subnet mask, return host part
8 ipsec broadcastof \- given Internet address and subnet mask, return broadcast address
10 .B "#include <freeswan.h>
12 .B "struct in_addr subnetof(struct in_addr addr,"
14 .B "struct in_addr mask);"
16 .B "struct in_addr hostof(struct in_addr addr,"
18 .B "struct in_addr mask);"
20 .B "struct in_addr broadcastof(struct in_addr addr,"
22 .B "struct in_addr mask);"
24 These functions are obsolete; see
25 .IR ipsec_networkof (3)
26 for their replacements.
33 and returns the network part of the address
34 (all in network byte order).
36 similarly returns the host part, and
38 returns the broadcast address (all-1s convention) for the network.
40 These functions are provided to hide the Internet bit-munging inside
41 an API, in hopes of easing the eventual transition to IPv6.
43 inet(3), ipsec_atosubnet(3)
45 Written for the FreeS/WAN project by Henry Spencer.
47 Calling functions for this is more costly than doing it yourself.