ipsec_subnetof (3) - Linux Manuals
ipsec_subnetof: given Internet address and subnet mask return subnet number, host part, broadcast address
NAMEipsec_subnetof, ipsec_hostof, ipsec_broadcastof - given Internet address and subnet mask return subnet number, host part, broadcast address
struct in_addr subnetof(struct in_addr addr,
struct in_addr hostof(struct in_addr addr,
struct in_addr broadcastof(struct in_addr addr,
DESCRIPTIONThese functions are obsolete; see ipsec_networkof(3) for their replacements.
Subnetof takes an Internet address and a subnet mask and returns the network part of the address (all in network byte order). Hostof similarly returns the host part, and broadcastof returns the broadcast address (all-1s convention) for the network.
HISTORYWritten for the FreeS/WAN project by Henry Spencer.
BUGSCalling functions for this is more costly than doing it yourself.