xref: /minix/minix/include/sys/ioc_net.h (revision 433d6423)
1 /*	sys/ioc_net.h - NetBSD-friendly version of Minix net/ioctl.h
2  */
3 /*	net/ioctl.h - Network ioctl() command codes.	Author: Kees J. Bot
4  *								23 Nov 2002
5  *
6  */
7 
8 #ifndef _SYS_IOC_NET_H_
9 #define _SYS_IOC_NET_H_
10 
11 #include <minix/ioctl.h>
12 #include <sys/un.h>
13 
14 #include <sys/ansi.h>
15 #ifndef socklen_t
16 typedef __socklen_t	socklen_t;
17 #define socklen_t	__socklen_t
18 #endif
19 
20 #define MSG_CONTROL_MAX (1024 - sizeof(socklen_t))
21 struct msg_control
22 {
23 	char		msg_control[MSG_CONTROL_MAX];
24 	socklen_t	msg_controllen;
25 };
26 
27 
28 /* Network ioctls. */
29 #define NWIOSETHOPT	_IOW('n', 16, struct nwio_ethopt)
30 #define NWIOGETHOPT	_IOR('n', 17, struct nwio_ethopt)
31 #define NWIOGETHSTAT	_IOR('n', 18, struct nwio_ethstat)
32 
33 #define NWIOARPGIP	_IOWR('n',20, struct nwio_arp)
34 #define NWIOARPGNEXT	_IOWR('n',21, struct nwio_arp)
35 #define NWIOARPSIP	_IOW ('n',22, struct nwio_arp)
36 #define NWIOARPDIP	_IOW ('n',23, struct nwio_arp)
37 
38 #define NWIOSIPCONF2	_IOW('n', 32, struct nwio_ipconf2)
39 #define NWIOSIPCONF	_IOW('n', 32, struct nwio_ipconf)
40 #define NWIOGIPCONF2	_IOR('n', 33, struct nwio_ipconf2)
41 #define NWIOGIPCONF	_IOR('n', 33, struct nwio_ipconf)
42 #define NWIOSIPOPT	_IOW('n', 34, struct nwio_ipopt)
43 #define NWIOGIPOPT	_IOR('n', 35, struct nwio_ipopt)
44 
45 #define NWIOGIPOROUTE	_IOWR('n', 40, struct nwio_route)
46 #define NWIOSIPOROUTE	_IOW ('n', 41, struct nwio_route)
47 #define NWIODIPOROUTE	_IOW ('n', 42, struct nwio_route)
48 #define NWIOGIPIROUTE	_IOWR('n', 43, struct nwio_route)
49 #define NWIOSIPIROUTE	_IOW ('n', 44, struct nwio_route)
50 #define NWIODIPIROUTE	_IOW ('n', 45, struct nwio_route)
51 
52 #define NWIOSTCPCONF	_IOW('n', 48, struct nwio_tcpconf)
53 #define NWIOGTCPCONF	_IOR('n', 49, struct nwio_tcpconf)
54 #define NWIOTCPCONN	_IOW('n', 50, struct nwio_tcpcl)
55 #define NWIOTCPLISTEN	_IOW('n', 51, struct nwio_tcpcl)
56 #define NWIOTCPATTACH	_IOW('n', 52, struct nwio_tcpatt)
57 #define NWIOTCPSHUTDOWN	_IO ('n', 53)
58 #define NWIOSTCPOPT	_IOW('n', 54, struct nwio_tcpopt)
59 #define NWIOGTCPOPT	_IOR('n', 55, struct nwio_tcpopt)
60 #define NWIOTCPPUSH	_IO ('n', 56)
61 #define NWIOTCPLISTENQ	_IOW('n', 57, int)
62 #define NWIOGTCPCOOKIE	_IOR('n', 58, struct tcp_cookie)
63 #define NWIOTCPACCEPTTO	_IOW('n', 59, struct tcp_cookie)
64 #define NWIOTCPGERROR	_IOR('n', 60, int)
65 
66 #define NWIOSUDPOPT	_IOW('n', 64, struct nwio_udpopt)
67 #define NWIOGUDPOPT	_IOR('n', 65, struct nwio_udpopt)
68 #define NWIOUDPPEEK	_IOR('n', 66, struct udp_io_hdr)
69 
70 #define NWIOGUDSFADDR   _IOR ('n', 67, struct sockaddr_un) /* recvfrom() */
71 #define NWIOSUDSTADDR	_IOW ('n', 68, struct sockaddr_un) /* sendto() */
72 #define NWIOSUDSADDR	_IOW ('n', 69, struct sockaddr_un) /* bind() */
73 #define NWIOGUDSADDR	_IOR ('n', 70, struct sockaddr_un) /* getsockname() */
74 #define NWIOGUDSPADDR	_IOR ('n', 71, struct sockaddr_un) /* getpeername() */
75 #define NWIOSUDSTYPE	_IOW ('n', 72, int)		   /* socket() */
76 #define NWIOSUDSBLOG	_IOW ('n', 73, int)		   /* listen() */
77 #define NWIOSUDSCONN	_IOW ('n', 74, struct sockaddr_un) /* connect() */
78 #define NWIOSUDSSHUT    _IOW ('n', 75, int)		  /* shutdown() */
79 #define NWIOSUDSPAIR	_IOW ('n', 76, dev_t)		  /* socketpair() */
80 #define NWIOSUDSACCEPT	_IOW ('n', 77, struct sockaddr_un) /* accept() */
81 #define NWIOSUDSCTRL	_IOW ('n', 78, struct msg_control) /* sendmsg() */
82 #define NWIOGUDSCTRL	_IOWR('n', 79, struct msg_control) /* recvmsg() */
83 
84 #define NWIOSPSIPOPT	_IOW('n', 80, struct nwio_psipopt)
85 #define NWIOGPSIPOPT	_IOR('n', 81, struct nwio_psipopt)
86 
87 /* setsockopt/setsockopt for unix domain sockets */
88 #define NWIOGUDSSOTYPE	 _IOR('n', 90, int)		  /* SO_TYPE */
89 #define NWIOGUDSPEERCRED _IOR('n', 91, struct uucred)	  /* SO_PEERCRED */
90 #define NWIOGUDSSNDBUF	 _IOR('n', 92, size_t)            /* SO_SNDBUF */
91 #define NWIOSUDSSNDBUF	 _IOW('n', 93, size_t)            /* SO_SNDBUF */
92 #define NWIOGUDSRCVBUF	 _IOR('n', 94, size_t)            /* SO_RCVBUF */
93 #define NWIOSUDSRCVBUF	 _IOW('n', 95, size_t)            /* SO_RCVBUF */
94 
95 #endif /* _NET__IOCTL_H */
96 
97 /*
98  * $PchId: ioctl.h,v 1.2 2003/07/25 14:34:03 philip Exp $
99  */
100