1 .TH IPSEC_INITSUBNET 3 "12 March 2002"
2 .\" RCSID $Id: initsubnet.3,v 1.1 2004/03/15 20:35:26 as Exp $
4 ipsec initsubnet \- initialize an ip_subnet
6 ipsec addrtosubnet \- initialize a singleton ip_subnet
8 ipsec subnettypeof \- get address type of an ip_subnet
10 ipsec masktocount \- convert subnet mask to bit count
12 ipsec networkof \- get base address of an ip_subnet
14 ipsec maskof \- get subnet mask of an ip_subnet
16 .B "#include <freeswan.h>"
18 .B "const char *initsubnet(const ip_address *addr,"
20 .B "int maskbits, int clash, ip_subnet *dst);"
22 .B "const char *addrtosubnet(const ip_address *addr,"
26 .B "int subnettypeof(const ip_subnet *src);"
28 .B "int masktocount(const ip_address *src);"
30 .B "void networkof(const ip_subnet *src, ip_address *dst);"
32 .B "void maskof(const ip_subnet *src, ip_address *dst);"
36 library uses an internal type
38 to contain a description of an IP subnet
39 (base address plus mask).
40 These functions provide basic tools for creating and examining this type.
43 initializes a variable
47 from a base address and
51 parameter specifies what to do if the base address includes
53 bits outside the prefix specified by the mask
54 (that is, in the ``host number'' part of the address):
57 zero out host-number bits
59 non-zero host-number bits are an error
66 a pointer to a string-literal error message for failure;
74 to a ``singleton subnet'' containing the single address
79 a pointer to a string-literal error message for failure.
82 returns the address type of a subnet,
89 header file arranges to include the necessary headers for these
93 converts a subnet mask, expressed as an address, to a bit count
98 for error; see DIAGNOSTICS.
103 with the base address of subnet
109 with the subnet mask of subnet
111 expressed as an address.
113 inet(3), ipsec_ttosubnet(3), ipsec_rangetosubnet(3)
118 unknown address family;
122 impossible mask bit count;
123 non-zero host-number bits and
130 unknown address family.
134 unknown address family;
135 mask bits not contiguous.
137 Written for the FreeS/WAN project by Henry Spencer.