/* $NetBSD: netbsd32_ioctl.h,v 1.80 2024/05/11 10:22:17 martin Exp $ */
/*
* Copyright (c) 1998, 2001 Matthew R. Green
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
/* from <sys/audioio.h> */
#define AUDIO_WSEEK32 _IOR('A', 25, netbsd32_u_long)
/* from <sys/dkio.h> */
typedef netbsd32_pointer_t netbsd32_disklabel_tp_t;
typedef netbsd32_pointer_t netbsd32_partition_tp_t;
#if 0 /* not implemented by anything */
struct netbsd32_format_op {
netbsd32_charp df_buf;
int df_count; /* value-result */
daddr_t df_startblk;
int df_reg[8]; /* result */
};
#define DIOCRFORMAT32 _IOWR('d', 105, struct netbsd32_format_op)
#define DIOCWFORMAT32 _IOWR('d', 106, struct netbsd32_format_op)
#endif
/* from <sys/event.h> */
struct netbsd32_kfilter_mapping {
netbsd32_charp name; /* name to lookup or return */
netbsd32_size_t len; /* length of name */
uint32_t filter; /* filter to lookup or return */
};
/* map filter to name (max size len) */
#define KFILTER_BYFILTER32 _IOWR('k', 0, struct netbsd32_kfilter_mapping)
/* map name to filter (len ignored) */
#define KFILTER_BYNAME32 _IOWR('k', 1, struct netbsd32_kfilter_mapping)
struct netbsd32_wsdisplay_addscreendata {
int idx; /* screen index */
netbsd32_charp screentype;
netbsd32_charp emul;
};
#define WSDISPLAYIO_ADDSCREEN32 _IOW('W', 78, struct netbsd32_wsdisplay_addscreendata)
/* the first member must be matched with struct ifreq */
struct netbsd32_ieee80211req {
char i_name[IFNAMSIZ]; /* if_name, e.g. "wi0" */
uint16_t i_type; /* req type */
int16_t i_val; /* Index or simple value */
uint16_t i_len; /* Index or simple value */
netbsd32_voidp i_data; /* Extra data */
};
#define SIOCS8021132 _IOW('i', 244, struct netbsd32_ieee80211req)
#define SIOCG8021132 _IOWR('i', 245, struct netbsd32_ieee80211req)
/* the first member must be matched with struct ifreq */
struct netbsd32_ieee80211_nwkey {
char i_name[IFNAMSIZ]; /* if_name, e.g. "wi0" */
int i_wepon; /* wep enabled flag */
int i_defkid; /* default encrypt key id */
struct {
int i_keylen;
netbsd32_charp i_keydat;
} i_key[IEEE80211_WEP_NKID];
};
#define SIOCS80211NWKEY32 _IOW('i', 232, struct netbsd32_ieee80211_nwkey)
#define SIOCG80211NWKEY32 _IOWR('i', 233, struct netbsd32_ieee80211_nwkey)
/* for powerd */
#define POWER_EVENT_RECVDICT32 _IOWR('P', 1, struct netbsd32_plistref)
/* Colormap operations. Not applicable to all display types. */
struct netbsd32_wsdisplay_cmap {
u_int index; /* first element (0 origin) */
u_int count; /* number of elements */
netbsd32_charp red; /* red color map elements */
netbsd32_charp green; /* green color map elements */
netbsd32_charp blue; /* blue color map elements */
};
#define SIOCSIFMEDIA32_80 _IOWR('i', 53, struct netbsd32_ifreq) /* set net media */
#define SIOCSIFMEDIA32_43 _IOWR('i', 53, struct netbsd32_oifreq) /* set net media */
#define SIOCSIFMEDIA32 _IOWR('i', 55, struct netbsd32_ifreq) /* set net media */
#define SIOCSIFGENERIC32 _IOW('i', 57, struct netbsd32_ifreq) /* generic IF set op */
#define SIOCGIFGENERIC32 _IOWR('i', 58, struct netbsd32_ifreq) /* generic IF get op */
#define SIOCIFGCLONERS32 _IOWR('i', 120, struct netbsd32_if_clonereq) /* get cloners */
#define SIOCSIFMTU32 _IOW('i', 127, struct netbsd32_ifreq) /* set ifnet mtu */
#define OSIOCSIFMTU32 _IOW('i', 127, struct netbsd32_oifreq) /* set ifnet mtu */
#define SIOCGIFMTU32 _IOWR('i', 126, struct netbsd32_ifreq) /* get ifnet mtu */
#define OSIOCGIFMTU32 _IOWR('i', 126, struct netbsd32_oifreq) /* get ifnet mtu */
/* from <net/if.h> */
struct netbsd32_ifconf {
int ifc_len; /* size of associated buffer */
union {
netbsd32_caddr_t ifcu_buf;
netbsd32_ifreq_tp_t ifcu_req;
} ifc_ifcu;
#define ifc_buf ifc_ifcu.ifcu_buf /* buffer address */
#define ifc_req ifc_ifcu.ifcu_req /* array of structures returned */
};
/* from <sys/sockio.h> */
#define OOSIOCGIFCONF32 _IOWR('i', 20, struct netbsd32_ifconf) /* get ifnet list */
#define OSIOCGIFCONF32 _IOWR('i', 36, struct netbsd32_ifconf) /* get ifnet list */
#define SIOCGIFCONF32 _IOWR('i', 38, struct netbsd32_ifconf) /* get ifnet list */
/* from <net/if.h> */
struct netbsd32_ifmediareq {
char ifm_name[IFNAMSIZ]; /* if name, e.g. "en0" */
int ifm_current; /* current media options */
int ifm_mask; /* don't care mask */
int ifm_status; /* media status */
int ifm_active; /* active options */
int ifm_count; /* # entries in ifm_ulist
array */
netbsd32_intp ifm_ulist; /* media words */
};
/* from <sys/sockio.h> */
#define SIOCGIFMEDIA32_80 _IOWR('i', 54, struct netbsd32_ifmediareq) /* get net media */
#define SIOCGIFMEDIA32 _IOWR('i', 56, struct netbsd32_ifmediareq) /* get net media */
/* from net/if_pppoe.h */
struct netbsd32_pppoediscparms {
char ifname[IFNAMSIZ]; /* pppoe interface name */
char eth_ifname[IFNAMSIZ]; /* external ethernet interface name */
netbsd32_charp ac_name; /* access concentrator name (or NULL) */
netbsd32_size_t ac_name_len; /* on write: length of buffer for ac_name */
netbsd32_charp service_name; /* service name (or NULL) */
netbsd32_size_t service_name_len; /* on write: length of buffer for service name */
};
#define PPPOESETPARMS32 _IOW('i', 110, struct netbsd32_pppoediscparms)
#define PPPOEGETPARMS32 _IOWR('i', 111, struct netbsd32_pppoediscparms)
/* from net/if_sppp.h */
struct netbsd32_spppauthcfg {
char ifname[IFNAMSIZ]; /* pppoe interface name */
u_int hisauth; /* one of SPPP_AUTHPROTO_* above */
u_int myauth; /* one of SPPP_AUTHPROTO_* above */
u_int myname_length; /* includes terminating 0 */
u_int mysecret_length; /* includes terminating 0 */
u_int hisname_length; /* includes terminating 0 */
u_int hissecret_length; /* includes terminating 0 */
u_int myauthflags;
u_int hisauthflags;
netbsd32_charp myname;
netbsd32_charp mysecret;
netbsd32_charp hisname;
netbsd32_charp hissecret;
};
#define SPPPGETAUTHCFG32 _IOWR('i', 120, struct netbsd32_spppauthcfg)
#define SPPPSETAUTHCFG32 _IOW('i', 121, struct netbsd32_spppauthcfg)
/* from <net/if.h> */
struct netbsd32_ifdrv {
char ifd_name[IFNAMSIZ]; /* if name, e.g. "en0" */
netbsd32_u_long ifd_cmd;
netbsd32_size_t ifd_len;
netbsd32_voidp ifd_data;
};
/* from <sys/sockio.h> */
#define SIOCSDRVSPEC32 _IOW('i', 123, struct netbsd32_ifdrv) /* set driver-specific */
#define SIOCGDRVSPEC32 _IOWR('i', 123, struct netbsd32_ifdrv) /* get driver-specific */
/* from <netinet/ip_mroute.h> */
struct netbsd32_sioc_vif_req {
vifi_t vifi; /* vif number */
netbsd32_u_long icount; /* input packet count on vif */
netbsd32_u_long ocount; /* output packet count on vif */
netbsd32_u_long ibytes; /* input byte count on vif */
netbsd32_u_long obytes; /* output byte count on vif */
};
/* from <sys/sockio.h> */
#define SIOCGETVIFCNT32 _IOWR('u', 51, struct netbsd32_sioc_vif_req)/* vif pkt cnt */
/* from <netinet/if_arp.h> */
struct netbsd32_in_nbrinfo {
char ifname[IFNAMSIZ]; /* if name, e.g. "en0" */
struct in_addr addr; /* IPv4 address of the neighbor */
netbsd32_long asked; /* number of queries already sent for this addr */
int state; /* reachability state */
int expire; /* lifetime for NDP state transition */
};
/* from <sys/sockio.h> */
#define SIOCGNBRINFO32 _IOWR('i', 249, struct netbsd32_in_nbrinfo)
/* from <netinet6/nd6.h> */
struct netbsd32_in6_nbrinfo {
char ifname[IFNAMSIZ]; /* if name, e.g. "en0" */
struct in6_addr addr; /* IPv6 address of the neighbor */
netbsd32_long asked; /* number of queries already sent for this addr */
int isrouter; /* if it acts as a router */
int state; /* reachability state */
int expire; /* lifetime for NDP state transition */
};
/* from <netinet6/in6_var.h> */
#define SIOCGNBRINFO_IN632 _IOWR('i', 78, struct netbsd32_in6_nbrinfo)
/* from <dev/ffsvar.h> */
struct netbsd32_fss_set {
netbsd32_charp fss_mount; /* Mount point of file system */
netbsd32_charp fss_bstore; /* Path of backing store */
blksize_t fss_csize; /* Preferred cluster size */
int fss_flags; /* Initial flags */
};
struct netbsd32_fss_get {
char fsg_mount[MNAMELEN]; /* Mount point of file system */
struct netbsd32_timeval fsg_time; /* Time this snapshot was taken */
blksize_t fsg_csize; /* Current cluster size */
netbsd32_blkcnt_t fsg_mount_size; /* # clusters on file system */
netbsd32_blkcnt_t fsg_bs_size; /* # clusters on backing store */
};
/* XXX: FSSIOCSET50 and FSSIOCGET50 are not (yet) handled */
#define FSSIOCSET32 _IOW('F', 5, struct netbsd32_fss_set) /* Configure */
#define FSSIOCGET32 _IOR('F', 1, struct netbsd32_fss_get) /* Status */
struct netbsd32_vnd_ioctl {
netbsd32_charp vnd_file; /* pathname of file to mount */
int vnd_flags; /* flags; see below */
struct vndgeom vnd_geom; /* geometry to emulate */
unsigned int vnd_osize; /* (returned) size of disk */
netbsd32_uint64 vnd_size; /* (returned) size of disk */
};
struct netbsd32_vnd_user {
int vnu_unit; /* which vnd unit */
netbsd32_dev_t vnu_dev; /* file is on this device... */
netbsd32_ino_t vnu_ino; /* ...at this inode */
};
/* from <dev/vndvar.h> */
#define VNDIOCSET32 _IOWR('F', 0, struct netbsd32_vnd_ioctl) /* enable disk */
#define VNDIOCCLR32 _IOW('F', 1, struct netbsd32_vnd_ioctl) /* disable disk */
#define VNDIOCGET32 _IOWR('F', 3, struct netbsd32_vnd_user) /* get list */
struct netbsd32_vnd_ioctl50 {
netbsd32_charp vnd_file; /* pathname of file to mount */
int vnd_flags; /* flags; see below */
struct vndgeom vnd_geom; /* geometry to emulate */
unsigned int vnd_size; /* (returned) size of disk */
} __packed;
/* from <dev/vnd.c> */
#define VNDIOCSET5032 _IOWR('F', 0, struct netbsd32_vnd_ioctl50)
#define VNDIOCCLR5032 _IOW('F', 1, struct netbsd32_vnd_ioctl50)
struct netbsd32_disk_strategy {
char dks_name[DK_STRATEGYNAMELEN]; /* name of strategy */
netbsd32_charp dks_param; /* notyet; should be NULL */
netbsd32_size_t dks_paramlen; /* notyet; should be 0 */
} __packed;