1 Content-type: text/html
3 <HTML><HEAD><TITLE>Manpage of IPSEC_INITSUBNET
</TITLE>
5 <H1>IPSEC_INITSUBNET
</H1>
6 Section: C Library Functions (
3)
<BR>Updated:
12 March
2002<BR><A HREF=
"#index">Index
</A>
7 <A HREF=
"http://localhost/cgi-bin/man/man2html">Return to Main Contents
</A><HR>
10 <A NAME=
"lbAB"> </A>
13 ipsec initsubnet - initialize an ip_subnet
16 ipsec addrtosubnet - initialize a singleton ip_subnet
19 ipsec subnettypeof - get address type of an ip_subnet
22 ipsec masktocount - convert subnet mask to bit count
25 ipsec networkof - get base address of an ip_subnet
28 ipsec maskof - get subnet mask of an ip_subnet
29 <A NAME=
"lbAC"> </A>
32 <B>#include
<<A HREF=
"file:/usr/include/freeswan.h">freeswan.h
</A>></B>
35 <B>const char *initsubnet(const ip_address *addr,
</B>
39 <B>int maskbits, int clash, ip_subnet *dst);
</B>
43 <B>const char *addrtosubnet(const ip_address *addr,
</B>
47 <B>ip_subnet *dst);
</B>
50 <B>int subnettypeof(const ip_subnet *src);
</B>
54 <B>int masktocount(const ip_address *src);
</B>
58 <B>void networkof(const ip_subnet *src, ip_address *dst);
</B>
62 <B>void maskof(const ip_subnet *src, ip_address *dst);
</B>
64 <A NAME=
"lbAD"> </A>
68 <B><<A HREF=
"file:/usr/include/freeswan.h">freeswan.h
</A>></B>
70 library uses an internal type
73 to contain a description of an IP subnet
74 (base address plus mask).
75 These functions provide basic tools for creating and examining this type.
80 initializes a variable
86 from a base address and
91 parameter specifies what to do if the base address includes
94 bits outside the prefix specified by the mask
95 (that is, in the ``host number'' part of the address):
99 zero out host-number bits
101 non-zero host-number bits are an error
113 a pointer to a string-literal error message for failure;
125 to a ``singleton subnet'' containing the single address
132 a pointer to a string-literal error message for failure.
137 returns the address type of a subnet,
145 <B><<A HREF=
"file:/usr/include/freeswan.h">freeswan.h
</A>></B>
147 header file arranges to include the necessary headers for these
153 converts a subnet mask, expressed as an address, to a bit count
154 suitable for use with
160 for error; see DIAGNOSTICS.
168 with the base address of subnet
178 with the subnet mask of subnet
181 expressed as an address.
182 <A NAME=
"lbAE"> </A>
185 <A HREF=
"inet.3.html">inet
</A>(
3),
<A HREF=
"ipsec_ttosubnet.3.html">ipsec_ttosubnet
</A>(
3),
<A HREF=
"ipsec_rangetosubnet.3.html">ipsec_rangetosubnet
</A>(
3)
186 <A NAME=
"lbAF"> </A>
193 unknown address family;
198 impossible mask bit count;
199 non-zero host-number bits and
209 unknown address family.
214 unknown address family;
215 mask bits not contiguous.
216 <A NAME=
"lbAG"> </A>
219 Written for the FreeS/WAN project by Henry Spencer.
223 <A NAME=
"index"> </A><H2>Index
</H2>
225 <DT><A HREF=
"#lbAB">NAME
</A><DD>
226 <DT><A HREF=
"#lbAC">SYNOPSIS
</A><DD>
227 <DT><A HREF=
"#lbAD">DESCRIPTION
</A><DD>
228 <DT><A HREF=
"#lbAE">SEE ALSO
</A><DD>
229 <DT><A HREF=
"#lbAF">DIAGNOSTICS
</A><DD>
230 <DT><A HREF=
"#lbAG">HISTORY
</A><DD>
233 This document was created by
234 <A HREF=
"http://localhost/cgi-bin/man/man2html">man2html
</A>,
235 using the manual pages.
<BR>
236 Time:
21:
40:
18 GMT, November
11,
2003