OSDN Git Service

(split) DP: release pages (catch up to 3.50).
[linuxjm/LDP_man-pages.git] / release / man3 / getnetent.3
1 .\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk)
2 .\"
3 .\" %%%LICENSE_START(VERBATIM)
4 .\" Permission is granted to make and distribute verbatim copies of this
5 .\" manual provided the copyright notice and this permission notice are
6 .\" preserved on all copies.
7 .\"
8 .\" Permission is granted to copy and distribute modified versions of this
9 .\" manual under the conditions for verbatim copying, provided that the
10 .\" entire resulting derived work is distributed under the terms of a
11 .\" permission notice identical to this one.
12 .\"
13 .\" Since the Linux kernel and libraries are constantly changing, this
14 .\" manual page may be incorrect or out-of-date.  The author(s) assume no
15 .\" responsibility for errors or omissions, or for damages resulting from
16 .\" the use of the information contained herein.  The author(s) may not
17 .\" have taken the same level of care in the production of this manual,
18 .\" which is licensed free of charge, as they might when working
19 .\" professionally.
20 .\"
21 .\" Formatted or processed versions of this manual, if unaccompanied by
22 .\" the source, must acknowledge the copyright and authors of this work.
23 .\" %%%LICENSE_END
24 .\"
25 .\" References consulted:
26 .\"     Linux libc source code
27 .\"     Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991)
28 .\"     386BSD man pages
29 .\" Modified Sat Jul 24 21:48:06 1993 by Rik Faith (faith@cs.unc.edu)
30 .\"*******************************************************************
31 .\"
32 .\" This file was generated with po4a. Translate the source file.
33 .\"
34 .\"*******************************************************************
35 .TH GETNETENT 3 2008\-08\-19 GNU "Linux Programmer's Manual"
36 .SH 名前
37 getnetent, getnetbyname, getnetbyaddr, setnetent, endnetent \-
38 ネットワークエントリを取得する
39 .SH 書式
40 .nf
41 \fB#include <netdb.h>\fP
42 .sp
43 \fBstruct netent *getnetent(void);\fP
44 .sp
45 \fBstruct netent *getnetbyname(const char *\fP\fIname\fP\fB);\fP
46 .sp
47 \fBstruct netent *getnetbyaddr(uint32_t \fP\fInet\fP\fB, int \fP\fItype\fP\fB);\fP
48 .sp
49 \fBvoid setnetent(int \fP\fIstayopen\fP\fB);\fP
50 .sp
51 \fBvoid endnetent(void);\fP
52 .fi
53 .SH 説明
54 \fBgetnetent\fP()  関数はネットワークデータベースから次のエントリを読み込み、 そのエントリを \fInetent\fP
55 構造体の要素別のフィールドに格納し、 その構造体を返す。 必要であれば、データベースへの接続がオープンされる。
56 .PP
57 \fBgetnetbyname\fP()  関数は、ネットワーク名 \fIname\fP にマッチするエントリを データベースから探し、そのエントリを収めた
58 \fInetent\fP 構造体を返す。
59 .PP
60 \fBgetnetbyaddr\fP()  関数は、\fItype\fP 型のネットワーク番号 \fInet\fP にマッチするエントリを
61 データベースから探し、そのエントリを収めた \fInetent\fP 構造体を返す。 \fInet\fP 引き数はホスト・バイトオーダでなければならない。
62 .PP
63 \fBsetnetent\fP()  関数はデータベースへの接続をオープンし、 次の読み込みエントリを先頭のエントリに設定する。 \fIstayopen\fP が
64 0 でない場合、 一つ一つの \fBgetnet*\fP()  関数の呼び出し間でデータベースへの接続をクローズしない。
65 .PP
66 \fBendnetent\fP()  関数はデータベースへの接続をクローズする。
67 .PP
68 \fInetent\fP 構造体は \fI<netdb.h>\fP で以下のように定義されている。
69 .sp
70 .in +4n
71 .nf
72 struct netent {
73     char      *n_name;     /* official network name */
74     char     **n_aliases;  /* alias list */
75     int        n_addrtype; /* net address type */
76     uint32_t   n_net;      /* network number */
77 }
78 .fi
79 .in
80 .PP
81 \fInetent\fP 構造体のメンバは以下の通り。
82 .TP 
83 \fIn_name\fP
84 ネットワークの正式名 (official name)。
85 .TP 
86 \fIn_aliases\fP
87 ネットワークの別名からなるリスト。 リストは NULL で終端される。
88 .TP 
89 \fIn_addrtype\fP
90 ネットワーク番号の形式。現在は \fBAF_INET\fP のみ。
91 .TP 
92 \fIn_net\fP
93 ホスト・バイトオーダ形式のネットワーク番号。
94 .SH 返り値
95 \fBgetnetent\fP(), \fBgetnetbyname\fP(), \fBgetnetbyaddr\fP()  関数は、静的に割り当てられた
96 \fInetent\fP 構造体へのポインタを返す。 エラーが起こったり、ファイルの末尾に達した場合は NULL ポインタを返す。
97 .SH ファイル
98 .TP 
99 \fI/etc/networks\fP
100 ネットワークデータベースファイル
101 .SH 準拠
102 4.3BSD, POSIX.1\-2001.
103 .SH 注意
104 バージョン 2.2 より前の glibc では、 \fBgetnetbyaddr\fP()  の引き数 \fInet\fP は \fIlong\fP 型だった。
105 .SH 関連項目
106 .\" .BR networks (5)
107 \fBgetnetent_r\fP(3), \fBgetprotoent\fP(3), \fBgetservent\fP(3)
108 .br
109 RFC\ 1101
110 .SH この文書について
111 この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.50 の一部
112 である。プロジェクトの説明とバグ報告に関する情報は
113 http://www.kernel.org/doc/man\-pages/ に書かれている。