OSDN Git Service

(split) LDP: draft snapshot generated from latest ja.po files.
[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 .\"
30 .\" This file was generated with po4a. Translate the source file.
31 .\"
32 .\"*******************************************************************
33 .TH GETNETENT 3 2008\-08\-19 GNU "Linux Programmer's Manual"
34 .SH 名前
35 getnetent, getnetbyname, getnetbyaddr, setnetent, endnetent \-
36 ネットワークエントリを取得する
37 .SH 書式
38 .nf
39 \fB#include <netdb.h>\fP
40 .sp
41 \fBstruct netent *getnetent(void);\fP
42 .sp
43 \fBstruct netent *getnetbyname(const char *\fP\fIname\fP\fB);\fP
44 .sp
45 \fBstruct netent *getnetbyaddr(uint32_t \fP\fInet\fP\fB, int \fP\fItype\fP\fB);\fP
46 .sp
47 \fBvoid setnetent(int \fP\fIstayopen\fP\fB);\fP
48 .sp
49 \fBvoid endnetent(void);\fP
50 .fi
51 .SH 説明
52 \fBgetnetent\fP()  関数はネットワークデータベースから次のエントリを読み込み、 そのエントリを \fInetent\fP
53 構造体の要素別のフィールドに格納し、 その構造体を返す。 必要であれば、データベースへの接続がオープンされる。
54 .PP
55 \fBgetnetbyname\fP()  関数は、ネットワーク名 \fIname\fP にマッチするエントリを データベースから探し、そのエントリを収めた
56 \fInetent\fP 構造体を返す。
57 .PP
58 \fBgetnetbyaddr\fP()  関数は、\fItype\fP 型のネットワーク番号 \fInet\fP にマッチするエントリを
59 データベースから探し、そのエントリを収めた \fInetent\fP 構造体を返す。 \fInet\fP 引き数はホスト・バイトオーダでなければならない。
60 .PP
61 \fBsetnetent\fP()  関数はデータベースへの接続をオープンし、 次の読み込みエントリを先頭のエントリに設定する。 \fIstayopen\fP が
62 0 でない場合、 一つ一つの \fBgetnet*\fP()  関数の呼び出し間でデータベースへの接続をクローズしない。
63 .PP
64 \fBendnetent\fP()  関数はデータベースへの接続をクローズする。
65 .PP
66 \fInetent\fP 構造体は \fI<netdb.h>\fP で以下のように定義されている。
67 .sp
68 .in +4n
69 .nf
70 struct netent {
71     char      *n_name;     /* official network name */
72     char     **n_aliases;  /* alias list */
73     int        n_addrtype; /* net address type */
74     uint32_t   n_net;      /* network number */
75 }
76 .fi
77 .in
78 .PP
79 \fInetent\fP 構造体のメンバは以下の通り。
80 .TP 
81 \fIn_name\fP
82 ネットワークの正式名 (official name)。
83 .TP 
84 \fIn_aliases\fP
85 ネットワークの別名からなるリスト。 リストは NULL で終端される。
86 .TP 
87 \fIn_addrtype\fP
88 ネットワーク番号の形式。現在は \fBAF_INET\fP のみ。
89 .TP 
90 \fIn_net\fP
91 ホスト・バイトオーダ形式のネットワーク番号。
92 .SH 返り値
93 \fBgetnetent\fP(), \fBgetnetbyname\fP(), \fBgetnetbyaddr\fP()  関数は、静的に割り当てられた
94 \fInetent\fP 構造体へのポインタを返す。 エラーが起こったり、ファイルの末尾に達した場合は NULL ポインタを返す。
95 .SH ファイル
96 .TP 
97 \fI/etc/networks\fP
98 ネットワークデータベースファイル
99 .SH 準拠
100 4.3BSD, POSIX.1\-2001.
101 .SH 注意
102 バージョン 2.2 より前の glibc では、 \fBgetnetbyaddr\fP()  の引き数 \fInet\fP は \fIlong\fP 型だった。
103 .SH 関連項目
104 .\" .BR networks (5)
105 \fBgetnetent_r\fP(3), \fBgetprotoent\fP(3), \fBgetservent\fP(3)
106 .br
107 RFC\ 1101