This manual page is for Mac OS X version 10.6.3

If you are running a different version of Mac OS X, view the documentation locally:

  • In Terminal, using the man(1) command

Reading manual pages

Manual pages are intended as a quick reference for people who already understand a technology.

  • For more information about the manual page format, see the manual page for manpages(5).

  • For more information about this technology, look for other documentation in the Apple Reference Library.

  • For general information about writing shell scripts, read Shell Scripting Primer.



LINK_ADDR(3)                            BSD Library Functions Manual                            LINK_ADDR(3)

NAME
     link_addr, link_ntoa -- elementary address specification routines for link level access

LIBRARY
     Standard C Library (libc, -lc)

SYNOPSIS
     #include <sys/types.h>
     #include <sys/socket.h>
     #include <net/if_dl.h>

     void
     link_addr(const char *addr, struct sockaddr_dl *sdl);

     char *
     link_ntoa(const struct sockaddr_dl *sdl);

DESCRIPTION
     The routine link_addr() interprets character strings representing link-level addresses, returning
     binary information suitable for use in system calls.  The routine link_ntoa() takes a link-level
     address and returns an ASCII string representing some of the information present, including the link
     level address itself, and the interface name or number, if present.  This facility is experimental and
     is still subject to change.

     For link_addr(), the string addr may contain an optional network interface identifier of the form
     ``name unit-number'', suitable for the first argument to ifconfig(8), followed in all cases by a colon
     and an interface address in the form of groups of hexadecimal digits separated by periods.  Each group
     represents a byte of address; address bytes are filled left to right from low order bytes through high
     order bytes.

     Thus le0:8.0.9.13.d.30 represents an ethernet address to be transmitted on the first Lance ethernet
     interface.

     The direct use of these functions is deprecated in favor of the addr2ascii(3) interface; however, por-table portable
     table programs cannot rely on the latter as it is not yet widely implemented.

RETURN VALUES
     The link_ntoa() function always returns a null terminated string.  The link_addr() function has no
     return value.  (See BUGS.)

SEE ALSO
     addr2ascii(3)

HISTORY
     The link_addr() and link_ntoa() functions appeared in 4.3BSD-Reno.

BUGS
     The returned values for link_ntoa reside in a static memory area.

     The function link_addr() should diagnose improperly formed input, and there should be an unambiguous
     way to recognize this.

     If the sdl_len field of the link socket address sdl is 0, link_ntoa() will not insert a colon before
     the interface address bytes.  If this translated address is given to link_addr() without inserting an
     initial colon, the latter will not interpret it correctly.

BSD                                             June 17, 1996                                            BSD

Reporting Problems

The way to report a problem with this manual page depends on the type of problem:

Content errors
Report errors in the content of this documentation with the feedback links below.
Bug reports
Report bugs in the functionality of the described tool or API through Bug Reporter.
Formatting problems
Report formatting mistakes in the online version of these pages with the feedback links below.

Did this document help you? Yes It's good, but... Not helpful...