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 .TH ETHER_ATON 3 2002-07-20 "GNU" "Linux Programmer's Manual"
33 ether_aton, ether_ntoa, ether_ntohost, ether_hostton, ether_line,
34 ether_ntoa_r, ether_aton_r \- Ethernet address manipulation routines
37 .B #include <netinet/ether.h>
39 .BI "char *ether_ntoa(const struct ether_addr *" addr );
41 .BI "struct ether_addr *ether_aton(const char *" asc );
43 .BI "int ether_ntohost(char *" hostname ", const struct ether_addr *" addr );
45 .BI "int ether_hostton(const char *" hostname ", struct ether_addr *" addr );
47 .BI "int ether_line(const char *" line ", struct ether_addr *" addr ,
48 .BI " char *" hostname );
52 .BI "char *ether_ntoa_r(const struct ether_addr *" addr ", char *" buf );
54 .BI "struct ether_addr *ether_aton_r(const char *" asc ,
55 .BI " struct ether_addr *" addr );
59 converts the 48-bit Ethernet host address \fIasc\fP
60 from the standard hex-digits-and-colons notation into binary data in
61 network byte order and returns a pointer to it in a statically
62 allocated buffer, which subsequent calls will
65 returns NULL if the address is invalid.
69 function converts the Ethernet host address
70 \fIaddr\fP given in network byte order to a string in standard
71 hex-digits-and-colons notation, omitting leading zeros.
72 The string is returned in a statically allocated buffer,
73 which subsequent calls will overwrite.
77 function maps an Ethernet address to the
78 corresponding hostname in
80 and returns nonzero if it cannot be found.
84 function maps a hostname to the
85 corresponding Ethernet address in
87 and returns nonzero if it cannot be found.
91 function parses a line in
93 format (ethernet address followed by whitespace followed by
94 hostname; \(aq#\(aq introduces a comment) and returns an address
95 and hostname pair, or nonzero if it cannot be parsed.
96 The buffer pointed to by
98 must be sufficiently long, for example, have the same length as
106 thread-safe versions of
110 respectively, and do not use static buffers.
112 The structure \fIether_addr\fP is defined in
119 uint8_t ether_addr_octet[6];
126 The glibc 2.2.5 implementation of