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-iso-addr.html"><LINK
29 HREF="net-common-tcpip-manpages-net-addrcmp.html"></HEAD
40 SUMMARY="Header navigation table"
49 >eCos Reference Manual</TH
57 HREF="net-common-tcpip-manpages-iso-addr.html"
65 >Chapter 38. TCP/IP Library Reference</TD
71 HREF="net-common-tcpip-manpages-net-addrcmp.html"
85 NAME="NET-COMMON-TCPIP-MANPAGES-LINK-ADDR">link_addr</H1
94 >LINK_ADDR(3) System Library Functions Manual LINK_ADDR(3)
97 link_addr, link_ntoa - elementary address specification routines for link
101 #include <sys/types.h>
102 #include <sys/socket.h>
103 #include <net/if_dl.h>
106 link_addr(const char *addr, struct sockaddr_dl *sdl);
109 link_ntoa(const struct sockaddr_dl *sdl);
112 The link_addr() function interprets character strings representing link-
113 level addresses, returning binary information suitable for use in system
114 calls. link_ntoa() takes a link-level address and returns an ASCII
115 string representing some of the information present, including the link
116 level address itself, and the interface name or number, if present. This
117 facility is experimental and is still subject to change.
119 For link_addr(), the string addr may contain an optional network inter-
120 face identifier of the form ``name unit-number'', suitable for the first
121 argument to ifconfig(8), followed in all cases by a colon and an inter-
122 face address in the form of groups of hexadecimal digits separated by
123 periods. Each group represents a byte of address; address bytes are
124 filled left to right from low order bytes through high order bytes.
126 Thus le0:8.0.9.13.d.30 represents an Ethernet address to be transmitted
127 on the first Lance Ethernet interface.
130 link_ntoa() always returns a null-terminated string. link_addr() has no
131 return value. (See BUGS.)
137 The link_addr() and link_ntoa() functions appeared in 4.3BSD-Reno.
140 The returned values for link_ntoa reside in a static memory area.
142 The function link_addr() should diagnose improperly formed input, and
143 there should be an unambiguous way to recognize this.
145 If the sdl_len field of the link socket address sdl is 0, link_ntoa()
146 will not insert a colon before the interface address bytes. If this
147 translated address is given to link_addr() without inserting an initial
148 colon, the latter will not interpret it correctly.
150 BSD July 28, 1993 BSD
161 SUMMARY="Footer navigation table"
172 HREF="net-common-tcpip-manpages-iso-addr.html"
190 HREF="net-common-tcpip-manpages-net-addrcmp.html"
206 HREF="tcpip-library-reference.html"