Expand PMF_FN_* macros.
[netbsd-mini2440.git] / sys / compat / svr4 / svr4_sockio.h
blob9c3be214a2b0c532f582a9bafceb8a5a553c23b3
1 /* $NetBSD: svr4_sockio.h,v 1.8 2007/12/05 01:10:47 dyoung Exp $ */
3 /*-
4 * Copyright (c) 1995 The NetBSD Foundation, Inc.
5 * All rights reserved.
7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Christos Zoulas.
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.
19 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
20 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
23 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 * POSSIBILITY OF SUCH DAMAGE.
32 #ifndef _SVR4_SOCKIO_H_
33 #define _SVR4_SOCKIO_H_
36 #define SVR4_IFF_UP 0x00000001
37 #define SVR4_IFF_BROADCAST 0x00000002
38 #define SVR4_IFF_DEBUG 0x00000004
39 #define SVR4_IFF_LOOPBACK 0x00000008
40 #define SVR4_IFF_POINTOPOINT 0x00000010
41 #define SVR4_IFF_NOTRAILERS 0x00000020
42 #define SVR4_IFF_RUNNING 0x00000040
43 #define SVR4_IFF_NOARP 0x00000080
44 #define SVR4_IFF_PROMISC 0x00000100
45 #define SVR4_IFF_ALLMULTI 0x00000200
46 #define SVR4_IFF_INTELLIGENT 0x00000400
47 #define SVR4_IFF_MULTICAST 0x00000800
48 #define SVR4_IFF_MULTI_BCAST 0x00001000
49 #define SVR4_IFF_UNNUMBERED 0x00002000
50 #define SVR4_IFF_DHCPRUNNING 0x00004000
51 #define SVR4_IFF_PRIVATE 0x00008000
52 #define SVR4_IFF_NOXMIT 0x00010000
53 #define SVR4_IFF_NOLOCAL 0x00020000
54 #define SVR4_IFF_DEPRECATED 0x00040000
55 #define SVR4_IFF_ADDRCONF 0x00080000
56 #define SVR4_IFF_ROUTER 0x00100000
57 #define SVR4_IFF_NONUD 0x00200000
58 #define SVR4_IFF_ANYCAST 0x00400000
59 #define SVR4_IFF_NORTEXCH 0x00800000
60 #define SVR4_IFF_IPV4 0x01000000
61 #define SVR4_IFF_IPV6 0x02000000
62 #define SVR4_IFF_MIPRUNNING 0x04000000
63 #define SVR4_IFF_NOFAILOVER 0x08000000
64 #define SVR4_IFF_FAILED 0x10000000
65 #define SVR4_IFF_STANDBY 0x20000000
66 #define SVR4_IFF_INACTIVE 0x40000000
67 #define SVR4_IFF_OFFLINE 0x80000000
69 struct svr4_ifreq {
70 #define SVR4_IFNAMSIZ 16
71 char svr4_ifr_name[SVR4_IFNAMSIZ];
72 union {
73 struct osockaddr ifru_addr;
74 struct osockaddr ifru_dstaddr;
75 struct osockaddr ifru_broadaddr;
76 short ifru_flags;
77 int ifru_metric;
78 char ifru_data;
79 char ifru_enaddr[6];
80 int if_muxid[2];
82 } ifr_ifru;
84 #define svr4_ifr_addr ifr_ifru.ifru_addr
85 #define svr4_ifr_dstaddr ifr_ifru.ifru_dstaddr
86 #define svr4_ifr_broadaddr ifr_ifru.ifru_broadaddr
87 #define svr4_ifr_flags ifr_ifru.ifru_flags
88 #define svr4_ifr_metric ifr_ifru.ifru_metric
89 #define svr4_ifr_data ifr_ifru.ifru_data
90 #define svr4_ifr_enaddr ifr_ifru.ifru_enaddr
91 #define svr4_ifr_muxid ifr_ifru.ifru_muxid
95 typedef struct lif_ifinfo_req {
96 uint8_t lir_maxhops;
97 uint32_t lir_reachtime;
98 uint32_t lir_reachretrans;
99 uint32_t lir_maxmtu;
100 } lif_ifinfo_req_t;
102 #define SVR4_ND_MAX_HDW_LEN 64
103 typedef struct svr4_lif_nd_req {
104 struct sockaddr_storage lnr_addr;
105 uint8_t lnr_state_create;
106 uint8_t lnr_state_same_lla;
107 uint8_t lnr_state_diff_lla;
108 int lnr_hdw_len;
109 int lnr_flags;
110 int lnr_pad0;
111 char lnr_hdw_addr[SVR4_ND_MAX_HDW_LEN];
112 } lif_nd_req_t;
114 struct svr4_lifreq {
115 #define SVR4_LIFNAMSIZ 32
116 char lifr_name[SVR4_LIFNAMSIZ];
117 union {
118 int lifru_addrlen;
119 u_int lifru_ppa;
120 } lifr_lifru1;
121 #define lifr_addrlen lifr_lifru1.lifru_addrlen
122 #define lifr_ppa lifr_lifru1.lifru_ppa
123 u_int lifr_movetoindex;
124 union {
125 struct sockaddr_storage lifru_addr;
126 struct sockaddr_storage lifru_dstaddr;
127 struct sockaddr_storage lifru_broadaddr;
128 struct sockaddr_storage lifru_token;
129 struct sockaddr_storage lifru_subnet;
130 int lifru_index;
131 uint64_t lifru_flags;
132 int lifru_metric;
133 u_int lifru_mtu;
134 char lifru_data[1];
135 char lifru_enaddr[6];
136 int lif_muxid[2];
137 struct svr4_lif_nd_req lifru_nd_req;
138 struct lif_ifinfo_req lifru_ifinfo_req;
139 char lifru_groupname[SVR4_LIFNAMSIZ];
140 u_int lifru_delay;
141 } lifr_lifru;
144 #define svr4_lifr_addr lifr_lifru.lifru_addr
145 #define svr4_lifr_dstaddr lifr_lifru.lifru_dstaddr
146 #define svr4_lifr_broadaddr lifr_lifru.lifru_broadaddr
147 #define svr4_lifr_token lifr_lifru.lifru_token
148 #define svr4_lifr_subnet lifr_lifru.lifru_subnet
149 #define svr4_lifr_index lifr_lifru.lifru_index
150 #define svr4_lifr_flags lifr_lifru.lifru_flags
151 #define svr4_lifr_metric lifr_lifru.lifru_metric
152 #define svr4_lifr_mtu lifr_lifru.lifru_mtu
153 #define svr4_lifr_data lifr_lifru.lifru_data
154 #define svr4_lifr_enaddr lifr_lifru.lifru_enaddr
155 #define svr4_lifr_index lifr_lifru.lifru_index
156 #define svr4_lifr_ip_muxid lifr_lifru.lif_muxid[0]
157 #define svr4_lifr_arp_muxid lifr_lifru.lif_muxid[1]
158 #define svr4_lifr_nd lifr_lifru.lifru_nd_req
159 #define svr4_lifr_ifinfo lifr_lifru.lifru_ifinfo_req
160 #define svr4_lifr_groupname lifr_lifru.lifru_groupname
161 #define svr4_lifr_delay lifr_lifru.lifru_delay
164 typedef u_short svr4_sa_family_t;
166 struct svr4_lifnum {
167 svr4_sa_family_t lifn_family;
168 int lifn_flags;
169 int lifn_count;
172 struct svr4_ifconf {
173 int svr4_ifc_len;
174 union {
175 void * ifcu_buf;
176 struct svr4_ifreq *ifcu_req;
177 } ifc_ifcu;
179 #define svr4_ifc_buf ifc_ifcu.ifcu_buf
180 #define svr4_ifc_req ifc_ifcu.ifcu_req
183 #define SVR4_SIOC ('i' << 8)
185 #define SVR4_SIOCGIFFLAGS SVR4_IOWR('i', 17, struct svr4_ifreq)
186 #define SVR4_SIOCGIFCONF SVR4_IOWR('i', 20, struct svr4_ifconf)
187 #define SVR4_SIOCGIFNUM SVR4_IOR('i', 87, int)
188 #define SVR4_SIOCGLIFFLAGS SVR4_IOWR('i', 117, struct svr4_lifreq)
189 #define SVR4_SIOCGLIFNUM SVR4_IOWR('i', 130, struct svr4_lifnum)
191 #ifdef _KERNEL
192 int svr4_count_ifnum(struct ifnet *);
193 #endif /* _KERNEL */
195 #endif /* !_SVR4_SOCKIO_H_ */