1 .\" Hey Emacs! This file is -*- nroff -*- source.
3 .\" Copyright 2002 Ian Redfern (redferni@logica.com)
5 .\" Permission is granted to make and distribute verbatim copies of this
6 .\" manual provided the copyright notice and this permission notice are
7 .\" preserved on all copies.
9 .\" Permission is granted to copy and distribute modified versions of this
10 .\" manual under the conditions for verbatim copying, provided that the
11 .\" entire resulting derived work is distributed under the terms of a
12 .\" permission notice identical to this one.
14 .\" Since the Linux kernel and libraries are constantly changing, this
15 .\" manual page may be incorrect or out-of-date. The author(s) assume no
16 .\" responsibility for errors or omissions, or for damages resulting from
17 .\" the use of the information contained herein. The author(s) may not
18 .\" have taken the same level of care in the production of this manual,
19 .\" which is licensed free of charge, as they might when working
22 .\" Formatted or processed versions of this manual, if unaccompanied by
23 .\" the source, must acknowledge the copyright and authors of this work.
25 .\" References consulted:
26 .\" Linux libc source code
27 .\" FreeBSD 4.4 man pages
29 .\" Minor additions, aeb, 2002-07-20
31 .\" Japanese Version Copyright (c) 2002 Akihiro MOTOKI
32 .\" all rights reserved.
33 .\" Translated Thu Aug 22 2002 by Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
35 .TH ETHER_ATON 3 2002-07-20 "GNU" "Linux Programmer's Manual"
38 .\"O ether_aton, ether_ntoa, ether_ntohost, ether_hostton, ether_line,
39 .\"O ether_ntoa_r, ether_aton_r \- Ethernet address manipulation routines
40 ether_aton, ether_ntoa, ether_ntohost, ether_hostton, ether_line,
41 ether_ntoa_r, ether_aton_r \- Ethernet アドレスの操作用関数
45 .B #include <netinet/ether.h>
47 .BI "char *ether_ntoa(const struct ether_addr *" addr );
49 .BI "struct ether_addr *ether_aton(const char *" asc );
51 .BI "int ether_ntohost(char *" hostname ", const struct ether_addr *" addr );
53 .BI "int ether_hostton(const char *" hostname ", struct ether_addr *" addr );
55 .BI "int ether_line(const char *" line ", struct ether_addr *" addr ,
56 .BI " char *" hostname );
58 .\"O /* GNU extensions */
61 .BI "char *ether_ntoa_r(const struct ether_addr *" addr ", char *" buf );
63 .BI "struct ether_addr *ether_aton_r(const char *" asc ,
64 .BI " struct ether_addr *" addr );
68 .\"O .BR ether_aton ()
69 .\"O converts the 48-bit Ethernet host address \fIasc\fP
70 .\"O from the standard hex-digits-and-colons notation into binary data in
71 .\"O network byte order and returns a pointer to it in a statically
72 .\"O allocated buffer, which subsequent calls will
74 .\"O .BR ether_aton ()
75 .\"O returns NULL if the address is invalid.
78 は、標準的な 16進数とコロンの形式で書かれた 48ビットの
79 Ethernet ホストアドレス \fIasc\fP を、ネットワークでのバイト順 (byte order)
80 のバイナリデータに変換し、静的に割り当てられたバッファに格納されたデータ
81 へのポインタを返す。このバッファは、これ以降の関数呼び出しで上書きされる。
87 .\"O .BR ether_ntoa ()
88 .\"O function converts the Ethernet host address
89 .\"O \fIaddr\fP given in network byte order to a string in standard
90 .\"O hex-digits-and-colons notation, omitting leading zeros.
91 .\"O The string is returned in a statically allocated buffer,
92 .\"O which subsequent calls will overwrite.
95 は、ネットワークのバイト順で表された Ethernet
96 ホストアドレス \fIaddr\fP を、標準的な 16進数とコロンの形式の文字列に変換する。
97 但し、先頭の 0 は省略される。変換後の文字列は静的に割り当てられたバッファ
98 に格納されて返される。このバッファは、これ以降の関数呼び出しで上書きされる。
101 .\"O .BR ether_ntohost ()
102 .\"O function maps an Ethernet address to the
103 .\"O corresponding hostname in
105 .\"O and returns nonzero if it cannot be found.
108 は、Ethernet アドレスに対応するホスト名を
110 を検索して割り当てる。対応するホスト名が見つからなかった場合は、
114 .\"O .BR ether_hostton ()
115 .\"O function maps a hostname to the
116 .\"O corresponding Ethernet address in
118 .\"O and returns nonzero if it cannot be found.
121 は、ホスト名に対応する Ethernet アドレスを
123 を検索して割り当てる。対応するホスト名が見つからなかった場合は、
127 .\"O .BR ether_line ()
128 .\"O function parses a line in
130 .\"O format (ethernet address followed by whitespace followed by
131 .\"O hostname; \(aq#\(aq introduces a comment) and returns an address
132 .\"O and hostname pair, or nonzero if it cannot be parsed.
133 .\"O The buffer pointed to by
135 .\"O must be sufficiently long, for example, have the same length as
144 形式は、Ethernet アドレス、ホスト名が空白文字 (whitespace)
145 で区切られた書式で、\(aq#\(aq 以降はコメントとみなされる)。
148 で指定されたバッファは十分な長さが必要である。つまり、
153 .\"O .BR ether_ntoa_r ()
155 .\"O .BR ether_aton_r ()
157 .\"O thread-safe versions of \fBether_ntoa\fP() and
158 .\"O .BR ether_aton ()
159 .\"O respectively, and do not use static buffers.
170 リエントラントでスレッドセーフなバージョンであり、
173 .\"O The structure \fIether_addr\fP is defined in
174 .\"O .I <net/ethernet.h>
176 \fIether_addr\fP 構造体は
183 uint8_t ether_addr_octet[6];
187 .\"O .SH "CONFORMING TO"
192 .\"O The glibc 2.2.5 implementation of
193 .\"O .BR ether_line ()