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

📄 getnetent.3n

📁 <B>Digital的Unix操作系统VAX 4.2源码</B>
💻 3N
字号:
.\" SCCSID: @(#)getnetent.3n	8.2	1/29/91.TH getnetent 3n.SH Namegetnetent, getnetbyaddr, getnetbyname, setnetent, endnetent \- get networksentry.SH Syntax.nf.B #include <netdb.h>.PP.B struct netent *getnetent().PP.B struct netent *getnetbyname(\fIname\fP).B char *\fIname\fP;.PP.B struct netent *getnetbyaddr(\fInet\fP, \fItype\fP).B long \fInet\fP; int \fItype\fP;.PP.B void setnetent(\fIstayopen\fP).B int \fIstayopen\fP;.PP.B void endnetent().fi.SH Description.NXR "getnetent subroutine".NXR "getnetbyaddr subroutine".NXR "getnetbyname subroutine".NXR "setnetent subroutine".NXR "endnetent subroutine".NXR "networks file" "getting entry"The.PN getnetent ,.PN getnetbyname ,and.PN getnetbyaddrsubroutineseach return a pointer to an object with thefollowing structurecontaining the broken-outfields of a line in the .PN networks database..EXstruct	netent {	char	*n_name;	/* official name of net */	char	**n_aliases;	/* alias list */	int	n_addrtype;	/* net number type */	long	n_net;		/* net number */};.EE.PPThe members of this structure are:.TP \w'n_addrtype'u+2nn_nameThe official name of the network..TP \w'n_addrtype'u+2nn_aliasesA zero terminated list of alternate names for the network..TP \w'n_addrtype'u+2nn_addrtypeThe type of the network number returned: AF_INET..TP \w'n_addrtype'u+2nn_netThe network number.  Network numbers are returned in machine byteorder..PPIf the.I stayopenflag on a .PN setnetentsubroutine is NULL, the.PN networksdatabase is opened.  Otherwise the.PN setnetenthas the effect of rewinding the .PN networks database.The.PN endnetentmay be called toclose the .PN networks database when processing is complete..PPThe.PN getnetentsubroutine simply reads the nextline while.PN getnetbynameand.PN getnetbyaddrsearch until a matching.I nameor.I netnumber is found(or until EOF is encountered).  The \fItype\fP must be AF_INET.The.PN getnetentsubroutine keeps a pointer in the database, allowingsuccessive calls to be used to search the entire file..PPA call to.PN setnetentmust be made before a.PN whileloop using.PN getnetentin order to perform initialization and an.PN endnetentmust be used after the loop.  Both.PN getnetbynameand.PN getnetbyaddrmake calls to.PN setnetentand.PN endnetent ..SH Restrictions.NXR "getnetent subroutine" "restrictions"All informationis contained in a static areaso it must be copied if it isto be saved.  Only Internet networknumbers are currently understood..PPIf YP is running, .PN getnetentdoes not return the entries in any particular order.See the .I Guide to the Yellow Pages Servicefor setup information..PPThe networks database may also be distributed via the BIND/Hesiodnaming service.  See the.I Guide to the BIND/Hesiod Servicefor more information..SH Return ValuesNull pointer(0) returned on EOF or error..SH Files.PN /etc/networks.SH See Alsonetworks(5), svc.conf(5).br.I Guide to the BIND/Hesiod Service.br.I Guide to the Yellow Pages Service 

⌨️ 快捷键说明

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