OSDN Git Service

Import translated manuals from JM CVS Repository.
[linuxjm/jm.git] / manual / LDP_man-pages / draft / man3 / getnetent.3
1 .\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk)
2 .\"
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.
6 .\"
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.
11 .\"
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
18 .\" professionally.
19 .\"
20 .\" Formatted or processed versions of this manual, if unaccompanied by
21 .\" the source, must acknowledge the copyright and authors of this work.
22 .\"
23 .\" References consulted:
24 .\"     Linux libc source code
25 .\"     Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991)
26 .\"     386BSD man pages
27 .\" Modified Sat Jul 24 21:48:06 1993 by Rik Faith (faith@cs.unc.edu)
28 .\"
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>
33 .\"
34 .TH GETNETENT 3  2008-08-19 "GNU" "Linux Programmer's Manual"
35 .\"O .SH NAME
36 .SH Ì¾Á°
37 .\"O getnetent, getnetbyname, getnetbyaddr, setnetent, endnetent \-
38 .\"O get network entry
39 getnetent, getnetbyname, getnetbyaddr, setnetent, endnetent \- ¥Í¥Ã¥È¥ï¡¼¥¯¥¨¥ó¥È¥ê¤ò¼èÆÀ¤¹¤ë
40 .\"O .SH SYNOPSIS
41 .SH ½ñ¼°
42 .nf
43 .B #include <netdb.h>
44 .sp
45 .B struct netent *getnetent(void);
46 .sp
47 .BI "struct netent *getnetbyname(const char *" name );
48 .sp
49 .BI "struct netent *getnetbyaddr(uint32_t " net ", int " type );
50 .sp
51 .BI "void setnetent(int " stayopen );
52 .sp
53 .B void endnetent(void);
54 .fi
55 .\"O .SH DESCRIPTION
56 .SH ÀâÌÀ
57 .\"O The
58 .\"O .BR getnetent ()
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.
63 .BR getnetent ()
64 ´Ø¿ô¤Ï¥Í¥Ã¥È¥ï¡¼¥¯¥Ç¡¼¥¿¥Ù¡¼¥¹¤«¤é¼¡¤Î¥¨¥ó¥È¥ê¤òÆɤ߹þ¤ß¡¢
65 ¤½¤Î¥¨¥ó¥È¥ê¤ò \fInetent\fP ¹½Â¤ÂΤÎÍ×ÁÇÊ̤Υե£¡¼¥ë¥É¤Ë³ÊǼ¤·¡¢
66 ¤½¤Î¹½Â¤ÂΤòÊÖ¤¹¡£
67 ɬÍפǤ¢¤ì¤Ð¡¢¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ø¤ÎÀܳ¤¬¥ª¡¼¥×¥ó¤µ¤ì¤ë¡£
68 .PP
69 .\"O The
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.
74 .BR getnetbyname ()
75 ´Ø¿ô¤Ï¡¢¥Í¥Ã¥È¥ï¡¼¥¯Ì¾ \fIname\fP ¤Ë¥Þ¥Ã¥Á¤¹¤ë¥¨¥ó¥È¥ê¤ò
76 ¥Ç¡¼¥¿¥Ù¡¼¥¹¤«¤éõ¤·¡¢¤½¤Î¥¨¥ó¥È¥ê¤ò¼ý¤á¤¿ \fInetent\fP ¹½Â¤ÂΤòÊÖ¤¹¡£
77 .PP
78 .\"O The
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
83 .\"O \fItype\fP.
84 .\"O The
85 .\"O .I net
86 .\"O argument must be in host byte order.
87 .BR getnetbyaddr ()
88 ´Ø¿ô¤Ï¡¢\fItype\fP ·¿¤Î¥Í¥Ã¥È¥ï¡¼¥¯ÈÖ¹æ \fInet\fP ¤Ë¥Þ¥Ã¥Á¤¹¤ë¥¨¥ó¥È¥ê¤ò
89 ¥Ç¡¼¥¿¥Ù¡¼¥¹¤«¤éõ¤·¡¢¤½¤Î¥¨¥ó¥È¥ê¤ò¼ý¤á¤¿ \fInetent\fP ¹½Â¤ÂΤòÊÖ¤¹¡£
90 .I net
91 °ú¤­¿ô¤Ï¥Û¥¹¥È¡¦¥Ð¥¤¥È¥ª¡¼¥À¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£
92 .PP
93 .\"O The
94 .\"O .BR setnetent ()
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
100 .\"O .BR getnet* ()
101 .\"O functions.
102 .BR setnetent ()
103 ´Ø¿ô¤Ï¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ø¤ÎÀܳ¤ò¥ª¡¼¥×¥ó¤·¡¢
104 ¼¡¤ÎÆɤ߹þ¤ß¥¨¥ó¥È¥ê¤òÀèƬ¤Î¥¨¥ó¥È¥ê¤ËÀßÄꤹ¤ë¡£
105 \fIstayopen\fP ¤¬ 0 ¤Ç¤Ê¤¤¾ì¹ç¡¢
106 °ì¤Ä°ì¤Ä¤Î
107 .BR getnet* ()
108 ´Ø¿ô¤Î¸Æ¤Ó½Ð¤·´Ö¤Ç¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ø¤ÎÀܳ¤ò¥¯¥í¡¼¥º¤·¤Ê¤¤¡£
109 .PP
110 .\"O The
111 .\"O .BR endnetent ()
112 .\"O function closes the connection to the database.
113 .BR endnetent ()
114 ´Ø¿ô¤Ï¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ø¤ÎÀܳ¤ò¥¯¥í¡¼¥º¤¹¤ë¡£
115 .PP
116 .\"O The \fInetent\fP structure is defined in \fI<netdb.h>\fP as follows:
117 \fInetent\fP ¹½Â¤ÂΤϠ\fI<netdb.h>\fP ¤Ç°Ê²¼¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£
118 .sp
119 .in +4n
120 .nf
121 struct netent {
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 */
126 }
127 .fi
128 .in
129 .PP
130 .\"O The members of the \fInetent\fP structure are:
131 \fInetent\fP ¹½Â¤ÂΤΥá¥ó¥Ð¤Ï°Ê²¼¤ÎÄ̤ꡣ
132 .RS
133 .TP 12
134 .I n_name
135 .\"O The official name of the network.
136 ¥Í¥Ã¥È¥ï¡¼¥¯¤ÎÀµ¼°Ì¾ (official name)¡£
137 .TP
138 .I n_aliases
139 .\"O A NULL-terminated list of alternative names for the network.
140 ¥Í¥Ã¥È¥ï¡¼¥¯¤ÎÊÌ̾¤«¤é¤Ê¤ë¥ê¥¹¥È¡£
141 ¥ê¥¹¥È¤Ï NULL ¤Ç½ªÃ¼¤µ¤ì¤ë¡£
142 .TP
143 .I n_addrtype
144 .\"O The type of the network number; always
145 .\"O .BR AF_INET .
146 ¥Í¥Ã¥È¥ï¡¼¥¯ÈÖ¹æ¤Î·Á¼°¡£¸½ºß¤Ï
147 .B AF_INET
148 ¤Î¤ß¡£
149 .TP
150 .I n_net
151 .\"O The network number in host byte order.
152 ¥Û¥¹¥È¡¦¥Ð¥¤¥È¥ª¡¼¥À·Á¼°¤Î¥Í¥Ã¥È¥ï¡¼¥¯Èֹ档
153 .RE
154 .\"O .SH "RETURN VALUE"
155 .SH ÊÖ¤êÃÍ
156 .\"O The
157 .\"O .BR getnetent (),
158 .\"O .BR getnetbyname ()
159 .\"O and
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.
164 .BR getnetent (),
165 .BR getnetbyname (),
166 .BR getnetbyaddr ()
167 ´Ø¿ô¤Ï¡¢ÀÅŪ¤Ë³ä¤êÅö¤Æ¤é¤ì¤¿ \fInetent\fP ¹½Â¤ÂΤؤΥݥ¤¥ó¥¿¤òÊÖ¤¹¡£
168 ¥¨¥é¡¼¤¬µ¯¤³¤Ã¤¿¤ê¡¢¥Õ¥¡¥¤¥ë¤ÎËöÈø¤Ë㤷¤¿¾ì¹ç¤Ï NULL ¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£
169 .\"O .SH FILES
170 .SH ¥Õ¥¡¥¤¥ë
171 .TP
172 .\"O .I /etc/networks
173 .\"O networks database file
174 .I /etc/networks
175 ¥Í¥Ã¥È¥ï¡¼¥¯¥Ç¡¼¥¿¥Ù¡¼¥¹¥Õ¥¡¥¤¥ë
176 .\"O .SH "CONFORMING TO"
177 .SH ½àµò
178 4.3BSD, POSIX.1-2001.
179 .\"O .SH NOTES
180 .SH Ãí°Õ
181 .\"O In glibc versions before 2.2, the
182 .\"O .I net
183 .\"O argument of
184 .\"O .BR getnetbyaddr ()
185 .\"O was of type
186 .\"O .IR long .
187 ¥Ð¡¼¥¸¥ç¥ó 2.2 ¤è¤êÁ°¤Î glibc ¤Ç¤Ï¡¢
188 .BR getnetbyaddr ()
189 ¤Î°ú¤­¿ô
190 .I net
191 ¤Ï
192 .I long
193 ·¿¤À¤Ã¤¿¡£
194 .\"O .SH "SEE ALSO"
195 .SH ´ØÏ¢¹àÌÜ
196 .BR getnetent_r (3),
197 .BR getprotoent (3),
198 .BR getservent (3)
199 .\" .BR networks (5)
200 .br
201 RFC\ 1101