summaryrefslogtreecommitdiff
path: root/src/lib/libc/net/link_addr.3
diff options
context:
space:
mode:
authormpi <>2015-09-10 08:55:03 +0000
committermpi <>2015-09-10 08:55:03 +0000
commitf4a4d0ccce6152a6e48d345c33b3db9dbdaad529 (patch)
treeea9141da77f5fe91ab8c243446511127e8420f6b /src/lib/libc/net/link_addr.3
parenta57a02cff3b4a8e50efcf63a01ff0b7176072766 (diff)
downloadopenbsd-f4a4d0ccce6152a6e48d345c33b3db9dbdaad529.tar.gz
openbsd-f4a4d0ccce6152a6e48d345c33b3db9dbdaad529.tar.bz2
openbsd-f4a4d0ccce6152a6e48d345c33b3db9dbdaad529.zip
Remove link_addr(3). A function to encode the name of an interface in
a sockaddr_dl is a questionnable interface. But now it makes it harder to properly reference ifp becauses of this. Set sdl_index to the index of the corresponding interface when constructing a routing message. Ridding previous libc crank. ok guenther@, deraadt@, dlg@
Diffstat (limited to 'src/lib/libc/net/link_addr.3')
-rw-r--r--src/lib/libc/net/link_addr.3127
1 files changed, 0 insertions, 127 deletions
diff --git a/src/lib/libc/net/link_addr.3 b/src/lib/libc/net/link_addr.3
deleted file mode 100644
index f234fe84cc..0000000000
--- a/src/lib/libc/net/link_addr.3
+++ /dev/null
@@ -1,127 +0,0 @@
1.\" $OpenBSD: link_addr.3,v 1.13 2013/06/05 03:39:23 tedu Exp $
2.\"
3.\" Copyright (c) 1993
4.\" The Regents of the University of California. All rights reserved.
5.\"
6.\" This code is derived from software contributed to Berkeley by
7.\" Donn Seeley at BSDI.
8.\"
9.\" Redistribution and use in source and binary forms, with or without
10.\" modification, are permitted provided that the following conditions
11.\" are met:
12.\" 1. Redistributions of source code must retain the above copyright
13.\" notice, this list of conditions and the following disclaimer.
14.\" 2. Redistributions in binary form must reproduce the above copyright
15.\" notice, this list of conditions and the following disclaimer in the
16.\" documentation and/or other materials provided with the distribution.
17.\" 3. Neither the name of the University nor the names of its contributors
18.\" may be used to endorse or promote products derived from this software
19.\" without specific prior written permission.
20.\"
21.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
22.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
25.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31.\" SUCH DAMAGE.
32.\"
33.Dd $Mdocdate: June 5 2013 $
34.Dt LINK_ADDR 3
35.Os
36.Sh NAME
37.Nm link_addr ,
38.Nm link_ntoa
39.Nd elementary address specification routines for link level access
40.Sh SYNOPSIS
41.In sys/types.h
42.In sys/socket.h
43.In net/if_dl.h
44.Ft void
45.Fn link_addr "const char *addr" "struct sockaddr_dl *sdl"
46.Ft char *
47.Fn link_ntoa "const struct sockaddr_dl *sdl"
48.Sh DESCRIPTION
49The
50.Fn link_addr
51function interprets character strings representing
52link-level addresses, returning binary information suitable
53for use in system calls.
54.Fn link_ntoa
55takes
56a link-level
57address and returns an
58.Tn ASCII
59string representing some of the information present,
60including the link level address itself, and the interface name
61or number, if present.
62This facility is experimental and is
63still subject to change.
64.Pp
65For
66.Fn link_addr ,
67the string
68.Fa addr
69may contain
70an optional network interface identifier of the form
71.Dq name unit-number ,
72suitable for the first argument to
73.Xr ifconfig 8 ,
74followed in all cases by a colon and
75an interface address in the form of
76groups of hexadecimal digits
77separated by periods.
78Each group represents a byte of address;
79address bytes are filled left to right from
80low order bytes through high order bytes.
81.Pp
82.\" A regular expression may make this format clearer:
83.\" .Bd -literal -offset indent
84.\" ([a-z]+[0-9]+:)?[0-9a-f]+(\e.[0-9a-f]+)*
85.\" .Ed
86.\" .Pp
87Thus
88.Li le0:8.0.9.13.d.30
89represents an Ethernet address
90to be transmitted on the first Lance Ethernet interface.
91.Sh RETURN VALUES
92.Fn link_ntoa
93always returns a NUL-terminated string.
94.Fn link_addr
95has no return value.
96(See
97.Sx BUGS . )
98.Sh SEE ALSO
99.Xr ifconfig 8
100.Sh HISTORY
101The
102.Fn link_addr
103and
104.Fn link_ntoa
105functions appeared in
106.Bx 4.3 Reno .
107.Sh BUGS
108The returned values for
109.Fn link_ntoa
110reside in a static memory area.
111.Pp
112The function
113.Fn link_addr
114should diagnose improperly formed input, and there should be an unambiguous
115way to recognize this.
116.Pp
117If the
118.Fa sdl_len
119field of the link socket address
120.Fa sdl
121is 0,
122.Fn link_ntoa
123will not insert a colon before the interface address bytes.
124If this translated address is given to
125.Fn link_addr
126without inserting an initial colon,
127the latter will not interpret it correctly.