OSDN Git Service

8020aae0c2fa5716eb03e834f5af1e4b95faec46
[linuxjm/LDP_man-pages.git] / 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