xref: /openbsd-src/lib/libc/net/link_ntoa.3 (revision fb6aaed3c4e172b693235e9e8ac886d4c6583c6c)
1*fb6aaed3Sjmc.\"	$OpenBSD: link_ntoa.3,v 1.2 2015/09/10 10:14:20 jmc Exp $
2af64ca04Smpi.\"
3af64ca04Smpi.\" Copyright (c) 1993
4af64ca04Smpi.\"	The Regents of the University of California.  All rights reserved.
5af64ca04Smpi.\"
6af64ca04Smpi.\" This code is derived from software contributed to Berkeley by
7af64ca04Smpi.\" Donn Seeley at BSDI.
8af64ca04Smpi.\"
9af64ca04Smpi.\" Redistribution and use in source and binary forms, with or without
10af64ca04Smpi.\" modification, are permitted provided that the following conditions
11af64ca04Smpi.\" are met:
12af64ca04Smpi.\" 1. Redistributions of source code must retain the above copyright
13af64ca04Smpi.\"    notice, this list of conditions and the following disclaimer.
14af64ca04Smpi.\" 2. Redistributions in binary form must reproduce the above copyright
15af64ca04Smpi.\"    notice, this list of conditions and the following disclaimer in the
16af64ca04Smpi.\"    documentation and/or other materials provided with the distribution.
17af64ca04Smpi.\" 3. Neither the name of the University nor the names of its contributors
18af64ca04Smpi.\"    may be used to endorse or promote products derived from this software
19af64ca04Smpi.\"    without specific prior written permission.
20af64ca04Smpi.\"
21af64ca04Smpi.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
22af64ca04Smpi.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23af64ca04Smpi.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24af64ca04Smpi.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
25af64ca04Smpi.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26af64ca04Smpi.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27af64ca04Smpi.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28af64ca04Smpi.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29af64ca04Smpi.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30af64ca04Smpi.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31af64ca04Smpi.\" SUCH DAMAGE.
32af64ca04Smpi.\"
33af64ca04Smpi.Dd $Mdocdate: September 10 2015 $
34af64ca04Smpi.Dt LINK_NTOA 3
35af64ca04Smpi.Os
36af64ca04Smpi.Sh NAME
37af64ca04Smpi.Nm link_ntoa
38*fb6aaed3Sjmc.Nd elementary address specification routine for link level access
39af64ca04Smpi.Sh SYNOPSIS
40af64ca04Smpi.In sys/types.h
41af64ca04Smpi.In sys/socket.h
42af64ca04Smpi.In net/if_dl.h
43af64ca04Smpi.Ft char *
44af64ca04Smpi.Fn link_ntoa "const struct sockaddr_dl *sdl"
45af64ca04Smpi.Sh DESCRIPTION
46af64ca04SmpiThe
47af64ca04Smpi.Fn link_ntoa
48af64ca04Smpifunction takes
49af64ca04Smpia link-level
50af64ca04Smpiaddress and returns an
51af64ca04Smpi.Tn ASCII
52af64ca04Smpistring representing some of the information present,
53af64ca04Smpiincluding the link level address itself, and the interface name
54af64ca04Smpior number, if present.
55af64ca04SmpiThis facility is experimental and is
56af64ca04Smpistill subject to change.
57af64ca04Smpi.Sh RETURN VALUES
58af64ca04Smpi.Fn link_ntoa
59af64ca04Smpialways returns a NUL-terminated string.
60af64ca04Smpi.Sh SEE ALSO
61af64ca04Smpi.Xr ifconfig 8
62af64ca04Smpi.Sh HISTORY
63af64ca04SmpiThe
64af64ca04Smpi.Fn link_ntoa
65af64ca04Smpifunction appeared in
66af64ca04Smpi.Bx 4.3 Reno .
67af64ca04Smpi.Sh BUGS
68af64ca04SmpiThe returned values for
69af64ca04Smpi.Fn link_ntoa
70af64ca04Smpireside in a static memory area.
71af64ca04Smpi.Pp
72af64ca04SmpiIf the
73af64ca04Smpi.Fa sdl_len
74af64ca04Smpifield of the link socket address
75af64ca04Smpi.Fa sdl
76af64ca04Smpiis 0,
77af64ca04Smpi.Fn link_ntoa
78af64ca04Smpiwill not insert a colon before the interface address bytes.
79