OSDN Git Service

2013.10.24
[uclinux-h8/uClinux-dist.git] / freeswan / doc / manpage.d / ipsec_sockaddrof.3.html
1 Content-type: text/html
2
3 <HTML><HEAD><TITLE>Manpage of IPSEC_PORTOF</TITLE>
4 </HEAD><BODY>
5 <H1>IPSEC_PORTOF</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 portof - get port field of an ip_address
14 <BR>
15
16 ipsec setportof - set port field of an ip_address
17 <BR>
18
19 ipsec sockaddrof - get pointer to internal sockaddr of an ip_address
20 <BR>
21
22 ipsec sockaddrlenof - get length of internal sockaddr of an ip_address
23 <A NAME="lbAC">&nbsp;</A>
24 <H2>SYNOPSIS</H2>
25
26 <B>#include &lt;<A HREF="file:/usr/include/freeswan.h">freeswan.h</A>&gt;</B>
27
28 <P>
29 <B>int portof(const ip_address *src);</B>
30
31 <BR>
32
33 <B>void setportof(int port, ip_address *dst);</B>
34
35 <BR>
36
37 <B>struct sockaddr *sockaddrof(ip_address *src);</B>
38
39 <BR>
40
41 <B>size_t sockaddrlenof(const ip_address *src);</B>
42
43 <A NAME="lbAD">&nbsp;</A>
44 <H2>DESCRIPTION</H2>
45
46 The
47 <B>&lt;<A HREF="file:/usr/include/freeswan.h">freeswan.h</A>&gt;</B>
48
49 internal type
50 <I>ip_address</I>
51
52 contains one of the
53 <I>sockaddr</I>
54
55 types internally.
56 <I>Reliance on this feature is discouraged</I>,
57 but it may occasionally be necessary.
58 These functions provide low-level tools for this purpose.
59 <P>
60
61 <I>Portof</I>
62
63 and
64 <I>setportof</I>
65
66 respectively read and write the port-number field of the internal
67 <I>sockaddr</I>.
68
69 The values are in network byte order.
70 <P>
71
72 <I>Sockaddrof</I>
73
74 returns a pointer to the internal
75 <I>sockaddr</I>,
76
77 for passing to other functions.
78 <P>
79
80 <I>Sockaddrlenof</I>
81
82 reports the size of the internal
83 <I>sockaddr</I>,
84
85 for use in storage allocation.
86 <A NAME="lbAE">&nbsp;</A>
87 <H2>SEE ALSO</H2>
88
89 <A HREF="inet.3.html">inet</A>(3), <A HREF="ipsec_initaddr.3.html">ipsec_initaddr</A>(3)
90 <A NAME="lbAF">&nbsp;</A>
91 <H2>DIAGNOSTICS</H2>
92
93 <I>Portof</I>
94
95 returns
96 <B>-1</B>,
97
98 <I>sockaddrof</I>
99
100 returns
101 <B>NULL</B>,
102
103 and
104 <I>sockaddrlenof</I>
105
106 returns
107 <B>0</B>
108
109 if an unknown address family is found within the
110 <I>ip_address</I>.
111
112 <A NAME="lbAG">&nbsp;</A>
113 <H2>HISTORY</H2>
114
115 Written for the FreeS/WAN project by Henry Spencer.
116 <A NAME="lbAH">&nbsp;</A>
117 <H2>BUGS</H2>
118
119 These functions all depend on low-level details of the
120 <I>ip_address</I>
121
122 type, which are in principle subject to change.
123 Avoid using them unless really necessary.
124 <P>
125
126 <HR>
127 <A NAME="index">&nbsp;</A><H2>Index</H2>
128 <DL>
129 <DT><A HREF="#lbAB">NAME</A><DD>
130 <DT><A HREF="#lbAC">SYNOPSIS</A><DD>
131 <DT><A HREF="#lbAD">DESCRIPTION</A><DD>
132 <DT><A HREF="#lbAE">SEE ALSO</A><DD>
133 <DT><A HREF="#lbAF">DIAGNOSTICS</A><DD>
134 <DT><A HREF="#lbAG">HISTORY</A><DD>
135 <DT><A HREF="#lbAH">BUGS</A><DD>
136 </DL>
137 <HR>
138 This document was created by
139 <A HREF="http://localhost/cgi-bin/man/man2html">man2html</A>,
140 using the manual pages.<BR>
141 Time: 05:09:33 GMT, June 19, 2001
142 </BODY>
143 </HTML>