diff options
Diffstat (limited to 'src/libfreeswan/portof.3')
-rw-r--r-- | src/libfreeswan/portof.3 | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/src/libfreeswan/portof.3 b/src/libfreeswan/portof.3 new file mode 100644 index 000000000..fac0d8bc3 --- /dev/null +++ b/src/libfreeswan/portof.3 @@ -0,0 +1,70 @@ +.TH IPSEC_PORTOF 3 "8 Sept 2000" +.\" RCSID $Id: portof.3,v 1.1 2004/03/15 20:35:26 as Exp $ +.SH NAME +ipsec portof \- get port field of an ip_address +.br +ipsec setportof \- set port field of an ip_address +.br +ipsec sockaddrof \- get pointer to internal sockaddr of an ip_address +.br +ipsec sockaddrlenof \- get length of internal sockaddr of an ip_address +.SH SYNOPSIS +.B "#include <freeswan.h>" +.sp +.B "int portof(const ip_address *src);" +.br +.B "void setportof(int port, ip_address *dst);" +.br +.B "struct sockaddr *sockaddrof(ip_address *src);" +.br +.B "size_t sockaddrlenof(const ip_address *src);" +.SH DESCRIPTION +The +.B <freeswan.h> +internal type +.I ip_address +contains one of the +.I sockaddr +types internally. +\fIReliance on this feature is discouraged\fR, +but it may occasionally be necessary. +These functions provide low-level tools for this purpose. +.PP +.I Portof +and +.I setportof +respectively read and write the port-number field of the internal +.IR sockaddr . +The values are in network byte order. +.PP +.I Sockaddrof +returns a pointer to the internal +.IR sockaddr , +for passing to other functions. +.PP +.I Sockaddrlenof +reports the size of the internal +.IR sockaddr , +for use in storage allocation. +.SH SEE ALSO +inet(3), ipsec_initaddr(3) +.SH DIAGNOSTICS +.I Portof +returns +.BR \-1 , +.I sockaddrof +returns +.BR NULL , +and +.I sockaddrlenof +returns +.B 0 +if an unknown address family is found within the +.IR ip_address . +.SH HISTORY +Written for the FreeS/WAN project by Henry Spencer. +.SH BUGS +These functions all depend on low-level details of the +.I ip_address +type, which are in principle subject to change. +Avoid using them unless really necessary. |