OSDN Git Service

7f9dfd143581a211762a867b80980a63863f417e
[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 .\"
36 .\" Japanese Version Copyright (c) 1998 NAKANO Takeo all rights reserved.
37 .\" Translated 1998-03-01, NAKANO Takeo <nakano@apm.seikei.ac.jp>
38 .\" Modified 1998-06-22, NAKANO Takeo
39 .\" Updated 2008-09-19, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
40 .\"
41 .TH GETNETENT 3 2008\-08\-19 GNU "Linux Programmer's Manual"
42 .SH 名前
43 getnetent, getnetbyname, getnetbyaddr, setnetent, endnetent \-
44 ネットワークエントリを取得する
45 .SH 書式
46 .nf
47 \fB#include <netdb.h>\fP
48 .sp
49 \fBstruct netent *getnetent(void);\fP
50 .sp
51 \fBstruct netent *getnetbyname(const char *\fP\fIname\fP\fB);\fP
52 .sp
53 \fBstruct netent *getnetbyaddr(uint32_t \fP\fInet\fP\fB, int \fP\fItype\fP\fB);\fP
54 .sp
55 \fBvoid setnetent(int \fP\fIstayopen\fP\fB);\fP
56 .sp
57 \fBvoid endnetent(void);\fP
58 .fi
59 .SH 説明
60 \fBgetnetent\fP()  関数はネットワークデータベースから次のエントリを読み込み、 そのエントリを \fInetent\fP
61 構造体の要素別のフィールドに格納し、 その構造体を返す。 必要であれば、データベースへの接続がオープンされる。
62 .PP
63 \fBgetnetbyname\fP()  関数は、ネットワーク名 \fIname\fP にマッチするエントリを データベースから探し、そのエントリを収めた
64 \fInetent\fP 構造体を返す。
65 .PP
66 \fBgetnetbyaddr\fP()  関数は、\fItype\fP 型のネットワーク番号 \fInet\fP にマッチするエントリを
67 データベースから探し、そのエントリを収めた \fInetent\fP 構造体を返す。 \fInet\fP 引き数はホスト・バイトオーダでなければならない。
68 .PP
69 \fBsetnetent\fP()  関数はデータベースへの接続をオープンし、 次の読み込みエントリを先頭のエントリに設定する。 \fIstayopen\fP が
70 0 でない場合、 一つ一つの \fBgetnet*\fP()  関数の呼び出し間でデータベースへの接続をクローズしない。
71 .PP
72 \fBendnetent\fP()  関数はデータベースへの接続をクローズする。
73 .PP
74 \fInetent\fP 構造体は \fI<netdb.h>\fP で以下のように定義されている。
75 .sp
76 .in +4n
77 .nf
78 struct netent {
79     char      *n_name;     /* official network name */
80     char     **n_aliases;  /* alias list */
81     int        n_addrtype; /* net address type */
82     uint32_t   n_net;      /* network number */
83 }
84 .fi
85 .in
86 .PP
87 \fInetent\fP 構造体のメンバは以下の通り。
88 .TP 
89 \fIn_name\fP
90 ネットワークの正式名 (official name)。
91 .TP 
92 \fIn_aliases\fP
93 ネットワークの別名からなるリスト。 リストはヌルで終端される。
94 .TP 
95 \fIn_addrtype\fP
96 ネットワーク番号の形式。現在は \fBAF_INET\fP のみ。
97 .TP 
98 \fIn_net\fP
99 ホスト・バイトオーダ形式のネットワーク番号。
100 .SH 返り値
101 \fBgetnetent\fP(), \fBgetnetbyname\fP(), \fBgetnetbyaddr\fP()  関数は、静的に割り当てられた
102 \fInetent\fP 構造体へのポインタを返す。 エラーが起こったり、ファイルの末尾に達した場合はヌルポインタを返す。
103 .SH ファイル
104 .TP 
105 \fI/etc/networks\fP
106 ネットワークデータベースファイル
107 .SH 準拠
108 4.3BSD, POSIX.1\-2001.
109 .SH 注意
110 バージョン 2.2 より前の glibc では、 \fBgetnetbyaddr\fP()  の引き数 \fInet\fP は \fIlong\fP 型だった。
111 .SH 関連項目
112 .\" .BR networks (5)
113 \fBgetnetent_r\fP(3), \fBgetprotoent\fP(3), \fBgetservent\fP(3)
114 .br
115 RFC\ 1101
116 .SH この文書について
117 この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.65 の一部
118 である。プロジェクトの説明とバグ報告に関する情報は
119 http://www.kernel.org/doc/man\-pages/ に書かれている。