This source file includes following definitions.
- sunos_ioctl
1
2
3
4
5
6
7
8 #include <asm/segment.h>
9
10 #include <linux/sched.h>
11 #include <linux/errno.h>
12 #include <linux/string.h>
13 #include <linux/termios.h>
14 #include <linux/ioctl.h>
15 #include <linux/route.h>
16 #include <linux/sockios.h>
17 #include <linux/if.h>
18 #include <linux/if_arp.h>
19 #include <linux/fs.h>
20
21 extern asmlinkage int sys_ioctl(unsigned int, unsigned int, unsigned long);
22
23 asmlinkage int sunos_ioctl (int fd, unsigned long cmd, unsigned long arg)
24 {
25 struct file *filp;
26
27 if (fd >= NR_OPEN || !(filp = current->files->fd [fd]))
28 return -EBADF;
29
30
31 switch (cmd) {
32 case _IOW('r', 10, struct rtentry):
33 return sys_ioctl(fd, SIOCADDRT, arg);
34 case _IOW('r', 11, struct rtentry):
35 return sys_ioctl(fd, SIOCDELRT, arg);
36 case _IOW('i', 12, struct ifreq):
37 return sys_ioctl(fd, SIOCSIFADDR, arg);
38 case _IORW('i', 13, struct ifreq):
39 return sys_ioctl(fd, SIOCGIFADDR, arg);
40 case _IOW('i', 14, struct ifreq):
41 return sys_ioctl(fd, SIOCSIFDSTADDR, arg);
42 case _IORW('i', 15, struct ifreq):
43 return sys_ioctl(fd, SIOCGIFDSTADDR, arg);
44 case _IOW('i', 16, struct ifreq):
45 return sys_ioctl(fd, SIOCSIFFLAGS, arg);
46 case _IORW('i', 17, struct ifreq):
47 return sys_ioctl(fd, SIOCGIFFLAGS, arg);
48 case _IOW('i', 18, struct ifreq):
49 return sys_ioctl(fd, SIOCSIFMEM, arg);
50 case _IORW('i', 19, struct ifreq):
51 return sys_ioctl(fd, SIOCGIFMEM, arg);
52 case _IORW('i', 20, struct ifreq):
53 return sys_ioctl(fd, SIOCGIFCONF, arg);
54 case _IOW('i', 21, struct ifreq):
55 return sys_ioctl(fd, SIOCSIFMTU, arg);
56 case _IORW('i', 22, struct ifreq):
57 return sys_ioctl(fd, SIOCGIFMTU, arg);
58
59 case _IORW('i', 23, struct ifreq):
60 return sys_ioctl(fd, SIOCGIFBRDADDR, arg);
61 case _IOW('i', 24, struct ifreq):
62 return sys_ioctl(fd, SIOCGIFBRDADDR, arg);
63 case _IORW('i', 25, struct ifreq):
64 return sys_ioctl(fd, SIOCGIFNETMASK, arg);
65 case _IOW('i', 26, struct ifreq):
66 return sys_ioctl(fd, SIOCSIFNETMASK, arg);
67 case _IORW('i', 27, struct ifreq):
68 return sys_ioctl(fd, SIOCGIFMETRIC, arg);
69 case _IOW('i', 28, struct ifreq):
70 return sys_ioctl(fd, SIOCSIFMETRIC, arg);
71
72 case _IOW('i', 30, struct arpreq):
73 return sys_ioctl(fd, SIOCSARP, arg);
74 case _IOW('i', 31, struct arpreq):
75 return sys_ioctl(fd, SIOCGARP, arg);
76 case _IOW('i', 32, struct arpreq):
77 return sys_ioctl(fd, SIOCGARP, arg);
78
79 case _IOW('i', 40, struct ifreq):
80 case _IOW('i', 41, struct ifreq):
81 case _IOW('i', 44, struct ifreq):
82 case _IOW('i', 45, struct ifreq):
83 case _IOW('i', 46, struct ifreq):
84 case _IOW('i', 47, struct ifreq):
85 case _IOW('i', 48, struct ifreq):
86 return -EINVAL;
87
88 case _IOW('i', 49, struct ifreq):
89 return sys_ioctl(fd, SIOCADDMULTI, arg);
90 case _IOW('i', 50, struct ifreq):
91 return sys_ioctl(fd, SIOCDELMULTI, arg);
92
93
94 case _IOW('i', 51, struct ifreq):
95 case _IOW('i', 52, struct ifreq):
96 case _IOW('i', 53, struct ifreq):
97 case _IOW('i', 54, struct ifreq):
98 case _IOW('i', 55, struct ifreq):
99 case _IOW('i', 56, struct ifreq):
100 case _IOW('i', 57, struct ifreq):
101 case _IOW('i', 58, struct ifreq):
102 case _IOW('i', 59, struct ifreq):
103 return -EINVAL;
104 }
105
106 return sys_ioctl (fd, cmd, arg);
107 }
108
109