]> git.ipfire.org Git - people/ms/strongswan.git/blame - src/libfreeswan/libfreeswan/portof.3
- started to rebuild source layout
[people/ms/strongswan.git] / src / libfreeswan / libfreeswan / portof.3
CommitLineData
997358a6
MW
1.TH IPSEC_PORTOF 3 "8 Sept 2000"
2.\" RCSID $Id: portof.3,v 1.1 2004/03/15 20:35:26 as Exp $
3.SH NAME
4ipsec portof \- get port field of an ip_address
5.br
6ipsec setportof \- set port field of an ip_address
7.br
8ipsec sockaddrof \- get pointer to internal sockaddr of an ip_address
9.br
10ipsec sockaddrlenof \- get length of internal sockaddr of an ip_address
11.SH SYNOPSIS
12.B "#include <freeswan.h>"
13.sp
14.B "int portof(const ip_address *src);"
15.br
16.B "void setportof(int port, ip_address *dst);"
17.br
18.B "struct sockaddr *sockaddrof(ip_address *src);"
19.br
20.B "size_t sockaddrlenof(const ip_address *src);"
21.SH DESCRIPTION
22The
23.B <freeswan.h>
24internal type
25.I ip_address
26contains one of the
27.I sockaddr
28types internally.
29\fIReliance on this feature is discouraged\fR,
30but it may occasionally be necessary.
31These functions provide low-level tools for this purpose.
32.PP
33.I Portof
34and
35.I setportof
36respectively read and write the port-number field of the internal
37.IR sockaddr .
38The values are in network byte order.
39.PP
40.I Sockaddrof
41returns a pointer to the internal
42.IR sockaddr ,
43for passing to other functions.
44.PP
45.I Sockaddrlenof
46reports the size of the internal
47.IR sockaddr ,
48for use in storage allocation.
49.SH SEE ALSO
50inet(3), ipsec_initaddr(3)
51.SH DIAGNOSTICS
52.I Portof
53returns
54.BR \-1 ,
55.I sockaddrof
56returns
57.BR NULL ,
58and
59.I sockaddrlenof
60returns
61.B 0
62if an unknown address family is found within the
63.IR ip_address .
64.SH HISTORY
65Written for the FreeS/WAN project by Henry Spencer.
66.SH BUGS
67These functions all depend on low-level details of the
68.I ip_address
69type, which are in principle subject to change.
70Avoid using them unless really necessary.