]>
Commit | Line | Data |
---|---|---|
d7ce7006 | 1 | /*\r |
2 | * Copyright (c) 1990, 1993\r | |
3 | * The Regents of the University of California. All rights reserved.\r | |
4 | *\r | |
5 | * Redistribution and use in source and binary forms, with or without\r | |
6 | * modification, are permitted provided that the following conditions\r | |
7 | * are met:\r | |
8 | * 1. Redistributions of source code must retain the above copyright\r | |
9 | * notice, this list of conditions and the following disclaimer.\r | |
10 | * 2. Redistributions in binary form must reproduce the above copyright\r | |
11 | * notice, this list of conditions and the following disclaimer in the\r | |
12 | * documentation and/or other materials provided with the distribution.\r | |
13 | * 3. All advertising materials mentioning features or use of this software\r | |
14 | * must display the following acknowledgement:\r | |
15 | * This product includes software developed by the University of\r | |
16 | * California, Berkeley and its contributors.\r | |
17 | * 4. Neither the name of the University nor the names of its contributors\r | |
18 | * may be used to endorse or promote products derived from this software\r | |
19 | * without specific prior written permission.\r | |
20 | *\r | |
21 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND\r | |
22 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\r | |
23 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\r | |
24 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE\r | |
25 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\r | |
26 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS\r | |
27 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\r | |
28 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\r | |
29 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY\r | |
30 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\r | |
31 | * SUCH DAMAGE.\r | |
32 | *\r | |
33 | * @(#)if_dl.h 8.1 (Berkeley) 6/10/93\r | |
34 | * $Id: if_dl.h,v 1.1.1.1 2006/05/30 06:12:42 hhzhou Exp $\r | |
35 | */\r | |
36 | \r | |
37 | #ifndef _NET_IF_DL_H_\r | |
38 | #define _NET_IF_DL_H_\r | |
39 | \r | |
40 | /*\r | |
41 | * A Link-Level Sockaddr may specify the interface in one of two\r | |
42 | * ways: either by means of a system-provided index number (computed\r | |
43 | * anew and possibly differently on every reboot), or by a human-readable\r | |
44 | * string such as "il0" (for managerial convenience).\r | |
45 | *\r | |
46 | * Census taking actions, such as something akin to SIOCGCONF would return\r | |
47 | * both the index and the human name.\r | |
48 | *\r | |
49 | * High volume transactions (such as giving a link-level ``from'' address\r | |
50 | * in a recvfrom or recvmsg call) may be likely only to provide the indexed\r | |
51 | * form, (which requires fewer copy operations and less space).\r | |
52 | *\r | |
53 | * The form and interpretation of the link-level address is purely a matter\r | |
54 | * of convention between the device driver and its consumers; however, it is\r | |
55 | * expected that all drivers for an interface of a given if_type will agree.\r | |
56 | */\r | |
57 | \r | |
58 | /*\r | |
59 | * Structure of a Link-Level sockaddr:\r | |
60 | */\r | |
61 | struct sockaddr_dl {\r | |
62 | u_char sdl_len; /* Total length of sockaddr */\r | |
63 | u_char sdl_family; /* AF_DLI */\r | |
64 | u_short sdl_index; /* if != 0, system given index for interface */\r | |
65 | u_char sdl_type; /* interface type */\r | |
66 | u_char sdl_nlen; /* interface name length, no trailing 0 reqd. */\r | |
67 | u_char sdl_alen; /* link level address length */\r | |
68 | u_char sdl_slen; /* link layer selector length */\r | |
69 | char sdl_data[12]; /* minimum work area, can be larger;\r | |
70 | contains both if name and ll address */\r | |
71 | };\r | |
72 | \r | |
73 | #define LLADDR(s) ((caddr_t)((s)->sdl_data + (s)->sdl_nlen))\r | |
74 | \r | |
75 | #ifndef KERNEL\r | |
76 | \r | |
77 | #include <sys/EfiCdefs.h>\r | |
78 | \r | |
79 | __BEGIN_DECLS\r | |
3bdf9aae | 80 | void link_addr (const char *, struct sockaddr_dl *);\r |
81 | char *link_ntoa (const struct sockaddr_dl *);\r | |
d7ce7006 | 82 | __END_DECLS\r |
83 | \r | |
84 | #endif /* !KERNEL */\r | |
85 | \r | |
86 | #endif\r |