netbsd32_ioctl.h revision 1.41.8.1 1 /* $NetBSD: netbsd32_ioctl.h,v 1.41.8.1 2014/03/18 07:18:22 msaitoh Exp $ */
2
3 /*
4 * Copyright (c) 1998, 2001 Matthew R. Green
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
9 * are met:
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
17 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
18 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
19 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
20 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
21 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
23 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
24 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26 * SUCH DAMAGE.
27 */
28
29 #include <sys/device.h>
30 #include <sys/disklabel.h>
31 #include <sys/disk.h>
32
33 #include <net/zlib.h>
34
35 #include <dev/dkvar.h>
36 #include <dev/vndvar.h>
37
38 #include <dev/wscons/wsconsio.h>
39 #include <net80211/ieee80211_ioctl.h>
40
41 /* we define some handy macros here... */
42 #define IOCTL_STRUCT_CONV_TO(cmd, type) \
43 size = IOCPARM_LEN(cmd); \
44 if (size > sizeof(stkbuf)) \
45 data = memp = kmem_alloc(size, KM_SLEEP); \
46 else \
47 data = (void *)stkbuf; \
48 __CONCAT(netbsd32_to_, type)((struct __CONCAT(netbsd32_, type) *) \
49 data32, (struct type *)data, cmd); \
50 error = (*fp->f_ops->fo_ioctl)(fp, cmd, data); \
51 __CONCAT(netbsd32_from_, type)((struct type *)data, \
52 (struct __CONCAT(netbsd32_, type) *)data32, cmd); \
53 break
54
55 #define IOCTL_CONV_TO(cmd, type) \
56 size = IOCPARM_LEN(cmd); \
57 if (size > sizeof(stkbuf)) \
58 data = memp = kmem_alloc(size, KM_SLEEP); \
59 else \
60 data = (void *)stkbuf; \
61 __CONCAT(netbsd32_to_, type)((__CONCAT(netbsd32_, type) *) \
62 data32, (type *)data, cmd); \
63 error = (*fp->f_ops->fo_ioctl)(fp, cmd, data); \
64 __CONCAT(netbsd32_from_, type)((type *)data, \
65 (__CONCAT(netbsd32_, type) *)data32, cmd); \
66 break
67
68 /* from <sys/audioio.h> */
69 #define AUDIO_WSEEK32 _IOR('A', 25, netbsd32_u_long)
70
71 /* from <sys/dkio.h> */
72 typedef netbsd32_pointer_t netbsd32_disklabel_tp_t;
73 typedef netbsd32_pointer_t netbsd32_partition_tp_t;
74 struct netbsd32_partinfo {
75 netbsd32_disklabel_tp_t disklab;
76 netbsd32_partition_tp_t part;
77 };
78 #if 1
79 #define DIOCGPART32 _IOW('d', 104, struct netbsd32_partinfo) /* get partition */
80 #endif
81
82 #if 0 /* not implemented by anything */
83 struct netbsd32_format_op {
84 netbsd32_charp df_buf;
85 int df_count; /* value-result */
86 daddr_t df_startblk;
87 int df_reg[8]; /* result */
88 };
89 #define DIOCRFORMAT32 _IOWR('d', 105, struct netbsd32_format_op)
90 #define DIOCWFORMAT32 _IOWR('d', 106, struct netbsd32_format_op)
91 #endif
92
93 /* from <sys/ataio.h> */
94 struct netbsd32_atareq {
95 netbsd32_u_long flags;
96 u_char command;
97 u_char features;
98 u_char sec_count;
99 u_char sec_num;
100 u_char head;
101 u_short cylinder;
102 netbsd32_voidp databuf;
103 netbsd32_u_long datalen;
104 int timeout;
105 u_char retsts;
106 u_char error;
107 };
108 #define ATAIOCCOMMAND32 _IOWR('Q', 8, struct netbsd32_atareq)
109
110
111 /* from <net/bpf.h> */
112 struct netbsd32_bpf_program {
113 u_int bf_len;
114 netbsd32_pointer_t bf_insns;
115 };
116
117 struct netbsd32_bpf_dltlist {
118 u_int bfl_len;
119 netbsd32_pointer_t bfl_list;
120 };
121
122 #define BIOCSETF32 _IOW('B',103, struct netbsd32_bpf_program)
123 #define BIOCSTCPF32 _IOW('B',114, struct netbsd32_bpf_program)
124 #define BIOCSUDPF32 _IOW('B',115, struct netbsd32_bpf_program)
125 #define BIOCGDLTLIST32 _IOWR('B',119, struct netbsd32_bpf_dltlist)
126
127
128 struct netbsd32_wsdisplay_addscreendata {
129 int idx; /* screen index */
130 netbsd32_charp screentype;
131 netbsd32_charp emul;
132 };
133 #define WSDISPLAYIO_ADDSCREEN32 _IOW('W', 78, struct netbsd32_wsdisplay_addscreendata)
134
135 /* the first member must be matched with struct ifreq */
136 struct netbsd32_ieee80211_nwkey {
137 char i_name[IFNAMSIZ]; /* if_name, e.g. "wi0" */
138 int i_wepon; /* wep enabled flag */
139 int i_defkid; /* default encrypt key id */
140 struct {
141 int i_keylen;
142 netbsd32_charp i_keydat;
143 } i_key[IEEE80211_WEP_NKID];
144 };
145 #define SIOCS80211NWKEY32 _IOW('i', 232, struct netbsd32_ieee80211_nwkey)
146 #define SIOCG80211NWKEY32 _IOWR('i', 233, struct netbsd32_ieee80211_nwkey)
147
148 /* for powerd */
149 #define POWER_EVENT_RECVDICT32 _IOWR('P', 1, struct netbsd32_plistref)
150
151 /* Colormap operations. Not applicable to all display types. */
152 struct netbsd32_wsdisplay_cmap {
153 u_int index; /* first element (0 origin) */
154 u_int count; /* number of elements */
155 netbsd32_charp red; /* red color map elements */
156 netbsd32_charp green; /* green color map elements */
157 netbsd32_charp blue; /* blue color map elements */
158 };
159
160 #define WSDISPLAYIO_GETCMAP32 _IOW('W', 66, struct netbsd32_wsdisplay_cmap)
161 #define WSDISPLAYIO_PUTCMAP32 _IOW('W', 67, struct netbsd32_wsdisplay_cmap)
162
163 struct netbsd32_wsdisplay_cursor {
164 u_int which; /* values to get/set */
165 u_int enable; /* enable/disable */
166 struct wsdisplay_curpos pos; /* position */
167 struct wsdisplay_curpos hot; /* hot spot */
168 struct netbsd32_wsdisplay_cmap cmap; /* color map info */
169 struct wsdisplay_curpos size; /* bit map size */
170 netbsd32_charp image; /* image data */
171 netbsd32_charp mask; /* mask data */
172 };
173
174 /* Cursor control: get/set cursor attributes/shape */
175 #define WSDISPLAYIO_GCURSOR32 _IOWR('W', 73, struct netbsd32_wsdisplay_cursor)
176 #define WSDISPLAYIO_SCURSOR32 _IOW('W', 74, struct netbsd32_wsdisplay_cursor)
177
178 /* can wait! */
179 #if 0
180 dev/ccdvar.h:219:#define CCDIOCSET _IOWR('F', 16, struct ccd_ioctl) /* enable ccd */
181 dev/ccdvar.h:220:#define CCDIOCCLR _IOW('F', 17, struct ccd_ioctl) /* disable ccd */
182
183 dev/md.h:45:#define MD_GETCONF _IOR('r', 0, struct md_conf) /* get unit config */
184 dev/md.h:46:#define MD_SETCONF _IOW('r', 1, struct md_conf) /* set unit config */
185
186 dev/wscons/wsconsio.h:133:#define WSKBDIO_GETMAP _IOWR('W', 13, struct wskbd_map_data)
187 dev/wscons/wsconsio.h:134:#define WSKBDIO_SETMAP _IOW('W', 14, struct wskbd_map_data)
188
189 dev/wscons/wsconsio.h:188:#define WSDISPLAYIO_GETCMAP _IOW('W', 66, struct wsdisplay_cmap)
190 dev/wscons/wsconsio.h:189:#define WSDISPLAYIO_PUTCMAP _IOW('W', 67, struct wsdisplay_cmap)
191
192 dev/wscons/wsconsio.h:241:#define WSDISPLAYIO_SFONT _IOW('W', 77, struct wsdisplay_font)
193
194 net/if_ppp.h:110:#define PPPIOCSPASS _IOW('t', 71, struct bpf_program) /* set pass filter */
195 net/if_ppp.h:111:#define PPPIOCSACTIVE _IOW('t', 70, struct bpf_program) /* set active filt */
196
197 net/if_atm.h:88:#define SIOCATMENA _IOWR('a', 123, struct atm_pseudoioctl) /* enable */
198 net/if_atm.h:89:#define SIOCATMDIS _IOWR('a', 124, struct atm_pseudoioctl) /* disable */
199
200 net/if_ppp.h:105:#define PPPIOCSCOMPRESS _IOW('t', 77, struct ppp_option_data)
201
202 netccitt/x25.h:157:#define SIOCSIFCONF_X25 _IOW('i', 12, struct ifreq_x25) /* set ifnet config */
203 netccitt/x25.h:158:#define SIOCGIFCONF_X25 _IOWR('i',13, struct ifreq_x25) /* get ifnet config */
204
205 netinet/ip_fil.h:46:#define SIOCGETFS _IOR('r', 64, struct friostat)
206 netinet/ip_fil.h:56:#define SIOCFRZST _IOWR('r', 74, struct friostat)
207
208 netinet/ip_fil.h:42:#define SIOCADAFR _IOW('r', 60, struct frentry)
209 netinet/ip_fil.h:43:#define SIOCRMAFR _IOW('r', 61, struct frentry)
210 netinet/ip_fil.h:49:#define SIOCADIFR _IOW('r', 67, struct frentry)
211 netinet/ip_fil.h:50:#define SIOCRMIFR _IOW('r', 68, struct frentry)
212 netinet/ip_fil.h:52:#define SIOCINAFR _IOW('r', 70, struct frentry)
213 netinet/ip_fil.h:53:#define SIOCINIFR _IOW('r', 71, struct frentry)
214 netinet/ip_fil.h:57:#define SIOCZRLST _IOWR('r', 75, struct frentry)
215
216 netinet/ip_fil.h:78:#define SIOCAUTHW _IOWR(r, 76, struct fr_info)
217 netinet/ip_fil.h:79:#define SIOCAUTHR _IOWR(r, 77, struct fr_info)
218
219 netinet/ip_fil.h:60:#define SIOCATHST _IOWR('r', 78, struct fr_authstat)
220
221 netinet/ip_nat.h:22:#define SIOCADNAT _IOW('r', 80, struct ipnat)
222 netinet/ip_nat.h:23:#define SIOCRMNAT _IOW('r', 81, struct ipnat)
223
224 netinet/ip_nat.h:24:#define SIOCGNATS _IOR('r', 82, struct natstat)
225
226 netinet/ip_nat.h:25:#define SIOCGNATL _IOWR('r', 83, struct natlookup)
227
228 netinet/ip_nat.h:26:#define SIOCGFRST _IOR('r', 84, struct ipfrstat)
229
230 netinet/ip_nat.h:27:#define SIOCGIPST _IOR('r', 85, struct ips_stat)
231
232 sys/module.h?
233
234 sys/rnd.h:186:#define RNDGETPOOL _IOR('R', 103, u_char *) /* get whole pool */
235
236 sys/scanio.h:86:#define SCIOCGET _IOR('S', 1, struct scan_io) /* retrieve parameters */
237 sys/scanio.h:87:#define SCIOCSET _IOW('S', 2, struct scan_io) /* set parameters */
238
239 sys/scsiio.h:43:#define SCIOCCOMMAND _IOWR('Q', 1, scsireq_t)
240 #endif
241
242 /* from <net/if.h> */
243
244 typedef netbsd32_pointer_t netbsd32_ifreq_tp_t;
245 /*
246 * note that ifr_data is the only one that needs to be changed
247 */
248 struct netbsd32_oifreq {
249 char ifr_name[IFNAMSIZ]; /* if name, e.g. "en0" */
250 union {
251 struct sockaddr ifru_addr;
252 struct sockaddr ifru_dstaddr;
253 struct sockaddr ifru_broadaddr;
254 short ifru_flags;
255 int ifru_metric;
256 int ifru_mtu;
257 int ifru_dlt;
258 u_int ifru_value;
259 netbsd32_caddr_t ifru_data;
260 struct {
261 uint32_t b_buflen;
262 netbsd32_caddr_t b_buf;
263 } ifru_b;
264 } ifr_ifru;
265 #define ifr_addr ifr_ifru.ifru_addr /* address */
266 #define ifr_dstaddr ifr_ifru.ifru_dstaddr /* other end of p-to-p link */
267 #define ifr_broadaddr ifr_ifru.ifru_broadaddr /* broadcast address */
268 #define ifr_flags ifr_ifru.ifru_flags /* flags */
269 #define ifr_metric ifr_ifru.ifru_metric /* metric */
270 #define ifr_mtu ifr_ifru.ifru_mtu /* mtu */
271 #define ifr_media ifr_ifru.ifru_metric /* media options (overload) */
272 #define ifr_data ifr_ifru.ifru_data /* for use by interface */
273 };
274 struct netbsd32_ifreq {
275 char ifr_name[IFNAMSIZ]; /* if name, e.g. "en0" */
276 union {
277 struct sockaddr ifru_addr;
278 struct sockaddr ifru_dstaddr;
279 struct sockaddr ifru_broadaddr;
280 struct sockaddr_storage ifru_space;
281 short ifru_flags;
282 int ifru_metric;
283 int ifru_mtu;
284 int ifru_dlt;
285 u_int ifru_value;
286 netbsd32_caddr_t ifru_data;
287 struct {
288 uint32_t b_buflen;
289 netbsd32_caddr_t b_buf;
290 } ifru_b;
291 } ifr_ifru;
292 };
293
294 struct netbsd32_if_addrprefreq {
295 char ifap_name[IFNAMSIZ];
296 uint16_t ifap_preference;
297 struct {
298 __uint8_t ss_len; /* address length */
299 sa_family_t ss_family; /* address family */
300 char __ss_pad1[_SS_PAD1SIZE];
301 __int32_t __ss_align[2];
302 char __ss_pad2[_SS_PAD2SIZE];
303 } ifap_addr;
304 };
305
306 /* from <dev/pci/if_devar.h> */
307 #define SIOCGADDRROM32 _IOW('i', 240, struct netbsd32_ifreq) /* get 128 bytes of ROM */
308 #define SIOCGCHIPID32 _IOWR('i', 241, struct netbsd32_ifreq) /* get chipid */
309 /* from <sys/sockio.h> */
310 #define SIOCSIFADDR32 _IOW('i', 12, struct netbsd32_ifreq) /* set ifnet address */
311 #define OSIOCSIFADDR32 _IOW('i', 12, struct netbsd32_oifreq) /* set ifnet address */
312 #define OOSIOCGIFADDR32 _IOWR('i', 13, struct netbsd32_oifreq) /* get ifnet address */
313
314 #define SIOCGIFADDR32 _IOWR('i', 33, struct netbsd32_ifreq) /* get ifnet address */
315 #define OSIOCGIFADDR32 _IOWR('i', 33, struct netbsd32_oifreq) /* get ifnet address */
316
317 #define SIOCSIFDSTADDR32 _IOW('i', 14, struct netbsd32_ifreq) /* set p-p address */
318 #define OSIOCSIFDSTADDR32 _IOW('i', 14, struct netbsd32_oifreq) /* set p-p address */
319 #define OOSIOCGIFDSTADDR32 _IOWR('i', 15, struct netbsd32_oifreq) /* get p-p address */
320
321 #define SIOCGIFDSTADDR32 _IOWR('i', 34, struct netbsd32_ifreq) /* get p-p address */
322 #define OSIOCGIFDSTADDR32 _IOWR('i', 34, struct netbsd32_oifreq) /* get p-p address */
323
324 #define SIOCSIFFLAGS32 _IOW('i', 16, struct netbsd32_ifreq) /* set ifnet flags */
325 #define OSIOCSIFFLAGS32 _IOW('i', 16, struct netbsd32_oifreq) /* set ifnet flags */
326
327 #define SIOCGIFFLAGS32 _IOWR('i', 17, struct netbsd32_ifreq) /* get ifnet flags */
328 #define OSIOCGIFFLAGS32 _IOWR('i', 17, struct netbsd32_oifreq) /* get ifnet flags */
329
330
331 #define SIOCSIFBRDADDR32 _IOW('i', 19, struct netbsd32_ifreq) /* set broadcast addr */
332 #define OSIOCSIFBRDADDR32 _IOW('i', 19, struct netbsd32_oifreq) /* set broadcast addr */
333 #define OOSIOCGIFBRDADDR32 _IOWR('i', 18, struct netbsd32_oifreq) /* get broadcast addr */
334
335 #define SIOCGIFBRDADDR32 _IOWR('i', 35, struct netbsd32_ifreq) /* get broadcast addr */
336 #define OSIOCGIFBRDADDR32 _IOWR('i', 35, struct netbsd32_oifreq) /* get broadcast addr */
337
338 #define OOSIOCGIFNETMASK32 _IOWR('i', 21, struct netbsd32_oifreq) /* get net addr mask */
339
340 #define SIOCGIFNETMASK32 _IOWR('i', 37, struct netbsd32_ifreq) /* get net addr mask */
341 #define OSIOCGIFNETMASK32 _IOWR('i', 37, struct netbsd32_oifreq) /* get net addr mask */
342
343 #define SIOCSIFNETMASK32 _IOW('i', 22, struct netbsd32_ifreq) /* set net addr mask */
344 #define OSIOCSIFNETMASK32 _IOW('i', 22, struct netbsd32_oifreq) /* set net addr mask */
345
346 #define SIOCGIFMETRIC32 _IOWR('i', 23, struct netbsd32_ifreq) /* get IF metric */
347 #define OSIOCGIFMETRIC32 _IOWR('i', 23, struct netbsd32_oifreq) /* get IF metric */
348
349 #define SIOCSIFMETRIC32 _IOW('i', 24, struct netbsd32_ifreq) /* set IF metric */
350 #define OSIOCSIFMETRIC32 _IOW('i', 24, struct netbsd32_oifreq) /* set IF metric */
351
352 #define SIOCDIFADDR32 _IOW('i', 25, struct netbsd32_ifreq) /* delete IF addr */
353 #define OSIOCDIFADDR32 _IOW('i', 25, struct netbsd32_oifreq) /* delete IF addr */
354
355 #define SIOCSIFADDRPREF32 _IOW('i', 31, struct netbsd32_if_addrprefreq)
356 #define SIOCGIFADDRPREF32 _IOWR('i', 32, struct netbsd32_if_addrprefreq)
357
358 #define SIOCADDMULTI32 _IOW('i', 49, struct netbsd32_ifreq) /* add m'cast addr */
359 #define OSIOCADDMULTI32 _IOW('i', 49, struct netbsd32_oifreq) /* add m'cast addr */
360
361 #define SIOCDELMULTI32 _IOW('i', 50, struct netbsd32_ifreq) /* del m'cast addr */
362 #define OSIOCDELMULTI32 _IOW('i', 50, struct netbsd32_oifreq) /* del m'cast addr */
363
364 #define SIOCSIFMEDIA32 _IOWR('i', 53, struct netbsd32_ifreq) /* set net media */
365 #define OSIOCSIFMEDIA32 _IOWR('i', 53, struct netbsd32_oifreq) /* set net media */
366
367 #define SIOCSIFMTU32 _IOW('i', 127, struct netbsd32_ifreq) /* set ifnet mtu */
368 #define OSIOCSIFMTU32 _IOW('i', 127, struct netbsd32_oifreq) /* set ifnet mtu */
369
370 #define SIOCGIFMTU32 _IOWR('i', 126, struct netbsd32_ifreq) /* get ifnet mtu */
371 #define OSIOCGIFMTU32 _IOWR('i', 126, struct netbsd32_oifreq) /* get ifnet mtu */
372 /* was 125 SIOCSIFASYNCMAP32 */
373 /* was 124 SIOCGIFASYNCMAP32 */
374 /* from <net/bpf.h> */
375 #define BIOCGETIF32 _IOR('B',107, struct netbsd32_ifreq)
376 #define BIOCSETIF32 _IOW('B',108, struct netbsd32_ifreq)
377 /* from <netatalk/phase2.h> */
378 #define SIOCPHASE1_32 _IOW('i', 100, struct netbsd32_ifreq) /* AppleTalk phase 1 */
379 #define SIOCPHASE2_32 _IOW('i', 101, struct netbsd32_ifreq) /* AppleTalk phase 2 */
380
381 /* from <net/if.h> */
382 struct netbsd32_ifconf {
383 int ifc_len; /* size of associated buffer */
384 union {
385 netbsd32_caddr_t ifcu_buf;
386 netbsd32_ifreq_tp_t ifcu_req;
387 } ifc_ifcu;
388 #define ifc_buf ifc_ifcu.ifcu_buf /* buffer address */
389 #define ifc_req ifc_ifcu.ifcu_req /* array of structures returned */
390 };
391 /* from <sys/sockio.h> */
392 #define OOSIOCGIFCONF32 _IOWR('i', 20, struct netbsd32_ifconf) /* get ifnet list */
393 #define OSIOCGIFCONF32 _IOWR('i', 36, struct netbsd32_ifconf) /* get ifnet list */
394 #define SIOCGIFCONF32 _IOWR('i', 38, struct netbsd32_ifconf) /* get ifnet list */
395
396 /* from <net/if.h> */
397 struct netbsd32_ifmediareq {
398 char ifm_name[IFNAMSIZ]; /* if name, e.g. "en0" */
399 int ifm_current; /* current media options */
400 int ifm_mask; /* don't care mask */
401 int ifm_status; /* media status */
402 int ifm_active; /* active options */
403 int ifm_count; /* # entries in ifm_ulist
404 array */
405 netbsd32_intp ifm_ulist; /* media words */
406 };
407 /* from <sys/sockio.h> */
408 #define SIOCGIFMEDIA32 _IOWR('i', 54, struct netbsd32_ifmediareq) /* get net media */
409
410 /* from <net/if.h> */
411 struct netbsd32_ifdrv {
412 char ifd_name[IFNAMSIZ]; /* if name, e.g. "en0" */
413 netbsd32_u_long ifd_cmd;
414 netbsd32_size_t ifd_len;
415 netbsd32_voidp ifd_data;
416 };
417 /* from <sys/sockio.h> */
418 #define SIOCSDRVSPEC32 _IOW('i', 123, struct netbsd32_ifdrv) /* set driver-specific */
419
420 /* from <netinet/ip_mroute.h> */
421 struct netbsd32_sioc_vif_req {
422 vifi_t vifi; /* vif number */
423 netbsd32_u_long icount; /* input packet count on vif */
424 netbsd32_u_long ocount; /* output packet count on vif */
425 netbsd32_u_long ibytes; /* input byte count on vif */
426 netbsd32_u_long obytes; /* output byte count on vif */
427 };
428 /* from <sys/sockio.h> */
429 #define SIOCGETVIFCNT32 _IOWR('u', 51, struct netbsd32_sioc_vif_req)/* vif pkt cnt */
430
431 struct netbsd32_sioc_sg_req {
432 struct in_addr src;
433 struct in_addr grp;
434 u_long pktcnt;
435 u_long bytecnt;
436 u_long wrong_if;
437 };
438 /* from <sys/sockio.h> */
439 #define SIOCGETSGCNT32 _IOWR('u', 52, struct netbsd32_sioc_sg_req) /* sg pkt cnt */
440
441 /*
442 * The next two structures are marked "__packed" as they normally end up
443 * being padded in 64-bit mode.
444 */
445 struct netbsd32_vnd_ioctl {
446 netbsd32_charp vnd_file; /* pathname of file to mount */
447 int vnd_flags; /* flags; see below */
448 struct vndgeom vnd_geom; /* geometry to emulate */
449 unsigned int vnd_osize; /* (returned) size of disk */
450 uint64_t vnd_size; /* (returned) size of disk */
451 } __packed;
452
453 struct netbsd32_vnd_user {
454 int vnu_unit; /* which vnd unit */
455 dev_t vnu_dev; /* file is on this device... */
456 ino_t vnu_ino; /* ...at this inode */
457 } __packed;
458
459 /* from <dev/vndvar.h> */
460 #define VNDIOCSET32 _IOWR('F', 0, struct netbsd32_vnd_ioctl) /* enable disk */
461 #define VNDIOCCLR32 _IOW('F', 1, struct netbsd32_vnd_ioctl) /* disable disk */
462 #define VNDIOCGET32 _IOWR('F', 3, struct netbsd32_vnd_user) /* get list */
463
464 struct netbsd32_vnd_ioctl50 {
465 netbsd32_charp vnd_file; /* pathname of file to mount */
466 int vnd_flags; /* flags; see below */
467 struct vndgeom vnd_geom; /* geometry to emulate */
468 unsigned int vnd_size; /* (returned) size of disk */
469 } __packed;
470 /* from <dev/vnd.c> */
471 #define VNDIOCSET5032 _IOWR('F', 0, struct netbsd32_vnd_ioctl50)
472 #define VNDIOCCLR5032 _IOW('F', 1, struct netbsd32_vnd_ioctl50)
473
474 #define ENVSYS_GETDICTIONARY32 _IOWR('E', 0, struct netbsd32_plistref)
475 #define ENVSYS_SETDICTIONARY32 _IOWR('E', 1, struct netbsd32_plistref)
476 #define ENVSYS_REMOVEPROPS32 _IOWR('E', 2, struct netbsd32_plistref)
477
478 /* from <sys/wdog.h> */
479 struct netbsd32_wdog_conf {
480 netbsd32_charp wc_names;
481 int wc_count;
482 };
483 #define WDOGIOC_GWDOGS32 _IOWR('w', 5, struct netbsd32_wdog_conf)
484