sysctl/
consts.rs

1// consts.rs
2
3// CTL* constants belong to libc crate but have not been added there yet.
4// They will be removed from here once in the libc crate.
5pub const CTL_MAXNAME: libc::c_uint = 24;
6
7pub const CTLTYPE: libc::c_uint = 0xf; /* mask for the type */
8
9pub const CTLTYPE_NODE: libc::c_uint = 1;
10pub const CTLTYPE_INT: libc::c_uint = 2;
11pub const CTLTYPE_STRING: libc::c_uint = 3;
12pub const CTLTYPE_S64: libc::c_uint = 4;
13pub const CTLTYPE_OPAQUE: libc::c_uint = 5;
14pub const CTLTYPE_STRUCT: libc::c_uint = 5;
15pub const CTLTYPE_UINT: libc::c_uint = 6;
16pub const CTLTYPE_LONG: libc::c_uint = 7;
17pub const CTLTYPE_ULONG: libc::c_uint = 8;
18pub const CTLTYPE_U64: libc::c_uint = 9;
19pub const CTLTYPE_U8: libc::c_uint = 10;
20pub const CTLTYPE_U16: libc::c_uint = 11;
21pub const CTLTYPE_S8: libc::c_uint = 12;
22pub const CTLTYPE_S16: libc::c_uint = 13;
23pub const CTLTYPE_S32: libc::c_uint = 14;
24pub const CTLTYPE_U32: libc::c_uint = 15;
25
26pub const CTLFLAG_RD: libc::c_uint = 0x80000000;
27pub const CTLFLAG_WR: libc::c_uint = 0x40000000;
28pub const CTLFLAG_RW: libc::c_uint = 0x80000000 | 0x40000000;
29pub const CTLFLAG_DORMANT: libc::c_uint = 0x20000000;
30pub const CTLFLAG_ANYBODY: libc::c_uint = 0x10000000;
31pub const CTLFLAG_SECURE: libc::c_uint = 0x08000000;
32pub const CTLFLAG_PRISON: libc::c_uint = 0x04000000;
33pub const CTLFLAG_DYN: libc::c_uint = 0x02000000;
34pub const CTLFLAG_SKIP: libc::c_uint = 0x01000000;
35pub const CTLFLAG_TUN: libc::c_uint = 0x00080000;
36pub const CTLFLAG_RDTUN: libc::c_uint = CTLFLAG_RD | CTLFLAG_TUN;
37pub const CTLFLAG_RWTUN: libc::c_uint = CTLFLAG_RW | CTLFLAG_TUN;
38pub const CTLFLAG_MPSAFE: libc::c_uint = 0x00040000;
39pub const CTLFLAG_VNET: libc::c_uint = 0x00020000;
40pub const CTLFLAG_DYING: libc::c_uint = 0x00010000;
41pub const CTLFLAG_CAPRD: libc::c_uint = 0x00008000;
42pub const CTLFLAG_CAPWR: libc::c_uint = 0x00004000;
43pub const CTLFLAG_STATS: libc::c_uint = 0x00002000;
44pub const CTLFLAG_NOFETCH: libc::c_uint = 0x00001000;
45pub const CTLFLAG_CAPRW: libc::c_uint = CTLFLAG_CAPRD | CTLFLAG_CAPWR;
46pub const CTLFLAG_SECURE1: libc::c_uint = 134217728;
47pub const CTLFLAG_SECURE2: libc::c_uint = 135266304;
48pub const CTLFLAG_SECURE3: libc::c_uint = 136314880;
49
50pub const CTLMASK_SECURE: libc::c_uint = 15728640;
51pub const CTLSHIFT_SECURE: libc::c_uint = 20;