1 /* $NetBSD: svr4_sockio.h,v 1.6 2006/04/02 07:17:16 christos Exp $ */
2
3 /*-
4 * Copyright (c) 1995 The NetBSD Foundation, Inc.
5 * All rights reserved.
6 *
7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Christos Zoulas.
9 *
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions
12 * are met:
13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer.
15 * 2. Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in the
17 * documentation and/or other materials provided with the distribution.
18 * 3. All advertising materials mentioning features or use of this software
19 * must display the following acknowledgement:
20 * This product includes software developed by the NetBSD
21 * Foundation, Inc. and its contributors.
22 * 4. Neither the name of The NetBSD Foundation nor the names of its
23 * contributors may be used to endorse or promote products derived
24 * from this software without specific prior written permission.
25 *
26 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
27 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
28 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
29 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
30 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
31 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
32 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
33 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
34 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
35 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36 * POSSIBILITY OF SUCH DAMAGE.
37 */
38
39 #ifndef _SVR4_SOCKIO_H_
40 #define _SVR4_SOCKIO_H_
41
42
43 #define SVR4_IFF_UP 0x00000001
44 #define SVR4_IFF_BROADCAST 0x00000002
45 #define SVR4_IFF_DEBUG 0x00000004
46 #define SVR4_IFF_LOOPBACK 0x00000008
47 #define SVR4_IFF_POINTOPOINT 0x00000010
48 #define SVR4_IFF_NOTRAILERS 0x00000020
49 #define SVR4_IFF_RUNNING 0x00000040
50 #define SVR4_IFF_NOARP 0x00000080
51 #define SVR4_IFF_PROMISC 0x00000100
52 #define SVR4_IFF_ALLMULTI 0x00000200
53 #define SVR4_IFF_INTELLIGENT 0x00000400
54 #define SVR4_IFF_MULTICAST 0x00000800
55 #define SVR4_IFF_MULTI_BCAST 0x00001000
56 #define SVR4_IFF_UNNUMBERED 0x00002000
57 #define SVR4_IFF_DHCPRUNNING 0x00004000
58 #define SVR4_IFF_PRIVATE 0x00008000
59 #define SVR4_IFF_NOXMIT 0x00010000
60 #define SVR4_IFF_NOLOCAL 0x00020000
61 #define SVR4_IFF_DEPRECATED 0x00040000
62 #define SVR4_IFF_ADDRCONF 0x00080000
63 #define SVR4_IFF_ROUTER 0x00100000
64 #define SVR4_IFF_NONUD 0x00200000
65 #define SVR4_IFF_ANYCAST 0x00400000
66 #define SVR4_IFF_NORTEXCH 0x00800000
67 #define SVR4_IFF_IPV4 0x01000000
68 #define SVR4_IFF_IPV6 0x02000000
69 #define SVR4_IFF_MIPRUNNING 0x04000000
70 #define SVR4_IFF_NOFAILOVER 0x08000000
71 #define SVR4_IFF_FAILED 0x10000000
72 #define SVR4_IFF_STANDBY 0x20000000
73 #define SVR4_IFF_INACTIVE 0x40000000
74 #define SVR4_IFF_OFFLINE 0x80000000
75
76 struct svr4_ifreq {
77 #define SVR4_IFNAMSIZ 16
78 char svr4_ifr_name[SVR4_IFNAMSIZ];
79 union {
80 struct osockaddr ifru_addr;
81 struct osockaddr ifru_dstaddr;
82 struct osockaddr ifru_broadaddr;
83 short ifru_flags;
84 int ifru_metric;
85 char ifru_data;
86 char ifru_enaddr[6];
87 int if_muxid[2];
88
89 } ifr_ifru;
90
91 #define svr4_ifr_addr ifr_ifru.ifru_addr
92 #define svr4_ifr_dstaddr ifr_ifru.ifru_dstaddr
93 #define svr4_ifr_broadaddr ifr_ifru.ifru_broadaddr
94 #define svr4_ifr_flags ifr_ifru.ifru_flags
95 #define svr4_ifr_metric ifr_ifru.ifru_metric
96 #define svr4_ifr_data ifr_ifru.ifru_data
97 #define svr4_ifr_enaddr ifr_ifru.ifru_enaddr
98 #define svr4_ifr_muxid ifr_ifru.ifru_muxid
99
100 };
101
102 typedef struct lif_ifinfo_req {
103 uint8_t lir_maxhops;
104 uint32_t lir_reachtime;
105 uint32_t lir_reachretrans;
106 uint32_t lir_maxmtu;
107 } lif_ifinfo_req_t;
108
109 #define SVR4_ND_MAX_HDW_LEN 64
110 typedef struct svr4_lif_nd_req {
111 struct sockaddr_storage lnr_addr;
112 uint8_t lnr_state_create;
113 uint8_t lnr_state_same_lla;
114 uint8_t lnr_state_diff_lla;
115 int lnr_hdw_len;
116 int lnr_flags;
117 int lnr_pad0;
118 char lnr_hdw_addr[SVR4_ND_MAX_HDW_LEN];
119 } lif_nd_req_t;
120
121 struct svr4_lifreq {
122 #define SVR4_LIFNAMSIZ 32
123 char lifr_name[SVR4_LIFNAMSIZ];
124 union {
125 int lifru_addrlen;
126 u_int lifru_ppa;
127 } lifr_lifru1;
128 #define lifr_addrlen lifr_lifru1.lifru_addrlen
129 #define lifr_ppa lifr_lifru1.lifru_ppa
130 u_int lifr_movetoindex;
131 union {
132 struct sockaddr_storage lifru_addr;
133 struct sockaddr_storage lifru_dstaddr;
134 struct sockaddr_storage lifru_broadaddr;
135 struct sockaddr_storage lifru_token;
136 struct sockaddr_storage lifru_subnet;
137 int lifru_index;
138 uint64_t lifru_flags;
139 int lifru_metric;
140 u_int lifru_mtu;
141 char lifru_data[1];
142 char lifru_enaddr[6];
143 int lif_muxid[2];
144 struct svr4_lif_nd_req lifru_nd_req;
145 struct lif_ifinfo_req lifru_ifinfo_req;
146 char lifru_groupname[SVR4_LIFNAMSIZ];
147 u_int lifru_delay;
148 } lifr_lifru;
149 };
150
151 #define svr4_lifr_addr lifr_lifru.lifru_addr
152 #define svr4_lifr_dstaddr lifr_lifru.lifru_dstaddr
153 #define svr4_lifr_broadaddr lifr_lifru.lifru_broadaddr
154 #define svr4_lifr_token lifr_lifru.lifru_token
155 #define svr4_lifr_subnet lifr_lifru.lifru_subnet
156 #define svr4_lifr_index lifr_lifru.lifru_index
157 #define svr4_lifr_flags lifr_lifru.lifru_flags
158 #define svr4_lifr_metric lifr_lifru.lifru_metric
159 #define svr4_lifr_mtu lifr_lifru.lifru_mtu
160 #define svr4_lifr_data lifr_lifru.lifru_data
161 #define svr4_lifr_enaddr lifr_lifru.lifru_enaddr
162 #define svr4_lifr_index lifr_lifru.lifru_index
163 #define svr4_lifr_ip_muxid lifr_lifru.lif_muxid[0]
164 #define svr4_lifr_arp_muxid lifr_lifru.lif_muxid[1]
165 #define svr4_lifr_nd lifr_lifru.lifru_nd_req
166 #define svr4_lifr_ifinfo lifr_lifru.lifru_ifinfo_req
167 #define svr4_lifr_groupname lifr_lifru.lifru_groupname
168 #define svr4_lifr_delay lifr_lifru.lifru_delay
169
170
171 typedef u_short svr4_sa_family_t;
172
173 struct svr4_lifnum {
174 svr4_sa_family_t lifn_family;
175 int lifn_flags;
176 int lifn_count;
177 };
178
179 struct svr4_ifconf {
180 int svr4_ifc_len;
181 union {
182 caddr_t ifcu_buf;
183 struct svr4_ifreq *ifcu_req;
184 } ifc_ifcu;
185
186 #define svr4_ifc_buf ifc_ifcu.ifcu_buf
187 #define svr4_ifc_req ifc_ifcu.ifcu_req
188 };
189
190 #define SVR4_SIOC ('i' << 8)
191
192 #define SVR4_SIOCGIFFLAGS SVR4_IOWR('i', 17, struct svr4_ifreq)
193 #define SVR4_SIOCGIFCONF SVR4_IOWR('i', 20, struct svr4_ifconf)
194 #define SVR4_SIOCGIFNUM SVR4_IOR('i', 87, int)
195 #define SVR4_SIOCGLIFFLAGS SVR4_IOWR('i', 117, struct svr4_lifreq)
196 #define SVR4_SIOCGLIFNUM SVR4_IOWR('i', 130, struct svr4_lifnum)
197
198 #endif /* !_SVR4_SOCKIO_H_ */
Cache object: 9604302a79d72edc7b609242bac64cb5
|