1 <!-- Copyright (C) 2003 Red Hat, Inc. -->
2 <!-- This material may be distributed only subject to the terms -->
3 <!-- and conditions set forth in the Open Publication License, v1.0 -->
4 <!-- or later (the latest version is presently available at -->
5 <!-- http://www.opencontent.org/openpub/). -->
6 <!-- Distribution of the work or derivative of the work in any -->
7 <!-- standard (paper) book form is prohibited unless prior -->
8 <!-- permission is obtained from the copyright holder. -->
13 ><meta name="MSSmartTagsPreventParsing" content="TRUE">
16 CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
19 TITLE="eCos Reference Manual"
20 HREF="ecos-ref.html"><LINK
22 TITLE="TCP/IP Library Reference"
23 HREF="tcpip-library-reference.html"><LINK
26 HREF="net-common-tcpip-manpages-byteorder.html"><LINK
29 HREF="net-common-tcpip-manpages-getaddrinfo.html"></HEAD
40 SUMMARY="Header navigation table"
49 >eCos Reference Manual</TH
57 HREF="net-common-tcpip-manpages-byteorder.html"
65 >Chapter 38. TCP/IP Library Reference</TD
71 HREF="net-common-tcpip-manpages-getaddrinfo.html"
85 NAME="NET-COMMON-TCPIP-MANPAGES-ETHERS">ethers</H1
94 >ETHERS(3) System Library Functions Manual ETHERS(3)
97 ether_aton, ether_ntoa, ether_addr, ether_ntohost, ether_hostton,
98 ether_line - get ethers entry
101 #include <netinet/if_ether.h>
104 ether_ntoa(struct ether_addr *e);
110 ether_ntohost(char *hostname, struct ether_addr *e);
113 ether_hostton(char *hostname, struct ether_addr *e);
116 ether_line(char *l, struct ether_addr *e, char *hostname);
119 Ethernet addresses are represented by the following structure:
122 u_int8_t ether_addr_octet[6];
125 The ether_ntoa() function converts this structure into an ASCII string of
126 the form ``xx:xx:xx:xx:xx:xx'', consisting of 6 hexadecimal numbers sepa-
127 rated by colons. It returns a pointer to a static buffer that is reused
128 for each call. The ether_aton() converts an ASCII string of the same
129 form and to a structure containing the 6 octets of the address. It
130 returns a pointer to a static structure that is reused for each call.
132 The ether_ntohost() and ether_hostton() functions interrogate the
133 database mapping host names to Ethernet addresses, /etc/ethers. The
134 ether_ntohost() function looks up the given Ethernet address and writes
135 the associated host name into the character buffer passed. This buffer
136 should be MAXHOSTNAMELEN characters in size. The ether_hostton() func-
137 tion looks up the given host name and writes the associated Ethernet
138 address into the structure passed. Both functions return zero if they
139 find the requested host name or address, and -1 if not.
141 Each call reads /etc/ethers from the beginning; if a `+' appears alone on
142 a line in the file, then ether_hostton() will consult the ethers.byname
143 YP map, and ether_ntohost() will consult the ethers.byaddr YP map.
145 The ether_line() function parses a line from the /etc/ethers file and
146 fills in the passed struct ether_addr and character buffer with the Eth-
147 ernet address and host name on the line. It returns zero if the line was
148 successfully parsed and -1 if not. The character buffer should be
149 MAXHOSTNAMELEN characters in size.
158 The ether_ntoa(), ether_aton(), ether_ntohost(), ether_hostton(), and
159 ether_line() functions were adopted from SunOS and appeared in NetBSD 0.9
163 The data space used by these functions is static; if future use requires
164 the data, it should be copied before any subsequent calls to these func-
167 BSD December 16, 1993 BSD
178 SUMMARY="Footer navigation table"
189 HREF="net-common-tcpip-manpages-byteorder.html"
207 HREF="net-common-tcpip-manpages-getaddrinfo.html"
223 HREF="tcpip-library-reference.html"