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: 8 Sept 2000<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 subnettypeof - get address type of an ip_subnet
19 ipsec masktocount - convert subnet mask to bit count
22 ipsec networkof - get base address of an ip_subnet
25 ipsec maskof - get subnet mask (as address) of an ip_subnet
26 <A NAME="lbAC"> </A>
29 <B>#include <<A HREF="file:/usr/include/freeswan.h">freeswan.h</A>></B>
32 <B>const char *initsubnet(const ip_address *addr, int maskbits,</B>
36 <B>int clash, ip_subnet *dst);</B>
39 <B>int subnettypeof(const ip_subnet *src);</B>
43 <B>int masktocount(const ip_address *src);</B>
47 <B>void networkof(const ip_subnet *src, ip_address *dst);</B>
51 <B>void maskof(const ip_subnet *src, ip_address *dst);</B>
53 <A NAME="lbAD"> </A>
57 <B><<A HREF="file:/usr/include/freeswan.h">freeswan.h</A>></B>
59 library uses an internal type
62 to contain a description of an IP subnet
63 (base address plus mask).
64 These functions provide basic tools for creating and examining this type.
69 initializes a variable
75 from a base address and
80 parameter specifies what to do if the base address includes
83 bits outside the prefix specified by the mask
84 (that is, in the ``host number'' part of the address):
88 zero out host-number bits
90 non-zero host-number bits are an error
102 a pointer to a string-literal error message for failure;
108 returns the address type of a subnet,
116 <B><<A HREF="file:/usr/include/freeswan.h">freeswan.h</A>></B>
118 header file arranges to include the necessary headers for these
124 converts a subnet mask, expressed as an address, to a bit count
125 suitable for use with
131 for error; see DIAGNOSTICS.
139 with the base address of subnet
149 with the subnet mask of subnet
152 expressed as an address.
153 <A NAME="lbAE"> </A>
156 <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)
157 <A NAME="lbAF"> </A>
164 unknown address family;
169 impossible mask bit count;
170 non-zero host-number bits and
180 unknown address family;
181 mask bits not contiguous.
182 <A NAME="lbAG"> </A>
185 Written for the FreeS/WAN project by Henry Spencer.
189 <A NAME="index"> </A><H2>Index</H2>
191 <DT><A HREF="#lbAB">NAME</A><DD>
192 <DT><A HREF="#lbAC">SYNOPSIS</A><DD>
193 <DT><A HREF="#lbAD">DESCRIPTION</A><DD>
194 <DT><A HREF="#lbAE">SEE ALSO</A><DD>
195 <DT><A HREF="#lbAF">DIAGNOSTICS</A><DD>
196 <DT><A HREF="#lbAG">HISTORY</A><DD>
199 This document was created by
200 <A HREF="http://localhost/cgi-bin/man/man2html">man2html</A>,
201 using the manual pages.<BR>
202 Time: 05:09:32 GMT, June 19, 2001