1
Content-type: text/html
3
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
4
<HTML><HEAD><TITLE>Man page of IPSEC_INITSUBNET</TITLE>
6
<H1>IPSEC_INITSUBNET</H1>
7
Section: C Library Functions (3)<BR>Updated: 12 March 2002<BR><A HREF="#index">Index</A>
8
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
11
<A NAME="lbAB"> </A>
14
ipsec initsubnet - initialize an ip_subnet
17
ipsec addrtosubnet - initialize a singleton ip_subnet
20
ipsec subnettypeof - get address type of an ip_subnet
23
ipsec masktocount - convert subnet mask to bit count
26
ipsec networkof - get base address of an ip_subnet
29
ipsec maskof - get subnet mask of an ip_subnet
30
<A NAME="lbAC"> </A>
33
<B>#include <<A HREF="file:///usr/include/freeswan.h">freeswan.h</A>></B>
36
<B>const char *initsubnet(const ip_address *addr,</B>
40
<B>int maskbits, int clash, ip_subnet *dst);</B>
44
<B>const char *addrtosubnet(const ip_address *addr,</B>
48
<B>ip_subnet *dst);</B>
51
<B>int subnettypeof(const ip_subnet *src);</B>
55
<B>int masktocount(const ip_address *src);</B>
59
<B>void networkof(const ip_subnet *src, ip_address *dst);</B>
63
<B>void maskof(const ip_subnet *src, ip_address *dst);</B>
65
<A NAME="lbAD"> </A>
69
<B><<A HREF="file:///usr/include/freeswan.h">freeswan.h</A>></B>
71
library uses an internal type
74
to contain a description of an IP subnet
75
(base address plus mask).
76
These functions provide basic tools for creating and examining this type.
81
initializes a variable
87
from a base address and
92
parameter specifies what to do if the base address includes
95
bits outside the prefix specified by the mask
96
(that is, in the ``host number'' part of the address):
100
zero out host-number bits
102
non-zero host-number bits are an error
114
a pointer to a string-literal error message for failure;
126
to a ``singleton subnet'' containing the single address
133
a pointer to a string-literal error message for failure.
138
returns the address type of a subnet,
146
<B><<A HREF="file:///usr/include/freeswan.h">freeswan.h</A>></B>
148
header file arranges to include the necessary headers for these
154
converts a subnet mask, expressed as an address, to a bit count
155
suitable for use with
161
for error; see DIAGNOSTICS.
169
with the base address of subnet
179
with the subnet mask of subnet
182
expressed as an address.
183
<A NAME="lbAE"> </A>
186
<A HREF="/cgi-bin/man/man2html?3+inet">inet</A>(3), <A HREF="/cgi-bin/man/man2html?3+ipsec_ttosubnet">ipsec_ttosubnet</A>(3), <A HREF="/cgi-bin/man/man2html?3+ipsec_rangetosubnet">ipsec_rangetosubnet</A>(3)
187
<A NAME="lbAF"> </A>
194
unknown address family;
199
impossible mask bit count;
200
non-zero host-number bits and
210
unknown address family.
215
unknown address family;
216
mask bits not contiguous.
217
<A NAME="lbAG"> </A>
220
Written for the FreeS/WAN project by Henry Spencer.
224
<A NAME="index"> </A><H2>Index</H2>
226
<DT><A HREF="#lbAB">NAME</A><DD>
227
<DT><A HREF="#lbAC">SYNOPSIS</A><DD>
228
<DT><A HREF="#lbAD">DESCRIPTION</A><DD>
229
<DT><A HREF="#lbAE">SEE ALSO</A><DD>
230
<DT><A HREF="#lbAF">DIAGNOSTICS</A><DD>
231
<DT><A HREF="#lbAG">HISTORY</A><DD>
234
This document was created by
235
<A HREF="/cgi-bin/man/man2html">man2html</A>,
236
using the manual pages.<BR>
237
Time: 10:29:42 GMT, June 17, 2004