.\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk) .\" .\" %%%LICENSE_START(VERBATIM) .\" Permission is granted to make and distribute verbatim copies of this .\" manual provided the copyright notice and this permission notice are .\" preserved on all copies. .\" .\" Permission is granted to copy and distribute modified versions of this .\" manual under the conditions for verbatim copying, provided that the .\" entire resulting derived work is distributed under the terms of a .\" permission notice identical to this one. .\" .\" Since the Linux kernel and libraries are constantly changing, this .\" manual page may be incorrect or out-of-date. The author(s) assume no .\" responsibility for errors or omissions, or for damages resulting from .\" the use of the information contained herein. The author(s) may not .\" have taken the same level of care in the production of this manual, .\" which is licensed free of charge, as they might when working .\" professionally. .\" .\" Formatted or processed versions of this manual, if unaccompanied by .\" the source, must acknowledge the copyright and authors of this work. .\" %%%LICENSE_END .\" .\" References consulted: .\" Linux libc source code .\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991) .\" 386BSD man pages .\" Modified Sat Jul 24 21:48:06 1993 by Rik Faith (faith@cs.unc.edu) .\"******************************************************************* .\" .\" This file was generated with po4a. Translate the source file. .\" .\"******************************************************************* .\" .\" Japanese Version Copyright (c) 1998 NAKANO Takeo all rights reserved. .\" Translated 1998-03-01, NAKANO Takeo .\" Modified 1998-06-22, NAKANO Takeo .\" Updated 2008-09-19, Akihiro MOTOKI .\" .TH GETNETENT 3 2008\-08\-19 GNU "Linux Programmer's Manual" .SH 名前 getnetent, getnetbyname, getnetbyaddr, setnetent, endnetent \- ネットワークエントリーを取得する .SH 書式 .nf \fB#include \fP .sp \fBstruct netent *getnetent(void);\fP .sp \fBstruct netent *getnetbyname(const char *\fP\fIname\fP\fB);\fP .sp \fBstruct netent *getnetbyaddr(uint32_t \fP\fInet\fP\fB, int \fP\fItype\fP\fB);\fP .sp \fBvoid setnetent(int \fP\fIstayopen\fP\fB);\fP .sp \fBvoid endnetent(void);\fP .fi .SH 説明 \fBgetnetent\fP() 関数はネットワークデータベースから次のエントリーを読み込み、 そのエントリーを \fInetent\fP 構造体の要素別のフィールドに格納し、 その構造体を返す。 必要であれば、データベースへの接続がオープンされる。 .PP \fBgetnetbyname\fP() 関数は、ネットワーク名 \fIname\fP にマッチするエントリーを データベースから探し、そのエントリーを収めた \fInetent\fP 構造体を返す。 .PP \fBgetnetbyaddr\fP() 関数は、\fItype\fP 型のネットワーク番号 \fInet\fP にマッチするエントリーを データベースから探し、そのエントリーを収めた \fInetent\fP 構造体を返す。 \fInet\fP 引き数はホストバイトオーダでなければならない。 .PP \fBsetnetent\fP() 関数はデータベースへの接続をオープンし、 次の読み込みエントリーを先頭のエントリーに設定する。 \fIstayopen\fP が 0 でない場合、 一つ一つの \fBgetnet*\fP() 関数の呼び出し間でデータベースへの接続をクローズしない。 .PP \fBendnetent\fP() 関数はデータベースへの接続をクローズする。 .PP \fInetent\fP 構造体は \fI\fP で以下のように定義されている。 .sp .in +4n .nf struct netent { char *n_name; /* official network name */ char **n_aliases; /* alias list */ int n_addrtype; /* net address type */ uint32_t n_net; /* network number */ } .fi .in .PP \fInetent\fP 構造体のメンバは以下の通り。 .TP \fIn_name\fP ネットワークの正式名 (official name)。 .TP \fIn_aliases\fP ネットワークの別名からなるリスト。 リストはヌルで終端される。 .TP \fIn_addrtype\fP ネットワーク番号の形式。現在は \fBAF_INET\fP のみ。 .TP \fIn_net\fP ホストバイトオーダ形式のネットワーク番号。 .SH 返り値 \fBgetnetent\fP(), \fBgetnetbyname\fP(), \fBgetnetbyaddr\fP() 関数は、静的に割り当てられた \fInetent\fP 構造体へのポインターを返す。 エラーが起こったり、ファイルの末尾に達した場合はヌルポインターを返す。 .SH ファイル .TP \fI/etc/networks\fP ネットワークデータベースファイル .SH 準拠 4.3BSD, POSIX.1\-2001. .SH 注意 バージョン 2.2 より前の glibc では、 \fBgetnetbyaddr\fP() の引き数 \fInet\fP は \fIlong\fP 型だった。 .SH 関連項目 .\" .BR networks (5) \fBgetnetent_r\fP(3), \fBgetprotoent\fP(3), \fBgetservent\fP(3) .br RFC\ 1101 .SH この文書について この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.79 の一部 である。プロジェクトの説明とバグ報告に関する情報は http://www.kernel.org/doc/man\-pages/ に書かれている。