1193645Ssimon/*-
2193645Ssimon * Copyright (c) 1994, 1995 Scott Bartram
3193645Ssimon * Copyright (c) 1994 Arne H Juul
4193645Ssimon * All rights reserved.
5193645Ssimon *
6193645Ssimon * Redistribution and use in source and binary forms, with or without
7193645Ssimon * modification, are permitted provided that the following conditions
8296465Sdelphij * are met:
9193645Ssimon * 1. Redistributions of source code must retain the above copyright
10193645Ssimon *    notice, this list of conditions and the following disclaimer.
11193645Ssimon * 2. The name of the author may not be used to endorse or promote products
12193645Ssimon *    derived from this software without specific prior written permission
13193645Ssimon *
14193645Ssimon * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
15296465Sdelphij * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
16193645Ssimon * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
17193645Ssimon * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
18193645Ssimon * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
19193645Ssimon * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
20193645Ssimon * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
21193645Ssimon * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22296465Sdelphij * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
23193645Ssimon * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24193645Ssimon *
25193645Ssimon * $FreeBSD$
26193645Ssimon */
27193645Ssimon
28193645Ssimon#ifndef	_I386_IBCS2_IBCS2_SOCKSYS_H_
29193645Ssimon#define	_I386_IBCS2_IBCS2_SOCKSYS_H_
30193645Ssimon
31193645Ssimon#include <sys/ioccom.h>
32193645Ssimon
33193645Ssimon#include <i386/ibcs2/ibcs2_types.h>
34193645Ssimon
35193645Ssimon#define SOCKSYS_ACCEPT		1
36193645Ssimon#define SOCKSYS_BIND		2
37296465Sdelphij#define SOCKSYS_CONNECT		3
38193645Ssimon#define SOCKSYS_GETPEERNAME	4
39193645Ssimon#define SOCKSYS_GETSOCKNAME	5
40296465Sdelphij#define SOCKSYS_GETSOCKOPT	6
41193645Ssimon#define SOCKSYS_LISTEN		7
42193645Ssimon#define SOCKSYS_RECV		8
43193645Ssimon#define SOCKSYS_RECVFROM	9
44193645Ssimon#define SOCKSYS_SEND		10
45193645Ssimon#define SOCKSYS_SENDTO		11
46193645Ssimon#define SOCKSYS_SETSOCKOPT	12
47193645Ssimon#define SOCKSYS_SHUTDOWN	13
48193645Ssimon#define SOCKSYS_SOCKET		14
49193645Ssimon#define SOCKSYS_SELECT		15
50193645Ssimon#define SOCKSYS_GETIPDOMAIN	16
51193645Ssimon#define SOCKSYS_SETIPDOMAIN	17
52296465Sdelphij#define SOCKSYS_ADJTIME		18
53193645Ssimon#define SOCKSYS_SETREUID	19
54193645Ssimon#define SOCKSYS_SETREGID	20
55193645Ssimon#define SOCKSYS_GETTIME		21
56193645Ssimon#define SOCKSYS_SETTIME		22
57193645Ssimon#define SOCKSYS_GETITIMER	23
58193645Ssimon#define SOCKSYS_SETITIMER	24
59193645Ssimon
60193645Ssimon#define IBCS2_SIOCSHIWAT	_IOW('S', 1, int)
61193645Ssimon#define IBCS2_SIOCGHIWAT	_IOR('S', 2, int)
62193645Ssimon#define IBCS2_SIOCSLOWAT	_IOW('S', 3, int)
63193645Ssimon#define IBCS2_SIOCGLOWAT	_IOR('S', 4, int)
64193645Ssimon#define IBCS2_SIOCATMARK	_IOR('S', 5, int)
65296465Sdelphij#define IBCS2_SIOCSPGRP		_IOW('S', 6, int)
66296465Sdelphij#define IBCS2_SIOCGPGRP		_IOR('S', 7, int)
67193645Ssimon#define IBCS2_FIONREAD		_IOR('S', 8, int)
68193645Ssimon#define IBCS2_FIONBIO		_IOW('S', 9, int)
69193645Ssimon#define IBCS2_FIOASYNC		_IOW('S', 10, int)
70193645Ssimon#define IBCS2_SIOCPROTO		_IOW('S', 11, struct socknewproto)
71193645Ssimon#define IBCS2_SIOCGETNAME	_IOR('S', 12, struct sockaddr)
72193645Ssimon#define IBCS2_SIOCGETPEER	_IOR('S', 13, struct sockaddr)
73193645Ssimon#define IBCS2_IF_UNITSEL	_IOW('S', 14, int)
74193645Ssimon#define IBCS2_SIOCXPROTO	_IO('S', 15)
75193645Ssimon
76193645Ssimon#define IBCS2_SIOCADDRT		_IOW('R', 9, struct rtentry)
77193645Ssimon#define IBCS2_SIOCDELRT		_IOW('R', 10, struct rtentry)
78296465Sdelphij
79296465Sdelphij#define IBCS2_SIOCSIFADDR	_IOW('I', 11, struct ifreq)
80296465Sdelphij#define IBCS2_SIOCGIFADDR	_IOWR('I', 12, struct ifreq)
81296465Sdelphij#define IBCS2_SIOCSIFDSTADDR	_IOW('I', 13, struct ifreq)
82296465Sdelphij#define IBCS2_SIOCGIFDSTADDR	_IOWR('I', 14, struct ifreq)
83193645Ssimon#define IBCS2_SIOCSIFFLAGS	_IOW('I', 15, struct ifreq)
84296465Sdelphij#define IBCS2_SIOCGIFFLAGS	_IOWR('I', 16, struct ifreq)
85296465Sdelphij#define IBCS2_SIOCGIFCONF	_IOWR('I', 17, struct ifconf)
86296465Sdelphij#define IBCS2_SIOCSIFMTU	_IOW('I', 21, struct ifreq)
87296465Sdelphij#define IBCS2_SIOCGIFMTU	_IOWR('I', 22, struct ifreq)
88296465Sdelphij#define IBCS2_SIOCIFDETACH	_IOW('I', 26, struct ifreq)
89296465Sdelphij#define IBCS2_SIOCGENPSTATS	_IOWR('I', 27, struct ifreq)
90296465Sdelphij#define IBCS2_SIOCX25XMT	_IOWR('I', 29, struct ifreq)
91193645Ssimon#define IBCS2_SIOCX25RCV	_IOWR('I', 30, struct ifreq)
92296465Sdelphij#define IBCS2_SIOCX25TBL	_IOWR('I', 31, struct ifreq)
93296465Sdelphij#define IBCS2_SIOCGIFBRDADDR	_IOWR('I', 32, struct ifreq)
94296465Sdelphij#define IBCS2_SIOCSIFBRDADDR	_IOW('I', 33, struct ifreq)
95296465Sdelphij#define IBCS2_SIOCGIFNETMASK	_IOWR('I', 34, struct ifreq)
96296465Sdelphij#define IBCS2_SIOCSIFNETMASK	_IOW('I', 35, struct ifreq)
97296465Sdelphij#define IBCS2_SIOCGIFMETRIC	_IOWR('I', 36, struct ifreq)
98296465Sdelphij#define IBCS2_SIOCSIFMETRIC	_IOW('I', 37, struct ifreq)
99296465Sdelphij#define IBCS2_SIOCSARP		_IOW('I', 38, struct arpreq)
100296465Sdelphij#define IBCS2_SIOCGARP		_IOWR('I', 39, struct arpreq)
101296465Sdelphij#define IBCS2_SIOCDARP		_IOW('I', 40, struct arpreq)
102296465Sdelphij#define IBCS2_SIOCSIFNAME	_IOW('I', 41, struct ifreq)
103296465Sdelphij#define IBCS2_SIOCGIFONEP	_IOWR('I', 42, struct ifreq)
104296465Sdelphij#define IBCS2_SIOCSIFONEP	_IOW('I', 43, struct ifreq)
105296465Sdelphij#define IBCS2_SIOCGENADDR	_IOWR('I', 65, struct ifreq)
106296465Sdelphij#define IBCS2_SIOCSOCKSYS	_IOW('I', 66, struct socksysreq)
107296465Sdelphij
108296465Sdelphijstruct socksysreq {
109296465Sdelphij	int realargs[7];
110193645Ssimon};
111296465Sdelphij
112296465Sdelphijstruct socknewproto {
113296465Sdelphij	int family;
114296465Sdelphij	int type;
115296465Sdelphij	int proto;
116296465Sdelphij	ibcs2_dev_t dev;
117296465Sdelphij	int flags;
118296465Sdelphij};
119296465Sdelphij
120296465Sdelphijstruct ibcs2_socksys_args {
121296465Sdelphij	int     fd;
122296465Sdelphij	int     magic;
123296465Sdelphij	caddr_t argsp;
124296465Sdelphij};
125296465Sdelphij
126296465Sdelphijint ibcs2_socksys(struct thread *, struct ibcs2_socksys_args *);
127193645Ssimon
128193645Ssimon#endif /* !_I386_IBCS2_IBCS2_SOCKSYS_H_ */
129296465Sdelphij