ipsec_subnetof (3) - Linux Manuals
ipsec_subnetof: given Internet address and subnet mask return subnet number, host part, broadcast address
Command to display ipsec_subnetof
manual in Linux: $ man 3 ipsec_subnetof
NAME
ipsec_subnetof, ipsec_hostof, ipsec_broadcastof - given Internet address and subnet mask return subnet number, host part, broadcast address
SYNOPSIS
#include <libreswan.h>
struct in_addr subnetof(struct in_addr addr,
struct in_addr mask);
struct in_addr hostof(struct in_addr addr,
struct in_addr mask);
struct in_addr broadcastof(struct in_addr addr,
struct in_addr mask);
DESCRIPTION
These 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.
These functions are provided to hide the Internet bit-munging inside
an API, in hopes of easing the eventual transition to IPv6.
HISTORY
Written for the FreeS/WAN project by Henry Spencer.
BUGS
Calling functions for this is more costly than doing it yourself.
Pages related to ipsec_subnetof
- ipsec_sameaddr (3) - do comparisons for addresses, subnets, SA IDs and address families
- ipsec_anyaddr (3) - get and test for addresses of type "any", "unspecified" and loopback
- ipsec_atoaddr (3) - convert Internet addresses and Subnet masks to and from ASCII
- ipsec_atoasr (3) - convert ASCII to Internet address, subnet, or range, convert Internet address range to ASCII
- ipsec_atoul (3) - convert unsigned-long numbers to and from ASCII
- ipsec_goodmask (3) - check if Internet subnet mask is valid, convert Internet subnet mask to bit count, convert bit count to Internet subnet mask
- ipsec_initaddr (3) - initialize an ip_address, get address type of an ip_address, get length of address within an ip_address, get copy of address within an ip_address, get pointer to address within an ip_address
- ipsec_initsubnet (3) - initialize an ip_subnet, initialize a singleton ip_subnet, get address type of an ip_subnet, convert subnet mask to bit count, get base address of an ip_subnet, get subnet mask of an ip_subnet
- ipsec_portof (3) - get port field of an ip_address, set port field of an ip_address, get pointer to internal sockaddr of an ip_address, get length of internal sockaddr of an ip_address
- ipsec_rangetosubnet (3) - convert address range to subnet