ioctl_rs/os/
linux.rs

1use libc::{c_int, c_uint};
2
3// socket
4
5pub const FIOSETOWN: c_uint = 0x00008901;
6pub const SIOCSPGRP: c_uint = 0x00008902;
7pub const FIOGETOWN: c_uint = 0x00008903;
8pub const SIOCGPGRP: c_uint = 0x00008904;
9pub const SIOCGSTAMP: c_uint = 0x00008906;
10
11// termios
12
13pub const TCGETS: c_uint = 0x00005401;
14pub const TCSETS: c_uint = 0x00005402;
15pub const TCSETSW: c_uint = 0x00005403;
16pub const TCSETSF: c_uint = 0x00005404;
17pub const TCGETA: c_uint = 0x00005405;
18pub const TCSETA: c_uint = 0x00005406;
19pub const TCSETAW: c_uint = 0x00005407;
20pub const TCSETAF: c_uint = 0x00005408;
21pub const TCSBRK: c_uint = 0x00005409;
22pub const TCXONC: c_uint = 0x0000540a;
23pub const TCFLSH: c_uint = 0x0000540b;
24pub const TIOCEXCL: c_uint = 0x0000540c;
25pub const TIOCNXCL: c_uint = 0x0000540d;
26pub const TIOCSCTTY: c_uint = 0x0000540e;
27pub const TIOCGPGRP: c_uint = 0x0000540f;
28pub const TIOCSPGRP: c_uint = 0x00005410;
29pub const TIOCOUTQ: c_uint = 0x00005411;
30pub const TIOCSTI: c_uint = 0x00005412;
31pub const TIOCGWINSZ: c_uint = 0x00005413;
32pub const TIOCSWINSZ: c_uint = 0x00005414;
33pub const TIOCMGET: c_uint = 0x00005415;
34pub const TIOCMBIS: c_uint = 0x00005416;
35pub const TIOCMBIC: c_uint = 0x00005417;
36pub const TIOCMSET: c_uint = 0x00005418;
37pub const TIOCGSOFTCAR: c_uint = 0x00005419;
38pub const TIOCSSOFTCAR: c_uint = 0x0000541a;
39pub const FIONREAD: c_uint = 0x0000541b;
40pub const TIOCINQ: c_uint = 0x0000541b;
41pub const TIOCLINUX: c_uint = 0x0000541c;
42pub const TIOCCONS: c_uint = 0x0000541d;
43pub const TIOCGSERIAL: c_uint = 0x0000541e;
44pub const TIOCSSERIAL: c_uint = 0x0000541f;
45pub const TIOCPKT: c_uint = 0x00005420;
46pub const FIONBIO: c_uint = 0x00005421;
47pub const TIOCNOTTY: c_uint = 0x00005422;
48pub const TIOCSETD: c_uint = 0x00005423;
49pub const TIOCGETD: c_uint = 0x00005424;
50pub const TCSBRKP: c_uint = 0x00005425;
51pub const FIONCLEX: c_uint = 0x00005450;
52pub const FIOCLEX: c_uint = 0x00005451;
53pub const FIOASYNC: c_uint = 0x00005452;
54pub const TIOCSERCONFIG: c_uint = 0x00005453;
55pub const TIOCSERGWILD: c_uint = 0x00005454;
56pub const TIOCSERSWILD: c_uint = 0x00005455;
57pub const TIOCGLCKTRMIOS: c_uint = 0x00005456;
58pub const TIOCSLCKTRMIOS: c_uint = 0x00005457;
59pub const TIOCSERGSTRUCT: c_uint = 0x00005458;
60pub const TIOCSERGETLSR: c_uint = 0x00005459;
61pub const TIOCSERGETMULTI: c_uint = 0x0000545a;
62pub const TIOCSERSETMULTI: c_uint = 0x0000545b;
63
64// sockios
65
66pub const SIOCADDRT: c_uint = 0x0000890b;
67pub const SIOCDELRT: c_uint = 0x0000890c;
68pub const SIOCGIFNAME: c_uint = 0x00008910;
69pub const SIOCSIFLINK: c_uint = 0x00008911;
70pub const SIOCGIFCONF: c_uint = 0x00008912;
71pub const SIOCGIFFLAGS: c_uint = 0x00008913;
72pub const SIOCSIFFLAGS: c_uint = 0x00008914;
73pub const SIOCGIFADDR: c_uint = 0x00008915;
74pub const SIOCSIFADDR: c_uint = 0x00008916;
75pub const SIOCGIFDSTADDR: c_uint = 0x00008917;
76pub const SIOCSIFDSTADDR: c_uint = 0x00008918;
77pub const SIOCGIFBRDADDR: c_uint = 0x00008919;
78pub const SIOCSIFBRDADDR: c_uint = 0x0000891a;
79pub const SIOCGIFNETMASK: c_uint = 0x0000891b;
80pub const SIOCSIFNETMASK: c_uint = 0x0000891c;
81pub const SIOCGIFMETRIC: c_uint = 0x0000891d;
82pub const SIOCSIFMETRIC: c_uint = 0x0000891e;
83pub const SIOCGIFMEM: c_uint = 0x0000891f;
84pub const SIOCSIFMEM: c_uint = 0x00008920;
85pub const SIOCGIFMTU: c_uint = 0x00008921;
86pub const SIOCSIFMTU: c_uint = 0x00008922;
87pub const SIOCSIFHWADDR: c_uint = 0x00008924;
88pub const SIOCGIFENCAP: c_uint = 0x00008925;
89pub const SIOCSIFENCAP: c_uint = 0x00008926;
90pub const SIOCGIFHWADDR: c_uint = 0x00008927;
91pub const SIOCGIFSLAVE: c_uint = 0x00008929;
92pub const SIOCSIFSLAVE: c_uint = 0x00008930;
93pub const SIOCADDMULTI: c_uint = 0x00008931;
94pub const SIOCDELMULTI: c_uint = 0x00008932;
95pub const SIOCDARP: c_uint = 0x00008953;
96pub const SIOCGARP: c_uint = 0x00008954;
97pub const SIOCSARP: c_uint = 0x00008955;
98pub const SIOCDRARP: c_uint = 0x00008960;
99pub const SIOCGRARP: c_uint = 0x00008961;
100pub const SIOCSRARP: c_uint = 0x00008962;
101pub const SIOCGIFMAP: c_uint = 0x00008970;
102pub const SIOCSIFMAP: c_uint = 0x00008971;
103
104// modem control lines
105
106pub const TIOCM_LE: c_uint = 0x00000001;
107pub const TIOCM_DTR: c_uint = 0x00000002;
108pub const TIOCM_RTS: c_uint = 0x00000004;
109pub const TIOCM_ST: c_uint = 0x00000008;
110pub const TIOCM_SR: c_uint = 0x00000010;
111pub const TIOCM_CTS: c_uint = 0x00000020;
112pub const TIOCM_CAR: c_uint = 0x00000040;
113pub const TIOCM_CD: c_uint = 0x00000040;
114pub const TIOCM_RNG: c_uint = 0x00000080;
115pub const TIOCM_RI: c_uint = 0x00000080;
116pub const TIOCM_DSR: c_uint = 0x00000100;
117
118extern "C" {
119    pub fn ioctl(fd: c_int, request: c_uint, ...) -> c_int;
120}