OSDN Git Service

(split) LDP: Update draft pages
[linuxjm/LDP_man-pages.git] / draft / man3 / ether_aton.3
1 .\" Copyright 2002 Ian Redfern (redferni@logica.com)
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 .\"     FreeBSD 4.4 man pages
28 .\"
29 .\" Minor additions, aeb, 2013-06-21
30 .\"
31 .\"*******************************************************************
32 .\"
33 .\" This file was generated with po4a. Translate the source file.
34 .\"
35 .\"*******************************************************************
36 .TH ETHER_ATON 3 2013\-07\-04 GNU "Linux Programmer's Manual"
37 .SH 名前
38 ether_aton, ether_ntoa, ether_ntohost, ether_hostton, ether_line,
39 ether_ntoa_r, ether_aton_r \- Ethernet アドレスの操作用関数
40 .SH 書式
41 .nf
42 \fB#include <netinet/ether.h>\fP
43 .sp
44 \fBchar *ether_ntoa(const struct ether_addr *\fP\fIaddr\fP\fB);\fP
45 .sp
46 \fBstruct ether_addr *ether_aton(const char *\fP\fIasc\fP\fB);\fP
47 .sp
48 \fBint ether_ntohost(char *\fP\fIhostname\fP\fB, const struct ether_addr *\fP\fIaddr\fP\fB);\fP
49 .sp
50 \fBint ether_hostton(const char *\fP\fIhostname\fP\fB, struct ether_addr *\fP\fIaddr\fP\fB);\fP
51 .sp
52 \fBint ether_line(const char *\fP\fIline\fP\fB, struct ether_addr *\fP\fIaddr\fP\fB,\fP
53 \fB               char *\fP\fIhostname\fP\fB);\fP
54 .sp
55 /* GNU 拡張 */
56 .br
57 \fBchar *ether_ntoa_r(const struct ether_addr *\fP\fIaddr\fP\fB, char *\fP\fIbuf\fP\fB);\fP
58 .sp
59 \fBstruct ether_addr *ether_aton_r(const char *\fP\fIasc\fP\fB,\fP
60 \fB                                struct ether_addr *\fP\fIaddr\fP\fB);\fP
61 .fi
62 .SH 説明
63 関数 \fBether_aton\fP()  は、標準的な 16進数とコロンの形式で書かれた 48ビットの Ethernet ホストアドレス \fIasc\fP
64 を、ネットワークでのバイト順 (byte order)  のバイナリデータに変換し、静的に割り当てられたバッファに格納されたデータ
65 へのポインタを返す。このバッファは、これ以降の関数呼び出しで上書きされる。 アドレスが不正な場合、 \fBether_aton\fP()  は NULL
66 を返す。
67 .PP
68 関数 \fBether_ntoa\fP()  は、ネットワークのバイト順で表された Ethernet ホストアドレス \fIaddr\fP を、標準的な
69 16進数とコロンの形式の文字列に変換する。 但し、先頭の 0 は省略される。変換後の文字列は静的に割り当てられたバッファ
70 に格納されて返される。このバッファは、これ以降の関数呼び出しで上書きされる。
71 .PP
72 関数 \fBether_ntohost\fP()  は、Ethernet アドレスに対応するホスト名を \fI/etc/ethers\fP
73 を検索して割り当てる。対応するホスト名が見つからなかった場合は、 非 0 を返す。
74 .PP
75 関数 \fBether_hostton\fP()  は、ホスト名に対応する Ethernet アドレスを \fI/etc/ethers\fP
76 を検索して割り当てる。対応するホスト名が見つからなかった場合は、 非 0 を返す。
77 .PP
78 関数 \fBether_line\fP()  は、 \fI/etc/ethers\fP 形式になった行を解析し、 アドレスとホスト名の組を返す
79 (\fI/etc/ethers\fP 形式は、Ethernet アドレス、ホスト名が空白文字 (whitespace)
80 で区切られた書式で、\(aq#\(aq 以降はコメントとみなされる)。 解析できなかった場合は、非 0 を返す。 \fIhostname\fP
81 で指定されたバッファは十分な長さが必要である。つまり、 \fIline\fP と同じ長さでなければならない。
82 .PP
83 関数 \fBether_ntoa_r\fP()  と \fBether_aton_r\fP()  は、 それぞれ \fBether_ntoa\fP()  と
84 \fBether_aton\fP()  の リエントラントでスレッドセーフなバージョンであり、 静的なバッファを使用しない。
85 .PP
86 \fIether_addr\fP 構造体は \fI<net/ethernet.h>\fP で次のように定義されている:
87 .sp
88 .in +4n
89 .nf
90 struct ether_addr {
91     uint8_t ether_addr_octet[6];
92 }
93 .fi
94 .in
95 .SH 属性
96 .SS "マルチスレッディング (pthreads(7) 参照)"
97 関数 \fBether_aton\fP() と \fBether_ntoa\fP() はスレッドセーフではない。
98 .LP
99 関数 \fBether_ntohost\fP(), \fBether_hostton\fP(), \fBether_line\fP(),
100 \fBether_ntoa_r\fP(), \fBether_aton_r\fP() はスレッドセーフである。
101 .SH 準拠
102 4.3BSD, SunOS.
103 .SH バグ
104 glibc 2.2.5 での \fBether_line\fP()  の実装はおかしい。
105 .SH 関連項目
106 \fBethers\fP(5)
107 .SH この文書について
108 この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.52 の一部
109 である。プロジェクトの説明とバグ報告に関する情報は
110 http://www.kernel.org/doc/man\-pages/ に書かれている。