1 .\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk)
3 .\" Permission is granted to make and distribute verbatim copies of this
4 .\" manual provided the copyright notice and this permission notice are
5 .\" preserved on all copies.
7 .\" Permission is granted to copy and distribute modified versions of this
8 .\" manual under the conditions for verbatim copying, provided that the
9 .\" entire resulting derived work is distributed under the terms of a
10 .\" permission notice identical to this one.
12 .\" Since the Linux kernel and libraries are constantly changing, this
13 .\" manual page may be incorrect or out-of-date. The author(s) assume no
14 .\" responsibility for errors or omissions, or for damages resulting from
15 .\" the use of the information contained herein. The author(s) may not
16 .\" have taken the same level of care in the production of this manual,
17 .\" which is licensed free of charge, as they might when working
20 .\" Formatted or processed versions of this manual, if unaccompanied by
21 .\" the source, must acknowledge the copyright and authors of this work.
23 .\" References consulted:
24 .\" Linux libc source code
25 .\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991)
27 .\" Modified Sat Jul 24 21:48:06 1993 by Rik Faith (faith@cs.unc.edu)
29 .\" Japanese Version Copyright (c) 1998 NAKANO Takeo all rights reserved.
30 .\" Translated 1998-03-01, NAKANO Takeo <nakano@apm.seikei.ac.jp>
31 .\" Modified 1998-06-22, NAKANO Takeo
32 .\" Updated 2008-09-19, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
34 .TH GETNETENT 3 2008-08-19 "GNU" "Linux Programmer's Manual"
37 .\"O getnetent, getnetbyname, getnetbyaddr, setnetent, endnetent \-
38 .\"O get network entry
39 getnetent, getnetbyname, getnetbyaddr, setnetent, endnetent \- ¥Í¥Ã¥È¥ï¡¼¥¯¥¨¥ó¥È¥ê¤ò¼èÆÀ¤¹¤ë
45 .B struct netent *getnetent(void);
47 .BI "struct netent *getnetbyname(const char *" name );
49 .BI "struct netent *getnetbyaddr(uint32_t " net ", int " type );
51 .BI "void setnetent(int " stayopen );
53 .B void endnetent(void);
59 .\"O function reads the next entry from the networks database
60 .\"O and returns a \fInetent\fP structure containing
61 .\"O the broken-out fields from the entry.
62 .\"O A connection is opened to the database if necessary.
64 ´Ø¿ô¤Ï¥Í¥Ã¥È¥ï¡¼¥¯¥Ç¡¼¥¿¥Ù¡¼¥¹¤«¤é¼¡¤Î¥¨¥ó¥È¥ê¤òÆɤ߹þ¤ß¡¢
65 ¤½¤Î¥¨¥ó¥È¥ê¤ò \fInetent\fP ¹½Â¤ÂΤÎÍ×ÁÇÊ̤Υե£¡¼¥ë¥É¤Ë³ÊǼ¤·¡¢
67 ɬÍפǤ¢¤ì¤Ð¡¢¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ø¤ÎÀܳ¤¬¥ª¡¼¥×¥ó¤µ¤ì¤ë¡£
70 .\"O .BR getnetbyname ()
71 .\"O function returns a \fInetent\fP structure
72 .\"O for the entry from the database
73 .\"O that matches the network \fIname\fP.
75 ´Ø¿ô¤Ï¡¢¥Í¥Ã¥È¥ï¡¼¥¯Ì¾ \fIname\fP ¤Ë¥Þ¥Ã¥Á¤¹¤ë¥¨¥ó¥È¥ê¤ò
76 ¥Ç¡¼¥¿¥Ù¡¼¥¹¤«¤éõ¤·¡¢¤½¤Î¥¨¥ó¥È¥ê¤ò¼ý¤á¤¿ \fInetent\fP ¹½Â¤ÂΤòÊÖ¤¹¡£
79 .\"O .BR getnetbyaddr ()
80 .\"O function returns a \fInetent\fP structure
81 .\"O for the entry from the database
82 .\"O that matches the network number \fInet\fP of type
86 .\"O argument must be in host byte order.
88 ´Ø¿ô¤Ï¡¢\fItype\fP ·¿¤Î¥Í¥Ã¥È¥ï¡¼¥¯ÈÖ¹æ \fInet\fP ¤Ë¥Þ¥Ã¥Á¤¹¤ë¥¨¥ó¥È¥ê¤ò
89 ¥Ç¡¼¥¿¥Ù¡¼¥¹¤«¤éõ¤·¡¢¤½¤Î¥¨¥ó¥È¥ê¤ò¼ý¤á¤¿ \fInetent\fP ¹½Â¤ÂΤòÊÖ¤¹¡£
91 °ú¤¿ô¤Ï¥Û¥¹¥È¡¦¥Ð¥¤¥È¥ª¡¼¥À¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£
95 .\"O function opens a connection to the database,
96 .\"O and sets the next entry to the first entry.
97 .\"O If \fIstayopen\fP is nonzero,
98 .\"O then the connection to the database
99 .\"O will not be closed between calls to one of the
103 ´Ø¿ô¤Ï¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ø¤ÎÀܳ¤ò¥ª¡¼¥×¥ó¤·¡¢
104 ¼¡¤ÎÆɤ߹þ¤ß¥¨¥ó¥È¥ê¤òÀèƬ¤Î¥¨¥ó¥È¥ê¤ËÀßÄꤹ¤ë¡£
105 \fIstayopen\fP ¤¬ 0 ¤Ç¤Ê¤¤¾ì¹ç¡¢
108 ´Ø¿ô¤Î¸Æ¤Ó½Ð¤·´Ö¤Ç¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ø¤ÎÀܳ¤ò¥¯¥í¡¼¥º¤·¤Ê¤¤¡£
111 .\"O .BR endnetent ()
112 .\"O function closes the connection to the database.
114 ´Ø¿ô¤Ï¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ø¤ÎÀܳ¤ò¥¯¥í¡¼¥º¤¹¤ë¡£
116 .\"O The \fInetent\fP structure is defined in \fI<netdb.h>\fP as follows:
117 \fInetent\fP ¹½Â¤ÂÎ¤Ï \fI<netdb.h>\fP ¤Ç°Ê²¼¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£
122 char *n_name; /* official network name */
123 char **n_aliases; /* alias list */
124 int n_addrtype; /* net address type */
125 uint32_t n_net; /* network number */
130 .\"O The members of the \fInetent\fP structure are:
131 \fInetent\fP ¹½Â¤ÂΤΥá¥ó¥Ð¤Ï°Ê²¼¤ÎÄ̤ꡣ
135 .\"O The official name of the network.
136 ¥Í¥Ã¥È¥ï¡¼¥¯¤ÎÀµ¼°Ì¾ (official name)¡£
139 .\"O A NULL-terminated list of alternative names for the network.
140 ¥Í¥Ã¥È¥ï¡¼¥¯¤ÎÊÌ̾¤«¤é¤Ê¤ë¥ê¥¹¥È¡£
141 ¥ê¥¹¥È¤Ï NULL ¤Ç½ªÃ¼¤µ¤ì¤ë¡£
144 .\"O The type of the network number; always
146 ¥Í¥Ã¥È¥ï¡¼¥¯ÈÖ¹æ¤Î·Á¼°¡£¸½ºß¤Ï
151 .\"O The network number in host byte order.
152 ¥Û¥¹¥È¡¦¥Ð¥¤¥È¥ª¡¼¥À·Á¼°¤Î¥Í¥Ã¥È¥ï¡¼¥¯Èֹ档
154 .\"O .SH "RETURN VALUE"
157 .\"O .BR getnetent (),
158 .\"O .BR getnetbyname ()
160 .\"O .BR getnetbyaddr ()
161 .\"O functions return a pointer to a
162 .\"O statically allocated \fInetent\fP structure, or a NULL pointer if an
163 .\"O error occurs or the end of the file is reached.
167 ´Ø¿ô¤Ï¡¢ÀÅŪ¤Ë³ä¤êÅö¤Æ¤é¤ì¤¿ \fInetent\fP ¹½Â¤ÂΤؤΥݥ¤¥ó¥¿¤òÊÖ¤¹¡£
168 ¥¨¥é¡¼¤¬µ¯¤³¤Ã¤¿¤ê¡¢¥Õ¥¡¥¤¥ë¤ÎËöÈø¤Ë㤷¤¿¾ì¹ç¤Ï NULL ¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£
172 .\"O .I /etc/networks
173 .\"O networks database file
175 ¥Í¥Ã¥È¥ï¡¼¥¯¥Ç¡¼¥¿¥Ù¡¼¥¹¥Õ¥¡¥¤¥ë
176 .\"O .SH "CONFORMING TO"
178 4.3BSD, POSIX.1-2001.
181 .\"O In glibc versions before 2.2, the
184 .\"O .BR getnetbyaddr ()
187 ¥Ð¡¼¥¸¥ç¥ó 2.2 ¤è¤êÁ°¤Î glibc ¤Ç¤Ï¡¢