📄 initsubnet.3
字号:
.TH IPSEC_INITSUBNET 3 "12 March 2002".\" RCSID $Id: initsubnet.3,v 1.6 2004/04/09 18:00:39 mcr Exp $.SH NAMEipsec initsubnet \- initialize an ip_subnet.bripsec addrtosubnet \- initialize a singleton ip_subnet.bripsec subnettypeof \- get address type of an ip_subnet.bripsec masktocount \- convert subnet mask to bit count.bripsec networkof \- get base address of an ip_subnet.bripsec maskof \- get subnet mask of an ip_subnet.SH SYNOPSIS.B "#include <freeswan.h>".sp.B "const char *initsubnet(const ip_address *addr,".ti +1c.B "int maskbits, int clash, ip_subnet *dst);".br.B "const char *addrtosubnet(const ip_address *addr,".ti +1c.B "ip_subnet *dst);".sp.B "int subnettypeof(const ip_subnet *src);".br.B "int masktocount(const ip_address *src);".br.B "void networkof(const ip_subnet *src, ip_address *dst);".br.B "void maskof(const ip_subnet *src, ip_address *dst);".SH DESCRIPTIONThe.B <freeswan.h>library uses an internal type.I ip_subnetto contain a description of an IP subnet(base address plus mask).These functions provide basic tools for creating and examining this type..PP.I Initsubnetinitializes a variable.I *dstof type.I ip_subnetfrom a base address anda count of mask bits.The.I clashparameter specifies what to do if the base address includes.B 1bits outside the prefix specified by the mask(that is, in the ``host number'' part of the address):.RS.IP '0' 5zero out host-number bits.IP 'x'non-zero host-number bits are an error.RE.PP.I Initsubnetreturns.B NULLfor success anda pointer to a string-literal error message for failure;see DIAGNOSTICS..PP.I Addrtosubnetinitializes an.I ip_subnetvariable.I *dstto a ``singleton subnet'' containing the single address.IR *addr .It returns.B NULLfor success anda pointer to a string-literal error message for failure..PP.I Subnettypeofreturns the address type of a subnet,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 Masktocountconverts a subnet mask, expressed as an address, to a bit countsuitable for use with.IR initsubnet .It returns.B \-1for error; see DIAGNOSTICS..PP.I Networkoffills in.I *dstwith the base address of subnet.IR src ..PP.I Maskoffills in.I *dstwith the subnet mask of subnet.IR src ,expressed as an address..SH SEE ALSOinet(3), ipsec_ttosubnet(3), ipsec_rangetosubnet(3).SH DIAGNOSTICSFatal errors in.I initsubnetare:unknown address family;unknown.I clashvalue;impossible mask bit count;non-zero host-number bits and.I clashis.BR 'x' .Fatal errors in.I addrtosubnetare:unknown address family.Fatal errors in.I masktocountare:unknown address family;mask bits not contiguous..SH HISTORYWritten for the FreeS/WAN project by Henry Spencer.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -