-.\" Hey Emacs! This file is -*- nroff -*- source.
-.\"
.\" Copyright 2002 Ian Redfern (redferni@logica.com)
.\"
+.\" %%%LICENSE_START(VERBATIM)
.\" Permission is granted to make and distribute verbatim copies of this
.\" manual provided the copyright notice and this permission notice are
.\" preserved on all copies.
.\"
.\" Formatted or processed versions of this manual, if unaccompanied by
.\" the source, must acknowledge the copyright and authors of this work.
+.\" %%%LICENSE_END
.\"
.\" References consulted:
.\" Linux libc source code
.\" FreeBSD 4.4 man pages
.\"
-.\" Minor additions, aeb, 2002-07-20
+.\" Minor additions, aeb, 2013-06-21
.\"
-.TH ETHER_ATON 3 2002-07-20 "GNU" "Linux Programmer's Manual"
+.TH ETHER_ATON 3 2017-09-15 "GNU" "Linux Programmer's Manual"
.SH NAME
ether_aton, ether_ntoa, ether_ntohost, ether_hostton, ether_line,
ether_ntoa_r, ether_aton_r \- Ethernet address manipulation routines
.SH SYNOPSIS
.nf
.B #include <netinet/ether.h>
-.sp
+.PP
.BI "char *ether_ntoa(const struct ether_addr *" addr );
-.sp
+.PP
.BI "struct ether_addr *ether_aton(const char *" asc );
-.sp
+.PP
.BI "int ether_ntohost(char *" hostname ", const struct ether_addr *" addr );
-.sp
+.PP
.BI "int ether_hostton(const char *" hostname ", struct ether_addr *" addr );
-.sp
+.PP
.BI "int ether_line(const char *" line ", struct ether_addr *" addr ,
.BI " char *" hostname );
-.sp
+.PP
/* GNU extensions */
.br
.BI "char *ether_ntoa_r(const struct ether_addr *" addr ", char *" buf );
-.sp
+.PP
.BI "struct ether_addr *ether_aton_r(const char *" asc ,
.BI " struct ether_addr *" addr );
.fi
.SH DESCRIPTION
.BR ether_aton ()
-converts the 48-bit Ethernet host address \fIasc\fP
+converts the 48-bit Ethernet host address
+.I asc
from the standard hex-digits-and-colons notation into binary data in
network byte order and returns a pointer to it in a statically
allocated buffer, which subsequent calls will
The
.BR ether_ntoa ()
function converts the Ethernet host address
-\fIaddr\fP given in network byte order to a string in standard
+.I addr
+given in network byte order to a string in standard
hex-digits-and-colons notation, omitting leading zeros.
The string is returned in a statically allocated buffer,
which subsequent calls will overwrite.
.BR ether_aton ()
respectively, and do not use static buffers.
.PP
-The structure \fIether_addr\fP is defined in
+The structure
+.I ether_addr
+is defined in
.I <net/ethernet.h>
as:
-.sp
+.PP
.in +4n
-.nf
+.EX
struct ether_addr {
uint8_t ether_addr_octet[6];
}
-.fi
+.EE
.in
-.SH "CONFORMING TO"
+.SH ATTRIBUTES
+For an explanation of the terms used in this section, see
+.BR attributes (7).
+.ad l
+.TS
+allbox;
+lbw33 lb lb
+l l l.
+Interface Attribute Value
+T{
+.BR ether_aton (),
+.BR ether_ntoa ()
+T} Thread safety MT-Unsafe
+T{
+.BR ether_ntohost (),
+.BR ether_hostton (),
+.BR ether_line (),
+.BR ether_ntoa_r (),
+.BR ether_aton_r ()
+T} Thread safety MT-Safe
+.TE
+.ad
+.SH CONFORMING TO
4.3BSD, SunOS.
.SH BUGS
-The glibc 2.2.5 implementation of
+In glibc 2.2.5 and earlier, the implementation of
.BR ether_line ()
+.\" The fix was presumably commit c0a0f9a32c8baa6ab93d00eb42d92c02e9e146d7
+.\" which was in glibc 2.3
is broken.
-.SH "SEE ALSO"
+.SH SEE ALSO
.BR ethers (5)