OSDN Git Service

2013.10.24
[uclinux-h8/uClinux-dist.git] / freeswan / doc / manpage.d / ipsec_rangetosubnet.3.html
1 Content-type: text/html
2
3 <HTML><HEAD><TITLE>Manpage of IPSEC_RANGETOSUBNET</TITLE>
4 </HEAD><BODY>
5 <H1>IPSEC_RANGETOSUBNET</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>
8
9
10 <A NAME="lbAB">&nbsp;</A>
11 <H2>NAME</H2>
12
13 ipsec rangetosubnet - convert address range to subnet
14 <A NAME="lbAC">&nbsp;</A>
15 <H2>SYNOPSIS</H2>
16
17 <B>#include &lt;<A HREF="file:/usr/include/freeswan.h">freeswan.h</A>&gt;</B>
18
19 <P>
20 <B>const char *rangetosubnet(const ip_address *start,</B>
21
22 <BR>
23 &nbsp;
24 <B>const ip_address *stop, ip_subnet *dst);</B>
25
26 <A NAME="lbAD">&nbsp;</A>
27 <H2>DESCRIPTION</H2>
28
29 <I>Rangetosubnet</I>
30
31 accepts two IP addresses which define an address range,
32 from
33 <I>start</I>
34
35 to
36 <I>stop</I>
37
38 inclusive,
39 and converts this to a subnet if possible.
40 The addresses must both be IPv4 or both be IPv6,
41 and the address family of the resulting subnet is the same.
42 <P>
43
44 <I>Rangetosubnet</I>
45
46 returns NULL for success and
47 a pointer to a string-literal error message for failure;
48 see DIAGNOSTICS.
49 <A NAME="lbAE">&nbsp;</A>
50 <H2>SEE ALSO</H2>
51
52 <A HREF="ipsec_initsubnet.3.html">ipsec_initsubnet</A>(3), <A HREF="ipsec_ttosubnet.3.html">ipsec_ttosubnet</A>(3)
53 <A NAME="lbAF">&nbsp;</A>
54 <H2>DIAGNOSTICS</H2>
55
56 Fatal errors in
57 <I>rangetosubnet</I>
58
59 are:
60 mixed address families;
61 unknown address family;
62 <I>start</I>
63
64 and
65 <I>stop</I>
66
67 do not define a subnet.
68 <A NAME="lbAG">&nbsp;</A>
69 <H2>HISTORY</H2>
70
71 Written for the FreeS/WAN project by Henry Spencer.
72 <A NAME="lbAH">&nbsp;</A>
73 <H2>BUGS</H2>
74
75 The restriction of error reports to literal strings
76 (so that callers don't need to worry about freeing them or copying them)
77 does limit the precision of error reporting.
78 <P>
79
80 The error-reporting convention lends itself
81 to slightly obscure code,
82 because many readers will not think of NULL as signifying success.
83 A good way to make it clearer is to write something like:
84 <P>
85
86 <DL COMPACT><DT><DD>
87 <PRE>
88 <B>const char *error;</B>
89
90 <B>error = rangetosubnet( /* ... */ );</B>
91 <B>if (error != NULL) {</B>
92 <B>        /* something went wrong */</B>
93 </PRE>
94
95 </DL>
96
97 <P>
98
99 <HR>
100 <A NAME="index">&nbsp;</A><H2>Index</H2>
101 <DL>
102 <DT><A HREF="#lbAB">NAME</A><DD>
103 <DT><A HREF="#lbAC">SYNOPSIS</A><DD>
104 <DT><A HREF="#lbAD">DESCRIPTION</A><DD>
105 <DT><A HREF="#lbAE">SEE ALSO</A><DD>
106 <DT><A HREF="#lbAF">DIAGNOSTICS</A><DD>
107 <DT><A HREF="#lbAG">HISTORY</A><DD>
108 <DT><A HREF="#lbAH">BUGS</A><DD>
109 </DL>
110 <HR>
111 This document was created by
112 <A HREF="http://localhost/cgi-bin/man/man2html">man2html</A>,
113 using the manual pages.<BR>
114 Time: 05:09:32 GMT, June 19, 2001
115 </BODY>
116 </HTML>