⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 initaddr.3

📁 This a good VPN source
💻 3
字号:
.TH IPSEC_INITADDR 3 "11 Sept 2000".\" RCSID $Id: initaddr.3,v 1.8 2004/04/09 18:00:39 mcr Exp $.SH NAMEipsec initaddr \- initialize an ip_address.bripsec addrtypeof \- get address type of an ip_address.bripsec addrlenof \- get length of address within an ip_address.bripsec addrbytesof \- get copy of address within an ip_address.bripsec addrbytesptr \- get pointer to address within an ip_address.SH SYNOPSIS.B "#include <freeswan.h>".sp.B "const char *initaddr(const char *src, size_t srclen,".ti +1c.B "int af, ip_address *dst);".br.B "int addrtypeof(const ip_address *src);".br.B "size_t addrlenof(const ip_address *src);".br.B "size_t addrbytesof(const ip_address *src,".ti +1c.B "unsigned char *dst, size_t dstlen);".br.B "size_t addrbytesptr(const ip_address *src,".ti +1c.B "const unsigned char **dst);".SH DESCRIPTIONThe.B <freeswan.h>library uses an internal type.I ip_addressto contain one of the (currently two) types of IP address.These functions provide basic tools for creating and examining this type..PP.I Initaddrinitializes a variable.I *dstof type.I ip_addressfrom an address(in network byte order,indicated by a pointer.I srcand a length.IR srclen )and an address family.I af(typically.B AF_INETor.BR AF_INET6 ).The length must be consistent with the address family..PP.I Addrtypeofreturns the address type of an address,normally.B AF_INETor.BR AF_INET6 .(The.B <freeswan.h>header file arranges to include the necessary headers for thesenames to be known.).PP.I Addrlenofreturns the size (in bytes) of the address within an.IR ip_address ,to permit storage allocation etc..PP.I Addrbytesofcopies the address within the.I ip_address.I srcto the buffer indicated by the pointer.I dstand the length.IR dstlen ,and returns the address length (in bytes).If the address will not fit,as many bytes as will fit are copied;the returned length is still the full length.It is the caller's responsibility to check thereturned value to ensure that there was enough room..PP.I Addrbytesptrsets.I *dstto a pointer to the internal address within the.IR ip_address ,and returns the address length (in bytes).If.I dstis.BR NULL ,it just returns the address length.The pointer points to.B constto discourage misuse..PP.I Initaddrreturns.B NULLfor success anda pointer to a string-literal error message for failure;see DIAGNOSTICS..PPThe functions which return.I size_treturn.B 0for a failure..SH SEE ALSOinet(3), ipsec_ttoaddr(3).SH DIAGNOSTICSAn unknown address family is a fatal error for any of these functionsexcept.IR addrtypeof .An address-size mismatch is a fatal error for.IR initaddr ..SH HISTORYWritten for the FreeS/WAN project by Henry Spencer..SH BUGS.I Addrtypeofshould probably have been named.IR addrfamilyof .

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -