OSDN Git Service

(split) LDP: draft snapshot generated from latest ja.po files.
[linuxjm/LDP_man-pages.git] / draft / man3 / inet_pton.3
index d15c4f4..9cdf373 100644 (file)
 .\" the source, must acknowledge the copyright and authors of this work.
 .\"
 .\" References: RFC 2553
+.\"*******************************************************************
 .\"
-.\" Japanese Version Copyright (c) 2001 NAKANO Takeo all rights reserved.
-.\" Translated 2001-01-14, NAKANO Takeo <nakano@apm.seikei.ac.jp>
-.\" Updated 2008-08-08, Akihiro MOTOKI, LDP v3.05
+.\" This file was generated with po4a. Translate the source file.
 .\"
-.TH INET_PTON 3  2008-06-18 "Linux" "Linux Programmer's Manual"
-.\"O .SH NAME
-.\"O inet_pton \- convert IPv4 and IPv6 addresses from text to binary form
+.\"*******************************************************************
+.TH INET_PTON 3 2008\-06\-18 Linux "Linux Programmer's Manual"
 .SH 名前
 inet_pton \- IPv4/IPv6 アドレスをテキスト形式からバイナリ形式に変換する
-.\"O .SH SYNOPSIS
 .SH 書式
 .nf
-.B #include <arpa/inet.h>
+\fB#include <arpa/inet.h>\fP
 
-.BI "int inet_pton(int " "af" ", const char *" "src" ", void *" "dst" );
+\fBint inet_pton(int \fP\fIaf\fP\fB, const char *\fP\fIsrc\fP\fB, void *\fP\fIdst\fP\fB);\fP
 .fi
-.\"O .SH DESCRIPTION
 .SH 説明
-.\"O This function converts the character string
-.\"O .I src
-.\"O into a network address structure in the
-.\"O .I af
-.\"O address family, then
-.\"O copies
-.\"O the network address structure to
-.\"O .IR dst .
-この関数は文字列
-.I src
-を、アドレスファミリー
-.I af
-のネットワークアドレス構造体に変換し、
-.I dst
-にコピーする。
-.\"O The
-.\"O .I af
-.\"O argument must be either
-.\"O .B AF_INET
-.\"O or
-.\"O .BR AF_INET6 .
-.I af
-引き数は
-.B AF_INET
-か
-.B AF_INET6
-のどちらかでなければならない。
+この関数は文字列 \fIsrc\fP を、アドレスファミリー \fIaf\fP のネットワークアドレス構造体に変換し、 \fIdst\fP にコピーする。 \fIaf\fP
+引き数は \fBAF_INET\fP か \fBAF_INET6\fP のどちらかでなければならない。
 .PP
-.\"O The following address families are currently supported:
 現在サポートされているアドレスファミリーは以下の通りである。
-.TP
-.B AF_INET
-.\"O .I src
-.\"O points to a character string containing an IPv4 network address in
-.\"O dotted-decimal format, "\fIddd.ddd.ddd.ddd\fP", where
-.\"O .I ddd
-.\"O is a decimal number of up to three digits in the range 0 to 255.
-.\"O The address is converted to a
-.\"O .I struct in_addr
-.\"O and copied to
-.\"O .IR dst ,
-.\"O which must be
-.\"O .I sizeof(struct in_addr)
-.\"O (4) bytes (32 bits) long.
-.I src
-はドット区切りの 10 進数形式 "\fIddd.ddd.ddd.ddd\fP"
-の IPv4 ネットワークアドレス文字列へのポインタである。
-.I ddd
-は 0 から 255 までの範囲の最大 3 桁の 10 進数である。
-このアドレスは
-.I "struct in_addr"
-に変換されて
-.I dst
-にコピーされる。
-.I dst
-の長さは
-.I "sizeof(struct in_addr)"
-(4) バイト (32ビット) でなければならない。
-.TP
-.B AF_INET6
-.\"O .I src
-.\"O points to a character string containing an IPv6 network address.
-.\"O The address is converted to a
-.\"O .I struct in6_addr
-.\"O and copied to
-.\"O .IR dst ,
-.\"O which must be
-.\"O .I sizeof(struct in6_addr)
-.\"O (16) bytes (128 bits) long.
-.I src
-は IPv6 ネットワークアドレスが格納された文字列へのポインタである。
-このアドレスは
-.I "struct in6_addr"
-に変換されて
-.I dst
-にコピーされる。
-.I dst
-の長さは
-.I "sizeof(struct in6_addr)"
-(16) バイト (128 ビット) でなければならない。
-.\"O The allowed formats for IPv6 addresses follow these rules:
-以下の 3 つのルールにしたがった形式が IPv6 アドレスとして入力できる。
+.TP 
+\fBAF_INET\fP
+\fIsrc\fP はドット区切りの 10 進数形式 "\fIddd.ddd.ddd.ddd\fP" の IPv4 ネットワークアドレス文字列へのポインタである。
+\fIddd\fP は 0 から 255 までの範囲の最大 3 桁の 10 進数である。 このアドレスは \fIstruct in_addr\fP に変換されて
+\fIdst\fP にコピーされる。 \fIdst\fP の長さは \fIsizeof(struct in_addr)\fP (4) バイト (32ビット)
+でなければならない。
+.TP 
+\fBAF_INET6\fP
+\fIsrc\fP は IPv6 ネットワークアドレスが格納された文字列へのポインタである。 このアドレスは \fIstruct in6_addr\fP
+に変換されて \fIdst\fP にコピーされる。 \fIdst\fP の長さは \fIsizeof(struct in6_addr)\fP (16) バイト (128
+ビット) でなければならない。 以下の 3 つのルールにしたがった形式が IPv6 アドレスとして入力できる。
 .RS
 .IP 1. 3
-.\"O The preferred format is
-.\"O .IR x:x:x:x:x:x:x:x .
-.\"O This form consists of eight hexadecimal numbers,
-.\"O each of which expresses a 16-bit value (i.e., each
-.\"O .I x
-.\"O can be up to 4 hex digits).
-推奨形式は
-.I x:x:x:x:x:x:x:x
-である。この形式は 8 個の 16 進数から構成され、
-各々の 16 進数は 16 ビット値を表す
-.RI ( x
-は最大 4 桁の 16 進数である)。
+推奨形式は \fIx:x:x:x:x:x:x:x\fP である。この形式は 8 個の 16 進数から構成され、 各々の 16 進数は 16 ビット値を表す
+(\fIx\fP は最大 4 桁の 16 進数である)。
 .IP 2.
-.\"O A series of contiguous zero values in the preferred format
-.\"O can be abbreviated to
-.\"O .IR :: .
-.\"O Only one instance of
-.\"O .I ::
-.\"O can occur in an address.
-.\"O For example, the loopback address
-.\"O .I 0:0:0:0:0:0:0:1
-.\"O can be abbreviated as
-.\"O .IR ::1 .
-.\"O The wildcard address, consisting of all zeros, can be written as
-.\"O .IR :: .
-推奨形式の中の連続する 0 の列は
-.I ::
-に短縮できる。アドレス中で使用できる
-.I ::
-は 1 個だけである。
-例えば、ループバックアドレス
-.I 0:0:0:0:0:0:0:1
-は
-.I ::1
-と短縮できる。
-全ビットが 0 で構成されるワイルドカードアドレスは
-.I ::
-と記載できる。
+推奨形式の中の連続する 0 の列は \fI::\fP に短縮できる。アドレス中で使用できる \fI::\fP は 1 個だけである。 例えば、ループバックアドレス
+\fI0:0:0:0:0:0:0:1\fP は \fI::1\fP と短縮できる。 全ビットが 0 で構成されるワイルドカードアドレスは \fI::\fP と記載できる。
 .IP 3.
-.\"O An alternate format is useful for expressing IPv4-mapped IPv6 addresses.
-.\"O This form is written as
-.\"O .IR x:x:x:x:x:x:d.d.d.d ,
-.\"O where the six leading
-.\"O .IR x s
-.\"O are hexadecimal values that define the six most-significant
-.\"O 16-bit pieces of the address (i.e., 96 bits), and the
-.\"O .IR d s
-.\"O express a value in dotted-decimal notation that
-.\"O defines the least significant 32 bits of the address.
-.\"O An example of such an address is
-.\"O .IR ::FFFF:204.152.189.116 .
-IPv4 をマッピングした IPv6 アドレスを表記するには別の形式が便利である。
-この別の形式は
-.I x:x:x:x:x:x:d.d.d.d
-と書くことができる。
-最初の 6 個の
-.I x
-はアドレスを 16 ビット単位に区切ったときの上位側 6 個分 (つまり 96 ビット分)
-を定義する 16 進数であり、
-.I d
-の部分はアドレスの下位 32 ビットをドット区切りの 10 進数表記で表したものである。
-.I ::FFFF:204.152.189.116
-はこの形式の例である。
+IPv4 をマッピングした IPv6 アドレスを表記するには別の形式が便利である。 この別の形式は \fIx:x:x:x:x:x:d.d.d.d\fP
+と書くことができる。 最初の 6 個の \fIx\fP はアドレスを 16 ビット単位に区切ったときの上位側 6 個分 (つまり 96 ビット分)
+を定義する 16 進数であり、 \fId\fP の部分はアドレスの下位 32 ビットをドット区切りの 10 進数表記で表したものである。
+\fI::FFFF:204.152.189.116\fP はこの形式の例である。
 .RE
 .IP
-.\"O See RFC 2373 for further details on the representation of IPv6 addresses.
 IPv6 アドレスの表現方法の詳細については RFC 2373 を参照のこと。
-.\"O .SH "RETURN VALUE"
 .SH 返り値
-.\"O .BR inet_pton ()
-.\"O returns 1 on success (network address was successfully converted).
-.\"O 0 is returned if
-.\"O .I src
-.\"O does not contain a character string representing a valid network
-.\"O address in the specified address family.
-.\"O If
-.\"O .I af
-.\"O does not contain a valid address family, \-1 is returned and
-.\"O .I errno
-.\"O is set to
-.\"O .BR EAFNOSUPPORT .
-成功する (ネットワークアドレスが正常に変換される) と、
-.BR inet_pton ()
-は 1 を返す。
-.I src
-が指定されたアドレスファミリーに対する
-正しいネットワークアドレス表記でない場合には、
-0 を返す。
-.I af
-がサポートされているアドレスファミリーでない場合には、
-\-1 を返し、
-.I errno
-に
-.B EAFNOSUPPORT
-を設定する。
-.\"O .SH "CONFORMING TO"
+成功する (ネットワークアドレスが正常に変換される) と、 \fBinet_pton\fP()  は 1 を返す。 \fIsrc\fP
+が指定されたアドレスファミリーに対する 正しいネットワークアドレス表記でない場合には、 0 を返す。 \fIaf\fP
+がサポートされているアドレスファミリーでない場合には、 \-1 を返し、 \fIerrno\fP に \fBEAFNOSUPPORT\fP を設定する。
 .SH 準拠
-POSIX.1-2001.
-.\"O .SH NOTES
+POSIX.1\-2001.
 .SH 注意
-.\"O Unlike
-.\"O .BR inet_aton (3)
-.\"O and
-.\"O .BR inet_addr (3),
-.\"O .BR inet_pton ()
-.\"O supports IPv6 addresses.
-.BR inet_aton (3)
-や
-.BR inet_addr (3)
-と異なり、
-.BR inet_pton ()
-は IPv6 アドレスに対応している。
-.\"O On the other hand,
-.\"O .BR inet_pton ()
-.\"O only accepts IPv4 addresses in dotted-decimal notation, whereas
-.\"O .BR inet_aton (3)
-.\"O and
-.\"O .BR inet_addr (3)
-.\"O allow the more general numbers-and-dots notation (hexadecimal
-.\"O and octal number formats, and formats that don't require all
-.\"O four bytes to be explicitly written).
-.\"O For an interface that handles both IPv6 addresses, and IPv4
-.\"O addresses in numbers-and-dots notation, see
-.\"O .BR getaddrinfo (3).
-一方で、
-.BR inet_pton ()
-が受け付ける IPv4 アドレスはドット区切りの 10 進数表記だけである。
-これに対し、
-.BR inet_aton (3)
-や
-.BR inet_addr (3)
-ではもっと一般的なドット区切りの数字表記 (16 進数や 8 進数の形式や、
-4 バイト全てを明示的に書かなくてもよい形式) が使用できる。
-ドット区切りの数字表記で IPv6 アドレスと IPv4 アドレスの両方を扱える
-インターフェイスについては、
-.BR getaddrinfo (3)
-を参照のこと。
-.\"O .SH BUGS
+\fBinet_aton\fP(3)  や \fBinet_addr\fP(3)  と異なり、 \fBinet_pton\fP()  は IPv6
+アドレスに対応している。 一方で、 \fBinet_pton\fP()  が受け付ける IPv4 アドレスはドット区切りの 10 進数表記だけである。
+これに対し、 \fBinet_aton\fP(3)  や \fBinet_addr\fP(3)  ではもっと一般的なドット区切りの数字表記 (16 進数や 8
+進数の形式や、 4 バイト全てを明示的に書かなくてもよい形式) が使用できる。 ドット区切りの数字表記で IPv6 アドレスと IPv4
+アドレスの両方を扱える インターフェイスについては、 \fBgetaddrinfo\fP(3)  を参照のこと。
 .SH バグ
-.\"O .B AF_INET6
-.\"O does not recognize IPv4 addresses.
-.\"O An explicit IPv4-mapped IPv6 address must be supplied in
-.\"O .I src
-.\"O instead.
-.B AF_INET6
-は IPv4 アドレスを認識しない。
-代わりに IPv4 アドレスをマッピングした IPv6 アドレスを
-.I src
+\fBAF_INET6\fP は IPv4 アドレスを認識しない。 代わりに IPv4 アドレスをマッピングした IPv6 アドレスを \fIsrc\fP
 に与えなければならない。
-.\"O .SH EXAMPLE
 .SH 例
-.\"O The program below demonstrates the use of
-.\"O .BR inet_pton ()
-.\"O and
-.\"O .BR inet_ntop (3).
-.\"O Here are some example runs:
-以下のプログラムは
-.BR inet_pton ()
-と
-.BR inet_ntop (3)
-の使用例を示すものである。
-実行すると以下のようになる。
+以下のプログラムは \fBinet_pton\fP()  と \fBinet_ntop\fP(3)  の使用例を示すものである。 実行すると以下のようになる。
 .in +4n
 .nf
 
-.RB "$" " ./a.out i6 0:0:0:0:0:0:0:0"
+$\fB ./a.out i6 0:0:0:0:0:0:0:0\fP
 ::
-.RB "$" " ./a.out i6 1:0:0:0:0:0:0:8"
+$\fB ./a.out i6 1:0:0:0:0:0:0:8\fP
 1::8
-.RB "$" " ./a.out i6 0:0:0:0:0:FFFF:204.152.189.116"
+$\fB ./a.out i6 0:0:0:0:0:FFFF:204.152.189.116\fP
 ::ffff:204.152.189.116
 .fi
 .in
-.\"O .SS Program source
 .SS プログラムのソース
 \&
 .nf
@@ -315,7 +111,7 @@ main(int argc, char *argv[])
     char str[INET6_ADDRSTRLEN];
 
     if (argc != 3) {
-        fprintf(stderr, "Usage: %s {i4|i6|<num>} string\\n", argv[0]);
+        fprintf(stderr, "Usage: %s {i4|i6|<num>} string\en", argv[0]);
         exit(EXIT_FAILURE);
     }
 
@@ -336,13 +132,10 @@ main(int argc, char *argv[])
         exit(EXIT_FAILURE);
     }
 
-    printf("%s\\n", str);
+    printf("%s\en", str);
 
     exit(EXIT_SUCCESS);
 }
 .fi
-.\"O .SH "SEE ALSO"
 .SH 関連項目
-.BR getaddrinfo (3),
-.BR inet (3),
-.BR inet_ntop (3)
+\fBgetaddrinfo\fP(3), \fBinet\fP(3), \fBinet_ntop\fP(3)