OSDN Git Service

(split) Import translated manuals from JM CVS Repository.
[linuxjm/LDP_man-pages.git] / draft / man3 / ether_aton.3
1 .\" Hey Emacs! This file is -*- nroff -*- source.
2 .\"
3 .\" Copyright 2002 Ian Redfern (redferni@logica.com)
4 .\"
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.
8 .\"
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.
13 .\"
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
20 .\" professionally.
21 .\"
22 .\" Formatted or processed versions of this manual, if unaccompanied by
23 .\" the source, must acknowledge the copyright and authors of this work.
24 .\"
25 .\" References consulted:
26 .\"     Linux libc source code
27 .\"     FreeBSD 4.4 man pages
28 .\"
29 .\" Minor additions, aeb, 2002-07-20
30 .\"
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>
34 .\"
35 .TH ETHER_ATON 3  2002-07-20 "GNU" "Linux Programmer's Manual"
36 .\"O .SH NAME
37 .SH Ì¾Á°
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 ¥¢¥É¥ì¥¹¤ÎÁàºîÍÑ´Ø¿ô
42 .\"O .SH SYNOPSIS
43 .SH ½ñ¼°
44 .nf
45 .B #include <netinet/ether.h>
46 .sp
47 .BI "char *ether_ntoa(const struct ether_addr *" addr );
48 .sp
49 .BI "struct ether_addr *ether_aton(const char *" asc );
50 .sp
51 .BI "int ether_ntohost(char *" hostname ", const struct ether_addr *" addr );
52 .sp
53 .BI "int ether_hostton(const char *" hostname ", struct ether_addr *" addr );
54 .sp
55 .BI "int ether_line(const char *" line ", struct ether_addr *" addr ,
56 .BI "               char *" hostname );
57 .sp
58 .\"O /* GNU extensions */
59 /* GNU ³ÈÄ¥ */
60 .br
61 .BI "char *ether_ntoa_r(const struct ether_addr *" addr ", char *" buf );
62 .sp
63 .BI "struct ether_addr *ether_aton_r(const char *" asc ,
64 .BI "                                struct ether_addr *" addr );
65 .fi
66 .\"O .SH DESCRIPTION
67 .SH ÀâÌÀ
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
73 .\"O overwrite.
74 .\"O .BR ether_aton ()
75 .\"O returns NULL if the address is invalid.
76 ´Ø¿ô
77 .BR ether_aton ()
78 ¤Ï¡¢É¸½àŪ¤Ê 16¿Ê¿ô¤È¥³¥í¥ó¤Î·Á¼°¤Ç½ñ¤«¤ì¤¿ 48¥Ó¥Ã¥È¤Î
79 Ethernet ¥Û¥¹¥È¥¢¥É¥ì¥¹ \fIasc\fP ¤ò¡¢¥Í¥Ã¥È¥ï¡¼¥¯¤Ç¤Î¥Ð¥¤¥È½ç (byte order)
80 ¤Î¥Ð¥¤¥Ê¥ê¥Ç¡¼¥¿¤ËÊÑ´¹¤·¡¢ÀÅŪ¤Ë³ä¤êÅö¤Æ¤é¤ì¤¿¥Ð¥Ã¥Õ¥¡¤Ë³ÊǼ¤µ¤ì¤¿¥Ç¡¼¥¿
81 ¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£¤³¤Î¥Ð¥Ã¥Õ¥¡¤Ï¡¢¤³¤ì°Ê¹ß¤Î´Ø¿ô¸Æ¤Ó½Ð¤·¤Ç¾å½ñ¤­¤µ¤ì¤ë¡£
82 ¥¢¥É¥ì¥¹¤¬ÉÔÀµ¤Ê¾ì¹ç¡¢
83 .BR ether_aton ()
84 ¤Ï NULL ¤òÊÖ¤¹¡£
85 .PP
86 .\"O The
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.
93 ´Ø¿ô
94 .BR ether_ntoa ()
95 ¤Ï¡¢¥Í¥Ã¥È¥ï¡¼¥¯¤Î¥Ð¥¤¥È½ç¤Çɽ¤µ¤ì¤¿ Ethernet
96 ¥Û¥¹¥È¥¢¥É¥ì¥¹ \fIaddr\fP ¤ò¡¢É¸½àŪ¤Ê 16¿Ê¿ô¤È¥³¥í¥ó¤Î·Á¼°¤Îʸ»úÎó¤ËÊÑ´¹¤¹¤ë¡£
97 ⤷¡¢ÀèƬ¤Î 0 ¤Ï¾Êά¤µ¤ì¤ë¡£ÊÑ´¹¸å¤Îʸ»úÎó¤ÏÀÅŪ¤Ë³ä¤êÅö¤Æ¤é¤ì¤¿¥Ð¥Ã¥Õ¥¡
98 ¤Ë³ÊǼ¤µ¤ì¤ÆÊÖ¤µ¤ì¤ë¡£¤³¤Î¥Ð¥Ã¥Õ¥¡¤Ï¡¢¤³¤ì°Ê¹ß¤Î´Ø¿ô¸Æ¤Ó½Ð¤·¤Ç¾å½ñ¤­¤µ¤ì¤ë¡£
99 .PP
100 .\"O The
101 .\"O .BR ether_ntohost ()
102 .\"O function maps an Ethernet address to the
103 .\"O corresponding hostname in
104 .\"O .I /etc/ethers
105 .\"O and returns nonzero if it cannot be found.
106 ´Ø¿ô
107 .BR ether_ntohost ()
108 ¤Ï¡¢Ethernet ¥¢¥É¥ì¥¹¤ËÂбþ¤¹¤ë¥Û¥¹¥È̾¤ò
109 .I /etc/ethers
110 ¤ò¸¡º÷¤·¤Æ³ä¤êÅö¤Æ¤ë¡£Âбþ¤¹¤ë¥Û¥¹¥È̾¤¬¸«¤Ä¤«¤é¤Ê¤«¤Ã¤¿¾ì¹ç¤Ï¡¢
111 Èó 0 ¤òÊÖ¤¹¡£
112 .PP
113 .\"O The
114 .\"O .BR ether_hostton ()
115 .\"O function maps a hostname to the
116 .\"O corresponding Ethernet address in
117 .\"O .I /etc/ethers
118 .\"O and returns nonzero if it cannot be found.
119 ´Ø¿ô
120 .BR ether_hostton ()
121 ¤Ï¡¢¥Û¥¹¥È̾¤ËÂбþ¤¹¤ë Ethernet ¥¢¥É¥ì¥¹¤ò
122 .I /etc/ethers
123 ¤ò¸¡º÷¤·¤Æ³ä¤êÅö¤Æ¤ë¡£Âбþ¤¹¤ë¥Û¥¹¥È̾¤¬¸«¤Ä¤«¤é¤Ê¤«¤Ã¤¿¾ì¹ç¤Ï¡¢
124 Èó 0 ¤òÊÖ¤¹¡£
125 .PP
126 .\"O The
127 .\"O .BR ether_line ()
128 .\"O function parses a line in
129 .\"O .I /etc/ethers
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
134 .\"O .I hostname
135 .\"O must be sufficiently long, for example, have the same length as
136 .\"O .IR line .
137 ´Ø¿ô
138 .BR ether_line ()
139 ¤Ï¡¢
140 .I /etc/ethers
141 ·Á¼°¤Ë¤Ê¤Ã¤¿¹Ô¤ò²òÀϤ·¡¢
142 ¥¢¥É¥ì¥¹¤È¥Û¥¹¥È̾¤ÎÁȤòÊÖ¤¹
143 .RI ( /etc/ethers
144 ·Á¼°¤Ï¡¢Ethernet ¥¢¥É¥ì¥¹¡¢¥Û¥¹¥È̾¤¬¶õÇòʸ»ú (whitespace)
145 ¤Ç¶èÀÚ¤é¤ì¤¿½ñ¼°¤Ç¡¢\(aq#\(aq °Ê¹ß¤Ï¥³¥á¥ó¥È¤È¤ß¤Ê¤µ¤ì¤ë)¡£
146 ²òÀϤǤ­¤Ê¤«¤Ã¤¿¾ì¹ç¤Ï¡¢Èó 0 ¤òÊÖ¤¹¡£
147 .I hostname
148 ¤Ç»ØÄꤵ¤ì¤¿¥Ð¥Ã¥Õ¥¡¤Ï½½Ê¬¤ÊŤµ¤¬É¬ÍפǤ¢¤ë¡£¤Ä¤Þ¤ê¡¢
149 .I line
150 ¤ÈƱ¤¸Ä¹¤µ¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£
151 .PP
152 .\"O The functions
153 .\"O .BR ether_ntoa_r ()
154 .\"O and
155 .\"O .BR ether_aton_r ()
156 .\"O are reentrant
157 .\"O thread-safe versions of \fBether_ntoa\fP() and
158 .\"O .BR ether_aton ()
159 .\"O respectively, and do not use static buffers.
160 ´Ø¿ô
161 .BR ether_ntoa_r ()
162 ¤È
163 .BR ether_aton_r ()
164 ¤Ï¡¢
165 ¤½¤ì¤¾¤ì
166 .BR ether_ntoa ()
167 ¤È
168 .BR ether_aton ()
169 ¤Î
170 ¥ê¥¨¥ó¥È¥é¥ó¥È¤Ç¥¹¥ì¥Ã¥É¥»¡¼¥Õ¤Ê¥Ð¡¼¥¸¥ç¥ó¤Ç¤¢¤ê¡¢
171 ÀÅŪ¤Ê¥Ð¥Ã¥Õ¥¡¤ò»ÈÍѤ·¤Ê¤¤¡£
172 .PP
173 .\"O The structure \fIether_addr\fP is defined in
174 .\"O .I <net/ethernet.h>
175 .\"O as:
176 \fIether_addr\fP ¹½Â¤ÂΤÏ
177 .I <net/ethernet.h>
178 ¤Ç¼¡¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë:
179 .sp
180 .in +4n
181 .nf
182 struct ether_addr {
183     uint8_t ether_addr_octet[6];
184 }
185 .fi
186 .in
187 .\"O .SH "CONFORMING TO"
188 .SH ½àµò
189 4.3BSD, SunOS.
190 .\"O .SH BUGS
191 .SH ¥Ð¥°
192 .\"O The glibc 2.2.5 implementation of
193 .\"O .BR ether_line ()
194 .\"O is broken.
195 glibc 2.2.5 ¤Ç¤Î
196 .BR ether_line ()
197 ¤Î¼ÂÁõ¤Ï¤ª¤«¤·¤¤¡£
198 .\"O .SH "SEE ALSO"
199 .SH ´ØÏ¢¹àÌÜ
200 .BR ethers (5)