diff --git a/Cargo.toml b/Cargo.toml index bfa010a8..51951f35 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -21,7 +21,7 @@ static_assertions = "1.1.0" libc = "0.2.100" [package.metadata.docs.rs] -features = ["default", "bootparam", "btrfs", "ioctl", "netlink", "io_uring", "if_arp", "if_ether", "if_packet", "net", "prctl", "elf", "xdp", "mempolicy", "system", "loop_device"] +features = ["default", "bootparam", "btrfs", "ioctl", "landlock", "netlink", "io_uring", "if_arp", "if_ether", "if_packet", "net", "prctl", "elf", "xdp", "mempolicy", "system", "loop_device"] targets = ["x86_64-unknown-linux-gnu", "i686-unknown-linux-gnu"] [lints.rust.unexpected_cfgs] @@ -41,6 +41,7 @@ if_ether = [] if_packet = [] io_uring = [] ioctl = [] +landlock = [] loop_device = [] mempolicy = [] net = [] diff --git a/gen/modules/landlock.h b/gen/modules/landlock.h new file mode 100644 index 00000000..ef17d3c1 --- /dev/null +++ b/gen/modules/landlock.h @@ -0,0 +1 @@ +#include diff --git a/src/aarch64/landlock.rs b/src/aarch64/landlock.rs new file mode 100644 index 00000000..6e297123 --- /dev/null +++ b/src/aarch64/landlock.rs @@ -0,0 +1,97 @@ +/* automatically generated by rust-bindgen 0.70.1 */ + +pub type __s8 = crate::ctypes::c_schar; +pub type __u8 = crate::ctypes::c_uchar; +pub type __s16 = crate::ctypes::c_short; +pub type __u16 = crate::ctypes::c_ushort; +pub type __s32 = crate::ctypes::c_int; +pub type __u32 = crate::ctypes::c_uint; +pub type __s64 = crate::ctypes::c_longlong; +pub type __u64 = crate::ctypes::c_ulonglong; +pub type __kernel_key_t = crate::ctypes::c_int; +pub type __kernel_mqd_t = crate::ctypes::c_int; +pub type __kernel_old_uid_t = crate::ctypes::c_ushort; +pub type __kernel_old_gid_t = crate::ctypes::c_ushort; +pub type __kernel_long_t = crate::ctypes::c_long; +pub type __kernel_ulong_t = crate::ctypes::c_ulong; +pub type __kernel_ino_t = __kernel_ulong_t; +pub type __kernel_mode_t = crate::ctypes::c_uint; +pub type __kernel_pid_t = crate::ctypes::c_int; +pub type __kernel_ipc_pid_t = crate::ctypes::c_int; +pub type __kernel_uid_t = crate::ctypes::c_uint; +pub type __kernel_gid_t = crate::ctypes::c_uint; +pub type __kernel_suseconds_t = __kernel_long_t; +pub type __kernel_daddr_t = crate::ctypes::c_int; +pub type __kernel_uid32_t = crate::ctypes::c_uint; +pub type __kernel_gid32_t = crate::ctypes::c_uint; +pub type __kernel_old_dev_t = crate::ctypes::c_uint; +pub type __kernel_size_t = __kernel_ulong_t; +pub type __kernel_ssize_t = __kernel_long_t; +pub type __kernel_ptrdiff_t = __kernel_long_t; +pub type __kernel_off_t = __kernel_long_t; +pub type __kernel_loff_t = crate::ctypes::c_longlong; +pub type __kernel_old_time_t = __kernel_long_t; +pub type __kernel_time_t = __kernel_long_t; +pub type __kernel_time64_t = crate::ctypes::c_longlong; +pub type __kernel_clock_t = __kernel_long_t; +pub type __kernel_timer_t = crate::ctypes::c_int; +pub type __kernel_clockid_t = crate::ctypes::c_int; +pub type __kernel_caddr_t = *mut crate::ctypes::c_char; +pub type __kernel_uid16_t = crate::ctypes::c_ushort; +pub type __kernel_gid16_t = crate::ctypes::c_ushort; +pub type __s128 = i128; +pub type __u128 = u128; +pub type __le16 = __u16; +pub type __be16 = __u16; +pub type __le32 = __u32; +pub type __be32 = __u32; +pub type __le64 = __u64; +pub type __be64 = __u64; +pub type __sum16 = __u16; +pub type __wsum = __u32; +pub type __poll_t = crate::ctypes::c_uint; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct landlock_ruleset_attr { +pub handled_access_fs: __u64, +pub handled_access_net: __u64, +} +#[repr(C, packed)] +#[derive(Debug, Copy, Clone)] +pub struct landlock_path_beneath_attr { +pub allowed_access: __u64, +pub parent_fd: __s32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct landlock_net_port_attr { +pub allowed_access: __u64, +pub port: __u64, +} +pub const __BITS_PER_LONG_LONG: u32 = 64; +pub const LANDLOCK_CREATE_RULESET_VERSION: u32 = 1; +pub const LANDLOCK_ACCESS_FS_EXECUTE: u32 = 1; +pub const LANDLOCK_ACCESS_FS_WRITE_FILE: u32 = 2; +pub const LANDLOCK_ACCESS_FS_READ_FILE: u32 = 4; +pub const LANDLOCK_ACCESS_FS_READ_DIR: u32 = 8; +pub const LANDLOCK_ACCESS_FS_REMOVE_DIR: u32 = 16; +pub const LANDLOCK_ACCESS_FS_REMOVE_FILE: u32 = 32; +pub const LANDLOCK_ACCESS_FS_MAKE_CHAR: u32 = 64; +pub const LANDLOCK_ACCESS_FS_MAKE_DIR: u32 = 128; +pub const LANDLOCK_ACCESS_FS_MAKE_REG: u32 = 256; +pub const LANDLOCK_ACCESS_FS_MAKE_SOCK: u32 = 512; +pub const LANDLOCK_ACCESS_FS_MAKE_FIFO: u32 = 1024; +pub const LANDLOCK_ACCESS_FS_MAKE_BLOCK: u32 = 2048; +pub const LANDLOCK_ACCESS_FS_MAKE_SYM: u32 = 4096; +pub const LANDLOCK_ACCESS_FS_REFER: u32 = 8192; +pub const LANDLOCK_ACCESS_FS_TRUNCATE: u32 = 16384; +pub const LANDLOCK_ACCESS_FS_IOCTL_DEV: u32 = 32768; +pub const LANDLOCK_ACCESS_NET_BIND_TCP: u32 = 1; +pub const LANDLOCK_ACCESS_NET_CONNECT_TCP: u32 = 2; +#[repr(u32)] +#[non_exhaustive] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub enum landlock_rule_type { +LANDLOCK_RULE_PATH_BENEATH = 1, +LANDLOCK_RULE_NET_PORT = 2, +} diff --git a/src/arm/landlock.rs b/src/arm/landlock.rs new file mode 100644 index 00000000..a713cbe9 --- /dev/null +++ b/src/arm/landlock.rs @@ -0,0 +1,95 @@ +/* automatically generated by rust-bindgen 0.70.1 */ + +pub type __s8 = crate::ctypes::c_schar; +pub type __u8 = crate::ctypes::c_uchar; +pub type __s16 = crate::ctypes::c_short; +pub type __u16 = crate::ctypes::c_ushort; +pub type __s32 = crate::ctypes::c_int; +pub type __u32 = crate::ctypes::c_uint; +pub type __s64 = crate::ctypes::c_longlong; +pub type __u64 = crate::ctypes::c_ulonglong; +pub type __kernel_key_t = crate::ctypes::c_int; +pub type __kernel_mqd_t = crate::ctypes::c_int; +pub type __kernel_mode_t = crate::ctypes::c_ushort; +pub type __kernel_ipc_pid_t = crate::ctypes::c_ushort; +pub type __kernel_uid_t = crate::ctypes::c_ushort; +pub type __kernel_gid_t = crate::ctypes::c_ushort; +pub type __kernel_old_dev_t = crate::ctypes::c_ushort; +pub type __kernel_long_t = crate::ctypes::c_long; +pub type __kernel_ulong_t = crate::ctypes::c_ulong; +pub type __kernel_ino_t = __kernel_ulong_t; +pub type __kernel_pid_t = crate::ctypes::c_int; +pub type __kernel_suseconds_t = __kernel_long_t; +pub type __kernel_daddr_t = crate::ctypes::c_int; +pub type __kernel_uid32_t = crate::ctypes::c_uint; +pub type __kernel_gid32_t = crate::ctypes::c_uint; +pub type __kernel_old_uid_t = __kernel_uid_t; +pub type __kernel_old_gid_t = __kernel_gid_t; +pub type __kernel_size_t = crate::ctypes::c_uint; +pub type __kernel_ssize_t = crate::ctypes::c_int; +pub type __kernel_ptrdiff_t = crate::ctypes::c_int; +pub type __kernel_off_t = __kernel_long_t; +pub type __kernel_loff_t = crate::ctypes::c_longlong; +pub type __kernel_old_time_t = __kernel_long_t; +pub type __kernel_time_t = __kernel_long_t; +pub type __kernel_time64_t = crate::ctypes::c_longlong; +pub type __kernel_clock_t = __kernel_long_t; +pub type __kernel_timer_t = crate::ctypes::c_int; +pub type __kernel_clockid_t = crate::ctypes::c_int; +pub type __kernel_caddr_t = *mut crate::ctypes::c_char; +pub type __kernel_uid16_t = crate::ctypes::c_ushort; +pub type __kernel_gid16_t = crate::ctypes::c_ushort; +pub type __le16 = __u16; +pub type __be16 = __u16; +pub type __le32 = __u32; +pub type __be32 = __u32; +pub type __le64 = __u64; +pub type __be64 = __u64; +pub type __sum16 = __u16; +pub type __wsum = __u32; +pub type __poll_t = crate::ctypes::c_uint; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct landlock_ruleset_attr { +pub handled_access_fs: __u64, +pub handled_access_net: __u64, +} +#[repr(C, packed)] +#[derive(Debug, Copy, Clone)] +pub struct landlock_path_beneath_attr { +pub allowed_access: __u64, +pub parent_fd: __s32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct landlock_net_port_attr { +pub allowed_access: __u64, +pub port: __u64, +} +pub const __BITS_PER_LONG_LONG: u32 = 64; +pub const LANDLOCK_CREATE_RULESET_VERSION: u32 = 1; +pub const LANDLOCK_ACCESS_FS_EXECUTE: u32 = 1; +pub const LANDLOCK_ACCESS_FS_WRITE_FILE: u32 = 2; +pub const LANDLOCK_ACCESS_FS_READ_FILE: u32 = 4; +pub const LANDLOCK_ACCESS_FS_READ_DIR: u32 = 8; +pub const LANDLOCK_ACCESS_FS_REMOVE_DIR: u32 = 16; +pub const LANDLOCK_ACCESS_FS_REMOVE_FILE: u32 = 32; +pub const LANDLOCK_ACCESS_FS_MAKE_CHAR: u32 = 64; +pub const LANDLOCK_ACCESS_FS_MAKE_DIR: u32 = 128; +pub const LANDLOCK_ACCESS_FS_MAKE_REG: u32 = 256; +pub const LANDLOCK_ACCESS_FS_MAKE_SOCK: u32 = 512; +pub const LANDLOCK_ACCESS_FS_MAKE_FIFO: u32 = 1024; +pub const LANDLOCK_ACCESS_FS_MAKE_BLOCK: u32 = 2048; +pub const LANDLOCK_ACCESS_FS_MAKE_SYM: u32 = 4096; +pub const LANDLOCK_ACCESS_FS_REFER: u32 = 8192; +pub const LANDLOCK_ACCESS_FS_TRUNCATE: u32 = 16384; +pub const LANDLOCK_ACCESS_FS_IOCTL_DEV: u32 = 32768; +pub const LANDLOCK_ACCESS_NET_BIND_TCP: u32 = 1; +pub const LANDLOCK_ACCESS_NET_CONNECT_TCP: u32 = 2; +#[repr(u32)] +#[non_exhaustive] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub enum landlock_rule_type { +LANDLOCK_RULE_PATH_BENEATH = 1, +LANDLOCK_RULE_NET_PORT = 2, +} diff --git a/src/csky/landlock.rs b/src/csky/landlock.rs new file mode 100644 index 00000000..48f0ddcf --- /dev/null +++ b/src/csky/landlock.rs @@ -0,0 +1,95 @@ +/* automatically generated by rust-bindgen 0.70.1 */ + +pub type __s8 = crate::ctypes::c_schar; +pub type __u8 = crate::ctypes::c_uchar; +pub type __s16 = crate::ctypes::c_short; +pub type __u16 = crate::ctypes::c_ushort; +pub type __s32 = crate::ctypes::c_int; +pub type __u32 = crate::ctypes::c_uint; +pub type __s64 = crate::ctypes::c_longlong; +pub type __u64 = crate::ctypes::c_ulonglong; +pub type __kernel_key_t = crate::ctypes::c_int; +pub type __kernel_mqd_t = crate::ctypes::c_int; +pub type __kernel_long_t = crate::ctypes::c_long; +pub type __kernel_ulong_t = crate::ctypes::c_ulong; +pub type __kernel_ino_t = __kernel_ulong_t; +pub type __kernel_mode_t = crate::ctypes::c_uint; +pub type __kernel_pid_t = crate::ctypes::c_int; +pub type __kernel_ipc_pid_t = crate::ctypes::c_int; +pub type __kernel_uid_t = crate::ctypes::c_uint; +pub type __kernel_gid_t = crate::ctypes::c_uint; +pub type __kernel_suseconds_t = __kernel_long_t; +pub type __kernel_daddr_t = crate::ctypes::c_int; +pub type __kernel_uid32_t = crate::ctypes::c_uint; +pub type __kernel_gid32_t = crate::ctypes::c_uint; +pub type __kernel_old_uid_t = __kernel_uid_t; +pub type __kernel_old_gid_t = __kernel_gid_t; +pub type __kernel_old_dev_t = crate::ctypes::c_uint; +pub type __kernel_size_t = crate::ctypes::c_uint; +pub type __kernel_ssize_t = crate::ctypes::c_int; +pub type __kernel_ptrdiff_t = crate::ctypes::c_int; +pub type __kernel_off_t = __kernel_long_t; +pub type __kernel_loff_t = crate::ctypes::c_longlong; +pub type __kernel_old_time_t = __kernel_long_t; +pub type __kernel_time_t = __kernel_long_t; +pub type __kernel_time64_t = crate::ctypes::c_longlong; +pub type __kernel_clock_t = __kernel_long_t; +pub type __kernel_timer_t = crate::ctypes::c_int; +pub type __kernel_clockid_t = crate::ctypes::c_int; +pub type __kernel_caddr_t = *mut crate::ctypes::c_char; +pub type __kernel_uid16_t = crate::ctypes::c_ushort; +pub type __kernel_gid16_t = crate::ctypes::c_ushort; +pub type __le16 = __u16; +pub type __be16 = __u16; +pub type __le32 = __u32; +pub type __be32 = __u32; +pub type __le64 = __u64; +pub type __be64 = __u64; +pub type __sum16 = __u16; +pub type __wsum = __u32; +pub type __poll_t = crate::ctypes::c_uint; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct landlock_ruleset_attr { +pub handled_access_fs: __u64, +pub handled_access_net: __u64, +} +#[repr(C, packed)] +#[derive(Debug, Copy, Clone)] +pub struct landlock_path_beneath_attr { +pub allowed_access: __u64, +pub parent_fd: __s32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct landlock_net_port_attr { +pub allowed_access: __u64, +pub port: __u64, +} +pub const __BITS_PER_LONG_LONG: u32 = 64; +pub const LANDLOCK_CREATE_RULESET_VERSION: u32 = 1; +pub const LANDLOCK_ACCESS_FS_EXECUTE: u32 = 1; +pub const LANDLOCK_ACCESS_FS_WRITE_FILE: u32 = 2; +pub const LANDLOCK_ACCESS_FS_READ_FILE: u32 = 4; +pub const LANDLOCK_ACCESS_FS_READ_DIR: u32 = 8; +pub const LANDLOCK_ACCESS_FS_REMOVE_DIR: u32 = 16; +pub const LANDLOCK_ACCESS_FS_REMOVE_FILE: u32 = 32; +pub const LANDLOCK_ACCESS_FS_MAKE_CHAR: u32 = 64; +pub const LANDLOCK_ACCESS_FS_MAKE_DIR: u32 = 128; +pub const LANDLOCK_ACCESS_FS_MAKE_REG: u32 = 256; +pub const LANDLOCK_ACCESS_FS_MAKE_SOCK: u32 = 512; +pub const LANDLOCK_ACCESS_FS_MAKE_FIFO: u32 = 1024; +pub const LANDLOCK_ACCESS_FS_MAKE_BLOCK: u32 = 2048; +pub const LANDLOCK_ACCESS_FS_MAKE_SYM: u32 = 4096; +pub const LANDLOCK_ACCESS_FS_REFER: u32 = 8192; +pub const LANDLOCK_ACCESS_FS_TRUNCATE: u32 = 16384; +pub const LANDLOCK_ACCESS_FS_IOCTL_DEV: u32 = 32768; +pub const LANDLOCK_ACCESS_NET_BIND_TCP: u32 = 1; +pub const LANDLOCK_ACCESS_NET_CONNECT_TCP: u32 = 2; +#[repr(u32)] +#[non_exhaustive] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub enum landlock_rule_type { +LANDLOCK_RULE_PATH_BENEATH = 1, +LANDLOCK_RULE_NET_PORT = 2, +} diff --git a/src/lib.rs b/src/lib.rs index 23372124..8e87df34 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -245,6 +245,10 @@ pub mod io_uring; #[cfg(target_arch = "arm")] #[path = "arm/ioctl.rs"] pub mod ioctl; +#[cfg(feature = "landlock")] +#[cfg(target_arch = "arm")] +#[path = "arm/landlock.rs"] +pub mod landlock; #[cfg(feature = "loop_device")] #[cfg(target_arch = "arm")] #[path = "arm/loop_device.rs"] @@ -309,6 +313,10 @@ pub mod io_uring; #[cfg(target_arch = "aarch64")] #[path = "aarch64/ioctl.rs"] pub mod ioctl; +#[cfg(feature = "landlock")] +#[cfg(target_arch = "aarch64")] +#[path = "aarch64/landlock.rs"] +pub mod landlock; #[cfg(feature = "loop_device")] #[cfg(target_arch = "aarch64")] #[path = "aarch64/loop_device.rs"] @@ -373,6 +381,10 @@ pub mod io_uring; #[cfg(target_arch = "csky")] #[path = "csky/ioctl.rs"] pub mod ioctl; +#[cfg(feature = "landlock")] +#[cfg(target_arch = "csky")] +#[path = "csky/landlock.rs"] +pub mod landlock; #[cfg(feature = "loop_device")] #[cfg(target_arch = "csky")] #[path = "csky/loop_device.rs"] @@ -437,6 +449,10 @@ pub mod io_uring; #[cfg(target_arch = "loongarch64")] #[path = "loongarch64/ioctl.rs"] pub mod ioctl; +#[cfg(feature = "landlock")] +#[cfg(target_arch = "loongarch64")] +#[path = "loongarch64/landlock.rs"] +pub mod landlock; #[cfg(feature = "loop_device")] #[cfg(target_arch = "loongarch64")] #[path = "loongarch64/loop_device.rs"] @@ -501,6 +517,10 @@ pub mod io_uring; #[cfg(target_arch = "mips")] #[path = "mips/ioctl.rs"] pub mod ioctl; +#[cfg(feature = "landlock")] +#[cfg(target_arch = "mips")] +#[path = "mips/landlock.rs"] +pub mod landlock; #[cfg(feature = "loop_device")] #[cfg(target_arch = "mips")] #[path = "mips/loop_device.rs"] @@ -565,6 +585,10 @@ pub mod io_uring; #[cfg(target_arch = "mips64")] #[path = "mips64/ioctl.rs"] pub mod ioctl; +#[cfg(feature = "landlock")] +#[cfg(target_arch = "mips64")] +#[path = "mips64/landlock.rs"] +pub mod landlock; #[cfg(feature = "loop_device")] #[cfg(target_arch = "mips64")] #[path = "mips64/loop_device.rs"] @@ -629,6 +653,10 @@ pub mod io_uring; #[cfg(target_arch = "mips32r6")] #[path = "mips32r6/ioctl.rs"] pub mod ioctl; +#[cfg(feature = "landlock")] +#[cfg(target_arch = "mips32r6")] +#[path = "mips32r6/landlock.rs"] +pub mod landlock; #[cfg(feature = "loop_device")] #[cfg(target_arch = "mips32r6")] #[path = "mips32r6/loop_device.rs"] @@ -693,6 +721,10 @@ pub mod io_uring; #[cfg(target_arch = "mips64r6")] #[path = "mips64r6/ioctl.rs"] pub mod ioctl; +#[cfg(feature = "landlock")] +#[cfg(target_arch = "mips64r6")] +#[path = "mips64r6/landlock.rs"] +pub mod landlock; #[cfg(feature = "loop_device")] #[cfg(target_arch = "mips64r6")] #[path = "mips64r6/loop_device.rs"] @@ -757,6 +789,10 @@ pub mod io_uring; #[cfg(target_arch = "powerpc")] #[path = "powerpc/ioctl.rs"] pub mod ioctl; +#[cfg(feature = "landlock")] +#[cfg(target_arch = "powerpc")] +#[path = "powerpc/landlock.rs"] +pub mod landlock; #[cfg(feature = "loop_device")] #[cfg(target_arch = "powerpc")] #[path = "powerpc/loop_device.rs"] @@ -821,6 +857,10 @@ pub mod io_uring; #[cfg(target_arch = "powerpc64")] #[path = "powerpc64/ioctl.rs"] pub mod ioctl; +#[cfg(feature = "landlock")] +#[cfg(target_arch = "powerpc64")] +#[path = "powerpc64/landlock.rs"] +pub mod landlock; #[cfg(feature = "loop_device")] #[cfg(target_arch = "powerpc64")] #[path = "powerpc64/loop_device.rs"] @@ -885,6 +925,10 @@ pub mod io_uring; #[cfg(target_arch = "riscv32")] #[path = "riscv32/ioctl.rs"] pub mod ioctl; +#[cfg(feature = "landlock")] +#[cfg(target_arch = "riscv32")] +#[path = "riscv32/landlock.rs"] +pub mod landlock; #[cfg(feature = "loop_device")] #[cfg(target_arch = "riscv32")] #[path = "riscv32/loop_device.rs"] @@ -949,6 +993,10 @@ pub mod io_uring; #[cfg(target_arch = "riscv64")] #[path = "riscv64/ioctl.rs"] pub mod ioctl; +#[cfg(feature = "landlock")] +#[cfg(target_arch = "riscv64")] +#[path = "riscv64/landlock.rs"] +pub mod landlock; #[cfg(feature = "loop_device")] #[cfg(target_arch = "riscv64")] #[path = "riscv64/loop_device.rs"] @@ -1013,6 +1061,10 @@ pub mod io_uring; #[cfg(target_arch = "s390x")] #[path = "s390x/ioctl.rs"] pub mod ioctl; +#[cfg(feature = "landlock")] +#[cfg(target_arch = "s390x")] +#[path = "s390x/landlock.rs"] +pub mod landlock; #[cfg(feature = "loop_device")] #[cfg(target_arch = "s390x")] #[path = "s390x/loop_device.rs"] @@ -1077,6 +1129,10 @@ pub mod io_uring; #[cfg(target_arch = "sparc")] #[path = "sparc/ioctl.rs"] pub mod ioctl; +#[cfg(feature = "landlock")] +#[cfg(target_arch = "sparc")] +#[path = "sparc/landlock.rs"] +pub mod landlock; #[cfg(feature = "loop_device")] #[cfg(target_arch = "sparc")] #[path = "sparc/loop_device.rs"] @@ -1141,6 +1197,10 @@ pub mod io_uring; #[cfg(target_arch = "sparc64")] #[path = "sparc64/ioctl.rs"] pub mod ioctl; +#[cfg(feature = "landlock")] +#[cfg(target_arch = "sparc64")] +#[path = "sparc64/landlock.rs"] +pub mod landlock; #[cfg(feature = "loop_device")] #[cfg(target_arch = "sparc64")] #[path = "sparc64/loop_device.rs"] @@ -1205,6 +1265,10 @@ pub mod io_uring; #[cfg(target_arch = "x86")] #[path = "x86/ioctl.rs"] pub mod ioctl; +#[cfg(feature = "landlock")] +#[cfg(target_arch = "x86")] +#[path = "x86/landlock.rs"] +pub mod landlock; #[cfg(feature = "loop_device")] #[cfg(target_arch = "x86")] #[path = "x86/loop_device.rs"] @@ -1269,6 +1333,10 @@ pub mod io_uring; #[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))] #[path = "x86_64/ioctl.rs"] pub mod ioctl; +#[cfg(feature = "landlock")] +#[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))] +#[path = "x86_64/landlock.rs"] +pub mod landlock; #[cfg(feature = "loop_device")] #[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))] #[path = "x86_64/loop_device.rs"] @@ -1333,6 +1401,10 @@ pub mod io_uring; #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] #[path = "x32/ioctl.rs"] pub mod ioctl; +#[cfg(feature = "landlock")] +#[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] +#[path = "x32/landlock.rs"] +pub mod landlock; #[cfg(feature = "loop_device")] #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] #[path = "x32/loop_device.rs"] diff --git a/src/loongarch64/landlock.rs b/src/loongarch64/landlock.rs new file mode 100644 index 00000000..1857c9f1 --- /dev/null +++ b/src/loongarch64/landlock.rs @@ -0,0 +1,97 @@ +/* automatically generated by rust-bindgen 0.70.1 */ + +pub type __s8 = crate::ctypes::c_schar; +pub type __u8 = crate::ctypes::c_uchar; +pub type __s16 = crate::ctypes::c_short; +pub type __u16 = crate::ctypes::c_ushort; +pub type __s32 = crate::ctypes::c_int; +pub type __u32 = crate::ctypes::c_uint; +pub type __s64 = crate::ctypes::c_longlong; +pub type __u64 = crate::ctypes::c_ulonglong; +pub type __kernel_key_t = crate::ctypes::c_int; +pub type __kernel_mqd_t = crate::ctypes::c_int; +pub type __kernel_long_t = crate::ctypes::c_long; +pub type __kernel_ulong_t = crate::ctypes::c_ulong; +pub type __kernel_ino_t = __kernel_ulong_t; +pub type __kernel_mode_t = crate::ctypes::c_uint; +pub type __kernel_pid_t = crate::ctypes::c_int; +pub type __kernel_ipc_pid_t = crate::ctypes::c_int; +pub type __kernel_uid_t = crate::ctypes::c_uint; +pub type __kernel_gid_t = crate::ctypes::c_uint; +pub type __kernel_suseconds_t = __kernel_long_t; +pub type __kernel_daddr_t = crate::ctypes::c_int; +pub type __kernel_uid32_t = crate::ctypes::c_uint; +pub type __kernel_gid32_t = crate::ctypes::c_uint; +pub type __kernel_old_uid_t = __kernel_uid_t; +pub type __kernel_old_gid_t = __kernel_gid_t; +pub type __kernel_old_dev_t = crate::ctypes::c_uint; +pub type __kernel_size_t = __kernel_ulong_t; +pub type __kernel_ssize_t = __kernel_long_t; +pub type __kernel_ptrdiff_t = __kernel_long_t; +pub type __kernel_off_t = __kernel_long_t; +pub type __kernel_loff_t = crate::ctypes::c_longlong; +pub type __kernel_old_time_t = __kernel_long_t; +pub type __kernel_time_t = __kernel_long_t; +pub type __kernel_time64_t = crate::ctypes::c_longlong; +pub type __kernel_clock_t = __kernel_long_t; +pub type __kernel_timer_t = crate::ctypes::c_int; +pub type __kernel_clockid_t = crate::ctypes::c_int; +pub type __kernel_caddr_t = *mut crate::ctypes::c_char; +pub type __kernel_uid16_t = crate::ctypes::c_ushort; +pub type __kernel_gid16_t = crate::ctypes::c_ushort; +pub type __s128 = i128; +pub type __u128 = u128; +pub type __le16 = __u16; +pub type __be16 = __u16; +pub type __le32 = __u32; +pub type __be32 = __u32; +pub type __le64 = __u64; +pub type __be64 = __u64; +pub type __sum16 = __u16; +pub type __wsum = __u32; +pub type __poll_t = crate::ctypes::c_uint; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct landlock_ruleset_attr { +pub handled_access_fs: __u64, +pub handled_access_net: __u64, +} +#[repr(C, packed)] +#[derive(Debug, Copy, Clone)] +pub struct landlock_path_beneath_attr { +pub allowed_access: __u64, +pub parent_fd: __s32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct landlock_net_port_attr { +pub allowed_access: __u64, +pub port: __u64, +} +pub const __BITS_PER_LONG_LONG: u32 = 64; +pub const LANDLOCK_CREATE_RULESET_VERSION: u32 = 1; +pub const LANDLOCK_ACCESS_FS_EXECUTE: u32 = 1; +pub const LANDLOCK_ACCESS_FS_WRITE_FILE: u32 = 2; +pub const LANDLOCK_ACCESS_FS_READ_FILE: u32 = 4; +pub const LANDLOCK_ACCESS_FS_READ_DIR: u32 = 8; +pub const LANDLOCK_ACCESS_FS_REMOVE_DIR: u32 = 16; +pub const LANDLOCK_ACCESS_FS_REMOVE_FILE: u32 = 32; +pub const LANDLOCK_ACCESS_FS_MAKE_CHAR: u32 = 64; +pub const LANDLOCK_ACCESS_FS_MAKE_DIR: u32 = 128; +pub const LANDLOCK_ACCESS_FS_MAKE_REG: u32 = 256; +pub const LANDLOCK_ACCESS_FS_MAKE_SOCK: u32 = 512; +pub const LANDLOCK_ACCESS_FS_MAKE_FIFO: u32 = 1024; +pub const LANDLOCK_ACCESS_FS_MAKE_BLOCK: u32 = 2048; +pub const LANDLOCK_ACCESS_FS_MAKE_SYM: u32 = 4096; +pub const LANDLOCK_ACCESS_FS_REFER: u32 = 8192; +pub const LANDLOCK_ACCESS_FS_TRUNCATE: u32 = 16384; +pub const LANDLOCK_ACCESS_FS_IOCTL_DEV: u32 = 32768; +pub const LANDLOCK_ACCESS_NET_BIND_TCP: u32 = 1; +pub const LANDLOCK_ACCESS_NET_CONNECT_TCP: u32 = 2; +#[repr(u32)] +#[non_exhaustive] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub enum landlock_rule_type { +LANDLOCK_RULE_PATH_BENEATH = 1, +LANDLOCK_RULE_NET_PORT = 2, +} diff --git a/src/mips/landlock.rs b/src/mips/landlock.rs new file mode 100644 index 00000000..5b4e140e --- /dev/null +++ b/src/mips/landlock.rs @@ -0,0 +1,105 @@ +/* automatically generated by rust-bindgen 0.70.1 */ + +pub type __s8 = crate::ctypes::c_schar; +pub type __u8 = crate::ctypes::c_uchar; +pub type __s16 = crate::ctypes::c_short; +pub type __u16 = crate::ctypes::c_ushort; +pub type __s32 = crate::ctypes::c_int; +pub type __u32 = crate::ctypes::c_uint; +pub type __s64 = crate::ctypes::c_longlong; +pub type __u64 = crate::ctypes::c_ulonglong; +pub type __kernel_key_t = crate::ctypes::c_int; +pub type __kernel_mqd_t = crate::ctypes::c_int; +pub type __kernel_daddr_t = crate::ctypes::c_long; +pub type __kernel_long_t = crate::ctypes::c_long; +pub type __kernel_ulong_t = crate::ctypes::c_ulong; +pub type __kernel_ino_t = __kernel_ulong_t; +pub type __kernel_mode_t = crate::ctypes::c_uint; +pub type __kernel_pid_t = crate::ctypes::c_int; +pub type __kernel_ipc_pid_t = crate::ctypes::c_int; +pub type __kernel_uid_t = crate::ctypes::c_uint; +pub type __kernel_gid_t = crate::ctypes::c_uint; +pub type __kernel_suseconds_t = __kernel_long_t; +pub type __kernel_uid32_t = crate::ctypes::c_uint; +pub type __kernel_gid32_t = crate::ctypes::c_uint; +pub type __kernel_old_uid_t = __kernel_uid_t; +pub type __kernel_old_gid_t = __kernel_gid_t; +pub type __kernel_old_dev_t = crate::ctypes::c_uint; +pub type __kernel_size_t = crate::ctypes::c_uint; +pub type __kernel_ssize_t = crate::ctypes::c_int; +pub type __kernel_ptrdiff_t = crate::ctypes::c_int; +pub type __kernel_off_t = __kernel_long_t; +pub type __kernel_loff_t = crate::ctypes::c_longlong; +pub type __kernel_old_time_t = __kernel_long_t; +pub type __kernel_time_t = __kernel_long_t; +pub type __kernel_time64_t = crate::ctypes::c_longlong; +pub type __kernel_clock_t = __kernel_long_t; +pub type __kernel_timer_t = crate::ctypes::c_int; +pub type __kernel_clockid_t = crate::ctypes::c_int; +pub type __kernel_caddr_t = *mut crate::ctypes::c_char; +pub type __kernel_uid16_t = crate::ctypes::c_ushort; +pub type __kernel_gid16_t = crate::ctypes::c_ushort; +pub type __le16 = __u16; +pub type __be16 = __u16; +pub type __le32 = __u32; +pub type __be32 = __u32; +pub type __le64 = __u64; +pub type __be64 = __u64; +pub type __sum16 = __u16; +pub type __wsum = __u32; +pub type __poll_t = crate::ctypes::c_uint; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct landlock_ruleset_attr { +pub handled_access_fs: __u64, +pub handled_access_net: __u64, +} +#[repr(C, packed)] +#[derive(Debug, Copy, Clone)] +pub struct landlock_path_beneath_attr { +pub allowed_access: __u64, +pub parent_fd: __s32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct landlock_net_port_attr { +pub allowed_access: __u64, +pub port: __u64, +} +pub const __BITS_PER_LONG_LONG: u32 = 64; +pub const _MIPS_ISA_MIPS1: u32 = 1; +pub const _MIPS_ISA_MIPS2: u32 = 2; +pub const _MIPS_ISA_MIPS3: u32 = 3; +pub const _MIPS_ISA_MIPS4: u32 = 4; +pub const _MIPS_ISA_MIPS5: u32 = 5; +pub const _MIPS_ISA_MIPS32: u32 = 6; +pub const _MIPS_ISA_MIPS64: u32 = 7; +pub const _MIPS_SIM_ABI32: u32 = 1; +pub const _MIPS_SIM_NABI32: u32 = 2; +pub const _MIPS_SIM_ABI64: u32 = 3; +pub const LANDLOCK_CREATE_RULESET_VERSION: u32 = 1; +pub const LANDLOCK_ACCESS_FS_EXECUTE: u32 = 1; +pub const LANDLOCK_ACCESS_FS_WRITE_FILE: u32 = 2; +pub const LANDLOCK_ACCESS_FS_READ_FILE: u32 = 4; +pub const LANDLOCK_ACCESS_FS_READ_DIR: u32 = 8; +pub const LANDLOCK_ACCESS_FS_REMOVE_DIR: u32 = 16; +pub const LANDLOCK_ACCESS_FS_REMOVE_FILE: u32 = 32; +pub const LANDLOCK_ACCESS_FS_MAKE_CHAR: u32 = 64; +pub const LANDLOCK_ACCESS_FS_MAKE_DIR: u32 = 128; +pub const LANDLOCK_ACCESS_FS_MAKE_REG: u32 = 256; +pub const LANDLOCK_ACCESS_FS_MAKE_SOCK: u32 = 512; +pub const LANDLOCK_ACCESS_FS_MAKE_FIFO: u32 = 1024; +pub const LANDLOCK_ACCESS_FS_MAKE_BLOCK: u32 = 2048; +pub const LANDLOCK_ACCESS_FS_MAKE_SYM: u32 = 4096; +pub const LANDLOCK_ACCESS_FS_REFER: u32 = 8192; +pub const LANDLOCK_ACCESS_FS_TRUNCATE: u32 = 16384; +pub const LANDLOCK_ACCESS_FS_IOCTL_DEV: u32 = 32768; +pub const LANDLOCK_ACCESS_NET_BIND_TCP: u32 = 1; +pub const LANDLOCK_ACCESS_NET_CONNECT_TCP: u32 = 2; +#[repr(u32)] +#[non_exhaustive] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub enum landlock_rule_type { +LANDLOCK_RULE_PATH_BENEATH = 1, +LANDLOCK_RULE_NET_PORT = 2, +} diff --git a/src/mips32r6/landlock.rs b/src/mips32r6/landlock.rs new file mode 100644 index 00000000..5b4e140e --- /dev/null +++ b/src/mips32r6/landlock.rs @@ -0,0 +1,105 @@ +/* automatically generated by rust-bindgen 0.70.1 */ + +pub type __s8 = crate::ctypes::c_schar; +pub type __u8 = crate::ctypes::c_uchar; +pub type __s16 = crate::ctypes::c_short; +pub type __u16 = crate::ctypes::c_ushort; +pub type __s32 = crate::ctypes::c_int; +pub type __u32 = crate::ctypes::c_uint; +pub type __s64 = crate::ctypes::c_longlong; +pub type __u64 = crate::ctypes::c_ulonglong; +pub type __kernel_key_t = crate::ctypes::c_int; +pub type __kernel_mqd_t = crate::ctypes::c_int; +pub type __kernel_daddr_t = crate::ctypes::c_long; +pub type __kernel_long_t = crate::ctypes::c_long; +pub type __kernel_ulong_t = crate::ctypes::c_ulong; +pub type __kernel_ino_t = __kernel_ulong_t; +pub type __kernel_mode_t = crate::ctypes::c_uint; +pub type __kernel_pid_t = crate::ctypes::c_int; +pub type __kernel_ipc_pid_t = crate::ctypes::c_int; +pub type __kernel_uid_t = crate::ctypes::c_uint; +pub type __kernel_gid_t = crate::ctypes::c_uint; +pub type __kernel_suseconds_t = __kernel_long_t; +pub type __kernel_uid32_t = crate::ctypes::c_uint; +pub type __kernel_gid32_t = crate::ctypes::c_uint; +pub type __kernel_old_uid_t = __kernel_uid_t; +pub type __kernel_old_gid_t = __kernel_gid_t; +pub type __kernel_old_dev_t = crate::ctypes::c_uint; +pub type __kernel_size_t = crate::ctypes::c_uint; +pub type __kernel_ssize_t = crate::ctypes::c_int; +pub type __kernel_ptrdiff_t = crate::ctypes::c_int; +pub type __kernel_off_t = __kernel_long_t; +pub type __kernel_loff_t = crate::ctypes::c_longlong; +pub type __kernel_old_time_t = __kernel_long_t; +pub type __kernel_time_t = __kernel_long_t; +pub type __kernel_time64_t = crate::ctypes::c_longlong; +pub type __kernel_clock_t = __kernel_long_t; +pub type __kernel_timer_t = crate::ctypes::c_int; +pub type __kernel_clockid_t = crate::ctypes::c_int; +pub type __kernel_caddr_t = *mut crate::ctypes::c_char; +pub type __kernel_uid16_t = crate::ctypes::c_ushort; +pub type __kernel_gid16_t = crate::ctypes::c_ushort; +pub type __le16 = __u16; +pub type __be16 = __u16; +pub type __le32 = __u32; +pub type __be32 = __u32; +pub type __le64 = __u64; +pub type __be64 = __u64; +pub type __sum16 = __u16; +pub type __wsum = __u32; +pub type __poll_t = crate::ctypes::c_uint; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct landlock_ruleset_attr { +pub handled_access_fs: __u64, +pub handled_access_net: __u64, +} +#[repr(C, packed)] +#[derive(Debug, Copy, Clone)] +pub struct landlock_path_beneath_attr { +pub allowed_access: __u64, +pub parent_fd: __s32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct landlock_net_port_attr { +pub allowed_access: __u64, +pub port: __u64, +} +pub const __BITS_PER_LONG_LONG: u32 = 64; +pub const _MIPS_ISA_MIPS1: u32 = 1; +pub const _MIPS_ISA_MIPS2: u32 = 2; +pub const _MIPS_ISA_MIPS3: u32 = 3; +pub const _MIPS_ISA_MIPS4: u32 = 4; +pub const _MIPS_ISA_MIPS5: u32 = 5; +pub const _MIPS_ISA_MIPS32: u32 = 6; +pub const _MIPS_ISA_MIPS64: u32 = 7; +pub const _MIPS_SIM_ABI32: u32 = 1; +pub const _MIPS_SIM_NABI32: u32 = 2; +pub const _MIPS_SIM_ABI64: u32 = 3; +pub const LANDLOCK_CREATE_RULESET_VERSION: u32 = 1; +pub const LANDLOCK_ACCESS_FS_EXECUTE: u32 = 1; +pub const LANDLOCK_ACCESS_FS_WRITE_FILE: u32 = 2; +pub const LANDLOCK_ACCESS_FS_READ_FILE: u32 = 4; +pub const LANDLOCK_ACCESS_FS_READ_DIR: u32 = 8; +pub const LANDLOCK_ACCESS_FS_REMOVE_DIR: u32 = 16; +pub const LANDLOCK_ACCESS_FS_REMOVE_FILE: u32 = 32; +pub const LANDLOCK_ACCESS_FS_MAKE_CHAR: u32 = 64; +pub const LANDLOCK_ACCESS_FS_MAKE_DIR: u32 = 128; +pub const LANDLOCK_ACCESS_FS_MAKE_REG: u32 = 256; +pub const LANDLOCK_ACCESS_FS_MAKE_SOCK: u32 = 512; +pub const LANDLOCK_ACCESS_FS_MAKE_FIFO: u32 = 1024; +pub const LANDLOCK_ACCESS_FS_MAKE_BLOCK: u32 = 2048; +pub const LANDLOCK_ACCESS_FS_MAKE_SYM: u32 = 4096; +pub const LANDLOCK_ACCESS_FS_REFER: u32 = 8192; +pub const LANDLOCK_ACCESS_FS_TRUNCATE: u32 = 16384; +pub const LANDLOCK_ACCESS_FS_IOCTL_DEV: u32 = 32768; +pub const LANDLOCK_ACCESS_NET_BIND_TCP: u32 = 1; +pub const LANDLOCK_ACCESS_NET_CONNECT_TCP: u32 = 2; +#[repr(u32)] +#[non_exhaustive] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub enum landlock_rule_type { +LANDLOCK_RULE_PATH_BENEATH = 1, +LANDLOCK_RULE_NET_PORT = 2, +} diff --git a/src/mips64/landlock.rs b/src/mips64/landlock.rs new file mode 100644 index 00000000..7a76b07c --- /dev/null +++ b/src/mips64/landlock.rs @@ -0,0 +1,107 @@ +/* automatically generated by rust-bindgen 0.70.1 */ + +pub type __s8 = crate::ctypes::c_schar; +pub type __u8 = crate::ctypes::c_uchar; +pub type __s16 = crate::ctypes::c_short; +pub type __u16 = crate::ctypes::c_ushort; +pub type __s32 = crate::ctypes::c_int; +pub type __u32 = crate::ctypes::c_uint; +pub type __s64 = crate::ctypes::c_long; +pub type __u64 = crate::ctypes::c_ulong; +pub type __kernel_key_t = crate::ctypes::c_int; +pub type __kernel_mqd_t = crate::ctypes::c_int; +pub type __kernel_daddr_t = crate::ctypes::c_long; +pub type __kernel_long_t = crate::ctypes::c_long; +pub type __kernel_ulong_t = crate::ctypes::c_ulong; +pub type __kernel_ino_t = __kernel_ulong_t; +pub type __kernel_mode_t = crate::ctypes::c_uint; +pub type __kernel_pid_t = crate::ctypes::c_int; +pub type __kernel_ipc_pid_t = crate::ctypes::c_int; +pub type __kernel_uid_t = crate::ctypes::c_uint; +pub type __kernel_gid_t = crate::ctypes::c_uint; +pub type __kernel_suseconds_t = __kernel_long_t; +pub type __kernel_uid32_t = crate::ctypes::c_uint; +pub type __kernel_gid32_t = crate::ctypes::c_uint; +pub type __kernel_old_uid_t = __kernel_uid_t; +pub type __kernel_old_gid_t = __kernel_gid_t; +pub type __kernel_old_dev_t = crate::ctypes::c_uint; +pub type __kernel_size_t = __kernel_ulong_t; +pub type __kernel_ssize_t = __kernel_long_t; +pub type __kernel_ptrdiff_t = __kernel_long_t; +pub type __kernel_off_t = __kernel_long_t; +pub type __kernel_loff_t = crate::ctypes::c_longlong; +pub type __kernel_old_time_t = __kernel_long_t; +pub type __kernel_time_t = __kernel_long_t; +pub type __kernel_time64_t = crate::ctypes::c_longlong; +pub type __kernel_clock_t = __kernel_long_t; +pub type __kernel_timer_t = crate::ctypes::c_int; +pub type __kernel_clockid_t = crate::ctypes::c_int; +pub type __kernel_caddr_t = *mut crate::ctypes::c_char; +pub type __kernel_uid16_t = crate::ctypes::c_ushort; +pub type __kernel_gid16_t = crate::ctypes::c_ushort; +pub type __s128 = i128; +pub type __u128 = u128; +pub type __le16 = __u16; +pub type __be16 = __u16; +pub type __le32 = __u32; +pub type __be32 = __u32; +pub type __le64 = __u64; +pub type __be64 = __u64; +pub type __sum16 = __u16; +pub type __wsum = __u32; +pub type __poll_t = crate::ctypes::c_uint; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct landlock_ruleset_attr { +pub handled_access_fs: __u64, +pub handled_access_net: __u64, +} +#[repr(C, packed)] +#[derive(Debug, Copy, Clone)] +pub struct landlock_path_beneath_attr { +pub allowed_access: __u64, +pub parent_fd: __s32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct landlock_net_port_attr { +pub allowed_access: __u64, +pub port: __u64, +} +pub const __BITS_PER_LONG_LONG: u32 = 64; +pub const _MIPS_ISA_MIPS1: u32 = 1; +pub const _MIPS_ISA_MIPS2: u32 = 2; +pub const _MIPS_ISA_MIPS3: u32 = 3; +pub const _MIPS_ISA_MIPS4: u32 = 4; +pub const _MIPS_ISA_MIPS5: u32 = 5; +pub const _MIPS_ISA_MIPS32: u32 = 6; +pub const _MIPS_ISA_MIPS64: u32 = 7; +pub const _MIPS_SIM_ABI32: u32 = 1; +pub const _MIPS_SIM_NABI32: u32 = 2; +pub const _MIPS_SIM_ABI64: u32 = 3; +pub const LANDLOCK_CREATE_RULESET_VERSION: u32 = 1; +pub const LANDLOCK_ACCESS_FS_EXECUTE: u32 = 1; +pub const LANDLOCK_ACCESS_FS_WRITE_FILE: u32 = 2; +pub const LANDLOCK_ACCESS_FS_READ_FILE: u32 = 4; +pub const LANDLOCK_ACCESS_FS_READ_DIR: u32 = 8; +pub const LANDLOCK_ACCESS_FS_REMOVE_DIR: u32 = 16; +pub const LANDLOCK_ACCESS_FS_REMOVE_FILE: u32 = 32; +pub const LANDLOCK_ACCESS_FS_MAKE_CHAR: u32 = 64; +pub const LANDLOCK_ACCESS_FS_MAKE_DIR: u32 = 128; +pub const LANDLOCK_ACCESS_FS_MAKE_REG: u32 = 256; +pub const LANDLOCK_ACCESS_FS_MAKE_SOCK: u32 = 512; +pub const LANDLOCK_ACCESS_FS_MAKE_FIFO: u32 = 1024; +pub const LANDLOCK_ACCESS_FS_MAKE_BLOCK: u32 = 2048; +pub const LANDLOCK_ACCESS_FS_MAKE_SYM: u32 = 4096; +pub const LANDLOCK_ACCESS_FS_REFER: u32 = 8192; +pub const LANDLOCK_ACCESS_FS_TRUNCATE: u32 = 16384; +pub const LANDLOCK_ACCESS_FS_IOCTL_DEV: u32 = 32768; +pub const LANDLOCK_ACCESS_NET_BIND_TCP: u32 = 1; +pub const LANDLOCK_ACCESS_NET_CONNECT_TCP: u32 = 2; +#[repr(u32)] +#[non_exhaustive] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub enum landlock_rule_type { +LANDLOCK_RULE_PATH_BENEATH = 1, +LANDLOCK_RULE_NET_PORT = 2, +} diff --git a/src/mips64r6/landlock.rs b/src/mips64r6/landlock.rs new file mode 100644 index 00000000..7a76b07c --- /dev/null +++ b/src/mips64r6/landlock.rs @@ -0,0 +1,107 @@ +/* automatically generated by rust-bindgen 0.70.1 */ + +pub type __s8 = crate::ctypes::c_schar; +pub type __u8 = crate::ctypes::c_uchar; +pub type __s16 = crate::ctypes::c_short; +pub type __u16 = crate::ctypes::c_ushort; +pub type __s32 = crate::ctypes::c_int; +pub type __u32 = crate::ctypes::c_uint; +pub type __s64 = crate::ctypes::c_long; +pub type __u64 = crate::ctypes::c_ulong; +pub type __kernel_key_t = crate::ctypes::c_int; +pub type __kernel_mqd_t = crate::ctypes::c_int; +pub type __kernel_daddr_t = crate::ctypes::c_long; +pub type __kernel_long_t = crate::ctypes::c_long; +pub type __kernel_ulong_t = crate::ctypes::c_ulong; +pub type __kernel_ino_t = __kernel_ulong_t; +pub type __kernel_mode_t = crate::ctypes::c_uint; +pub type __kernel_pid_t = crate::ctypes::c_int; +pub type __kernel_ipc_pid_t = crate::ctypes::c_int; +pub type __kernel_uid_t = crate::ctypes::c_uint; +pub type __kernel_gid_t = crate::ctypes::c_uint; +pub type __kernel_suseconds_t = __kernel_long_t; +pub type __kernel_uid32_t = crate::ctypes::c_uint; +pub type __kernel_gid32_t = crate::ctypes::c_uint; +pub type __kernel_old_uid_t = __kernel_uid_t; +pub type __kernel_old_gid_t = __kernel_gid_t; +pub type __kernel_old_dev_t = crate::ctypes::c_uint; +pub type __kernel_size_t = __kernel_ulong_t; +pub type __kernel_ssize_t = __kernel_long_t; +pub type __kernel_ptrdiff_t = __kernel_long_t; +pub type __kernel_off_t = __kernel_long_t; +pub type __kernel_loff_t = crate::ctypes::c_longlong; +pub type __kernel_old_time_t = __kernel_long_t; +pub type __kernel_time_t = __kernel_long_t; +pub type __kernel_time64_t = crate::ctypes::c_longlong; +pub type __kernel_clock_t = __kernel_long_t; +pub type __kernel_timer_t = crate::ctypes::c_int; +pub type __kernel_clockid_t = crate::ctypes::c_int; +pub type __kernel_caddr_t = *mut crate::ctypes::c_char; +pub type __kernel_uid16_t = crate::ctypes::c_ushort; +pub type __kernel_gid16_t = crate::ctypes::c_ushort; +pub type __s128 = i128; +pub type __u128 = u128; +pub type __le16 = __u16; +pub type __be16 = __u16; +pub type __le32 = __u32; +pub type __be32 = __u32; +pub type __le64 = __u64; +pub type __be64 = __u64; +pub type __sum16 = __u16; +pub type __wsum = __u32; +pub type __poll_t = crate::ctypes::c_uint; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct landlock_ruleset_attr { +pub handled_access_fs: __u64, +pub handled_access_net: __u64, +} +#[repr(C, packed)] +#[derive(Debug, Copy, Clone)] +pub struct landlock_path_beneath_attr { +pub allowed_access: __u64, +pub parent_fd: __s32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct landlock_net_port_attr { +pub allowed_access: __u64, +pub port: __u64, +} +pub const __BITS_PER_LONG_LONG: u32 = 64; +pub const _MIPS_ISA_MIPS1: u32 = 1; +pub const _MIPS_ISA_MIPS2: u32 = 2; +pub const _MIPS_ISA_MIPS3: u32 = 3; +pub const _MIPS_ISA_MIPS4: u32 = 4; +pub const _MIPS_ISA_MIPS5: u32 = 5; +pub const _MIPS_ISA_MIPS32: u32 = 6; +pub const _MIPS_ISA_MIPS64: u32 = 7; +pub const _MIPS_SIM_ABI32: u32 = 1; +pub const _MIPS_SIM_NABI32: u32 = 2; +pub const _MIPS_SIM_ABI64: u32 = 3; +pub const LANDLOCK_CREATE_RULESET_VERSION: u32 = 1; +pub const LANDLOCK_ACCESS_FS_EXECUTE: u32 = 1; +pub const LANDLOCK_ACCESS_FS_WRITE_FILE: u32 = 2; +pub const LANDLOCK_ACCESS_FS_READ_FILE: u32 = 4; +pub const LANDLOCK_ACCESS_FS_READ_DIR: u32 = 8; +pub const LANDLOCK_ACCESS_FS_REMOVE_DIR: u32 = 16; +pub const LANDLOCK_ACCESS_FS_REMOVE_FILE: u32 = 32; +pub const LANDLOCK_ACCESS_FS_MAKE_CHAR: u32 = 64; +pub const LANDLOCK_ACCESS_FS_MAKE_DIR: u32 = 128; +pub const LANDLOCK_ACCESS_FS_MAKE_REG: u32 = 256; +pub const LANDLOCK_ACCESS_FS_MAKE_SOCK: u32 = 512; +pub const LANDLOCK_ACCESS_FS_MAKE_FIFO: u32 = 1024; +pub const LANDLOCK_ACCESS_FS_MAKE_BLOCK: u32 = 2048; +pub const LANDLOCK_ACCESS_FS_MAKE_SYM: u32 = 4096; +pub const LANDLOCK_ACCESS_FS_REFER: u32 = 8192; +pub const LANDLOCK_ACCESS_FS_TRUNCATE: u32 = 16384; +pub const LANDLOCK_ACCESS_FS_IOCTL_DEV: u32 = 32768; +pub const LANDLOCK_ACCESS_NET_BIND_TCP: u32 = 1; +pub const LANDLOCK_ACCESS_NET_CONNECT_TCP: u32 = 2; +#[repr(u32)] +#[non_exhaustive] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub enum landlock_rule_type { +LANDLOCK_RULE_PATH_BENEATH = 1, +LANDLOCK_RULE_NET_PORT = 2, +} diff --git a/src/powerpc/landlock.rs b/src/powerpc/landlock.rs new file mode 100644 index 00000000..0a5d2aac --- /dev/null +++ b/src/powerpc/landlock.rs @@ -0,0 +1,101 @@ +/* automatically generated by rust-bindgen 0.70.1 */ + +pub type __s8 = crate::ctypes::c_schar; +pub type __u8 = crate::ctypes::c_uchar; +pub type __s16 = crate::ctypes::c_short; +pub type __u16 = crate::ctypes::c_ushort; +pub type __s32 = crate::ctypes::c_int; +pub type __u32 = crate::ctypes::c_uint; +pub type __s64 = crate::ctypes::c_longlong; +pub type __u64 = crate::ctypes::c_ulonglong; +pub type __kernel_key_t = crate::ctypes::c_int; +pub type __kernel_mqd_t = crate::ctypes::c_int; +pub type __kernel_ipc_pid_t = crate::ctypes::c_short; +pub type __kernel_long_t = crate::ctypes::c_long; +pub type __kernel_ulong_t = crate::ctypes::c_ulong; +pub type __kernel_ino_t = __kernel_ulong_t; +pub type __kernel_mode_t = crate::ctypes::c_uint; +pub type __kernel_pid_t = crate::ctypes::c_int; +pub type __kernel_uid_t = crate::ctypes::c_uint; +pub type __kernel_gid_t = crate::ctypes::c_uint; +pub type __kernel_suseconds_t = __kernel_long_t; +pub type __kernel_daddr_t = crate::ctypes::c_int; +pub type __kernel_uid32_t = crate::ctypes::c_uint; +pub type __kernel_gid32_t = crate::ctypes::c_uint; +pub type __kernel_old_uid_t = __kernel_uid_t; +pub type __kernel_old_gid_t = __kernel_gid_t; +pub type __kernel_old_dev_t = crate::ctypes::c_uint; +pub type __kernel_size_t = crate::ctypes::c_uint; +pub type __kernel_ssize_t = crate::ctypes::c_int; +pub type __kernel_ptrdiff_t = crate::ctypes::c_int; +pub type __kernel_off_t = __kernel_long_t; +pub type __kernel_loff_t = crate::ctypes::c_longlong; +pub type __kernel_old_time_t = __kernel_long_t; +pub type __kernel_time_t = __kernel_long_t; +pub type __kernel_time64_t = crate::ctypes::c_longlong; +pub type __kernel_clock_t = __kernel_long_t; +pub type __kernel_timer_t = crate::ctypes::c_int; +pub type __kernel_clockid_t = crate::ctypes::c_int; +pub type __kernel_caddr_t = *mut crate::ctypes::c_char; +pub type __kernel_uid16_t = crate::ctypes::c_ushort; +pub type __kernel_gid16_t = crate::ctypes::c_ushort; +pub type __le16 = __u16; +pub type __be16 = __u16; +pub type __le32 = __u32; +pub type __be32 = __u32; +pub type __le64 = __u64; +pub type __be64 = __u64; +pub type __sum16 = __u16; +pub type __wsum = __u32; +pub type __poll_t = crate::ctypes::c_uint; +#[repr(C)] +#[repr(align(16))] +#[derive(Debug, Copy, Clone)] +pub struct __vector128 { +pub u: [__u32; 4usize], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct landlock_ruleset_attr { +pub handled_access_fs: __u64, +pub handled_access_net: __u64, +} +#[repr(C, packed)] +#[derive(Debug, Copy, Clone)] +pub struct landlock_path_beneath_attr { +pub allowed_access: __u64, +pub parent_fd: __s32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct landlock_net_port_attr { +pub allowed_access: __u64, +pub port: __u64, +} +pub const __BITS_PER_LONG_LONG: u32 = 64; +pub const LANDLOCK_CREATE_RULESET_VERSION: u32 = 1; +pub const LANDLOCK_ACCESS_FS_EXECUTE: u32 = 1; +pub const LANDLOCK_ACCESS_FS_WRITE_FILE: u32 = 2; +pub const LANDLOCK_ACCESS_FS_READ_FILE: u32 = 4; +pub const LANDLOCK_ACCESS_FS_READ_DIR: u32 = 8; +pub const LANDLOCK_ACCESS_FS_REMOVE_DIR: u32 = 16; +pub const LANDLOCK_ACCESS_FS_REMOVE_FILE: u32 = 32; +pub const LANDLOCK_ACCESS_FS_MAKE_CHAR: u32 = 64; +pub const LANDLOCK_ACCESS_FS_MAKE_DIR: u32 = 128; +pub const LANDLOCK_ACCESS_FS_MAKE_REG: u32 = 256; +pub const LANDLOCK_ACCESS_FS_MAKE_SOCK: u32 = 512; +pub const LANDLOCK_ACCESS_FS_MAKE_FIFO: u32 = 1024; +pub const LANDLOCK_ACCESS_FS_MAKE_BLOCK: u32 = 2048; +pub const LANDLOCK_ACCESS_FS_MAKE_SYM: u32 = 4096; +pub const LANDLOCK_ACCESS_FS_REFER: u32 = 8192; +pub const LANDLOCK_ACCESS_FS_TRUNCATE: u32 = 16384; +pub const LANDLOCK_ACCESS_FS_IOCTL_DEV: u32 = 32768; +pub const LANDLOCK_ACCESS_NET_BIND_TCP: u32 = 1; +pub const LANDLOCK_ACCESS_NET_CONNECT_TCP: u32 = 2; +#[repr(u32)] +#[non_exhaustive] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub enum landlock_rule_type { +LANDLOCK_RULE_PATH_BENEATH = 1, +LANDLOCK_RULE_NET_PORT = 2, +} diff --git a/src/powerpc64/landlock.rs b/src/powerpc64/landlock.rs new file mode 100644 index 00000000..973204a5 --- /dev/null +++ b/src/powerpc64/landlock.rs @@ -0,0 +1,103 @@ +/* automatically generated by rust-bindgen 0.70.1 */ + +pub type __s8 = crate::ctypes::c_schar; +pub type __u8 = crate::ctypes::c_uchar; +pub type __s16 = crate::ctypes::c_short; +pub type __u16 = crate::ctypes::c_ushort; +pub type __s32 = crate::ctypes::c_int; +pub type __u32 = crate::ctypes::c_uint; +pub type __s64 = crate::ctypes::c_long; +pub type __u64 = crate::ctypes::c_ulong; +pub type __kernel_key_t = crate::ctypes::c_int; +pub type __kernel_mqd_t = crate::ctypes::c_int; +pub type __kernel_old_dev_t = crate::ctypes::c_ulong; +pub type __kernel_long_t = crate::ctypes::c_long; +pub type __kernel_ulong_t = crate::ctypes::c_ulong; +pub type __kernel_ino_t = __kernel_ulong_t; +pub type __kernel_mode_t = crate::ctypes::c_uint; +pub type __kernel_pid_t = crate::ctypes::c_int; +pub type __kernel_ipc_pid_t = crate::ctypes::c_int; +pub type __kernel_uid_t = crate::ctypes::c_uint; +pub type __kernel_gid_t = crate::ctypes::c_uint; +pub type __kernel_suseconds_t = __kernel_long_t; +pub type __kernel_daddr_t = crate::ctypes::c_int; +pub type __kernel_uid32_t = crate::ctypes::c_uint; +pub type __kernel_gid32_t = crate::ctypes::c_uint; +pub type __kernel_old_uid_t = __kernel_uid_t; +pub type __kernel_old_gid_t = __kernel_gid_t; +pub type __kernel_size_t = __kernel_ulong_t; +pub type __kernel_ssize_t = __kernel_long_t; +pub type __kernel_ptrdiff_t = __kernel_long_t; +pub type __kernel_off_t = __kernel_long_t; +pub type __kernel_loff_t = crate::ctypes::c_longlong; +pub type __kernel_old_time_t = __kernel_long_t; +pub type __kernel_time_t = __kernel_long_t; +pub type __kernel_time64_t = crate::ctypes::c_longlong; +pub type __kernel_clock_t = __kernel_long_t; +pub type __kernel_timer_t = crate::ctypes::c_int; +pub type __kernel_clockid_t = crate::ctypes::c_int; +pub type __kernel_caddr_t = *mut crate::ctypes::c_char; +pub type __kernel_uid16_t = crate::ctypes::c_ushort; +pub type __kernel_gid16_t = crate::ctypes::c_ushort; +pub type __s128 = i128; +pub type __u128 = u128; +pub type __le16 = __u16; +pub type __be16 = __u16; +pub type __le32 = __u32; +pub type __be32 = __u32; +pub type __le64 = __u64; +pub type __be64 = __u64; +pub type __sum16 = __u16; +pub type __wsum = __u32; +pub type __poll_t = crate::ctypes::c_uint; +#[repr(C)] +#[repr(align(16))] +#[derive(Debug, Copy, Clone)] +pub struct __vector128 { +pub u: [__u32; 4usize], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct landlock_ruleset_attr { +pub handled_access_fs: __u64, +pub handled_access_net: __u64, +} +#[repr(C, packed)] +#[derive(Debug, Copy, Clone)] +pub struct landlock_path_beneath_attr { +pub allowed_access: __u64, +pub parent_fd: __s32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct landlock_net_port_attr { +pub allowed_access: __u64, +pub port: __u64, +} +pub const __BITS_PER_LONG_LONG: u32 = 64; +pub const LANDLOCK_CREATE_RULESET_VERSION: u32 = 1; +pub const LANDLOCK_ACCESS_FS_EXECUTE: u32 = 1; +pub const LANDLOCK_ACCESS_FS_WRITE_FILE: u32 = 2; +pub const LANDLOCK_ACCESS_FS_READ_FILE: u32 = 4; +pub const LANDLOCK_ACCESS_FS_READ_DIR: u32 = 8; +pub const LANDLOCK_ACCESS_FS_REMOVE_DIR: u32 = 16; +pub const LANDLOCK_ACCESS_FS_REMOVE_FILE: u32 = 32; +pub const LANDLOCK_ACCESS_FS_MAKE_CHAR: u32 = 64; +pub const LANDLOCK_ACCESS_FS_MAKE_DIR: u32 = 128; +pub const LANDLOCK_ACCESS_FS_MAKE_REG: u32 = 256; +pub const LANDLOCK_ACCESS_FS_MAKE_SOCK: u32 = 512; +pub const LANDLOCK_ACCESS_FS_MAKE_FIFO: u32 = 1024; +pub const LANDLOCK_ACCESS_FS_MAKE_BLOCK: u32 = 2048; +pub const LANDLOCK_ACCESS_FS_MAKE_SYM: u32 = 4096; +pub const LANDLOCK_ACCESS_FS_REFER: u32 = 8192; +pub const LANDLOCK_ACCESS_FS_TRUNCATE: u32 = 16384; +pub const LANDLOCK_ACCESS_FS_IOCTL_DEV: u32 = 32768; +pub const LANDLOCK_ACCESS_NET_BIND_TCP: u32 = 1; +pub const LANDLOCK_ACCESS_NET_CONNECT_TCP: u32 = 2; +#[repr(u32)] +#[non_exhaustive] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub enum landlock_rule_type { +LANDLOCK_RULE_PATH_BENEATH = 1, +LANDLOCK_RULE_NET_PORT = 2, +} diff --git a/src/riscv32/landlock.rs b/src/riscv32/landlock.rs new file mode 100644 index 00000000..48f0ddcf --- /dev/null +++ b/src/riscv32/landlock.rs @@ -0,0 +1,95 @@ +/* automatically generated by rust-bindgen 0.70.1 */ + +pub type __s8 = crate::ctypes::c_schar; +pub type __u8 = crate::ctypes::c_uchar; +pub type __s16 = crate::ctypes::c_short; +pub type __u16 = crate::ctypes::c_ushort; +pub type __s32 = crate::ctypes::c_int; +pub type __u32 = crate::ctypes::c_uint; +pub type __s64 = crate::ctypes::c_longlong; +pub type __u64 = crate::ctypes::c_ulonglong; +pub type __kernel_key_t = crate::ctypes::c_int; +pub type __kernel_mqd_t = crate::ctypes::c_int; +pub type __kernel_long_t = crate::ctypes::c_long; +pub type __kernel_ulong_t = crate::ctypes::c_ulong; +pub type __kernel_ino_t = __kernel_ulong_t; +pub type __kernel_mode_t = crate::ctypes::c_uint; +pub type __kernel_pid_t = crate::ctypes::c_int; +pub type __kernel_ipc_pid_t = crate::ctypes::c_int; +pub type __kernel_uid_t = crate::ctypes::c_uint; +pub type __kernel_gid_t = crate::ctypes::c_uint; +pub type __kernel_suseconds_t = __kernel_long_t; +pub type __kernel_daddr_t = crate::ctypes::c_int; +pub type __kernel_uid32_t = crate::ctypes::c_uint; +pub type __kernel_gid32_t = crate::ctypes::c_uint; +pub type __kernel_old_uid_t = __kernel_uid_t; +pub type __kernel_old_gid_t = __kernel_gid_t; +pub type __kernel_old_dev_t = crate::ctypes::c_uint; +pub type __kernel_size_t = crate::ctypes::c_uint; +pub type __kernel_ssize_t = crate::ctypes::c_int; +pub type __kernel_ptrdiff_t = crate::ctypes::c_int; +pub type __kernel_off_t = __kernel_long_t; +pub type __kernel_loff_t = crate::ctypes::c_longlong; +pub type __kernel_old_time_t = __kernel_long_t; +pub type __kernel_time_t = __kernel_long_t; +pub type __kernel_time64_t = crate::ctypes::c_longlong; +pub type __kernel_clock_t = __kernel_long_t; +pub type __kernel_timer_t = crate::ctypes::c_int; +pub type __kernel_clockid_t = crate::ctypes::c_int; +pub type __kernel_caddr_t = *mut crate::ctypes::c_char; +pub type __kernel_uid16_t = crate::ctypes::c_ushort; +pub type __kernel_gid16_t = crate::ctypes::c_ushort; +pub type __le16 = __u16; +pub type __be16 = __u16; +pub type __le32 = __u32; +pub type __be32 = __u32; +pub type __le64 = __u64; +pub type __be64 = __u64; +pub type __sum16 = __u16; +pub type __wsum = __u32; +pub type __poll_t = crate::ctypes::c_uint; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct landlock_ruleset_attr { +pub handled_access_fs: __u64, +pub handled_access_net: __u64, +} +#[repr(C, packed)] +#[derive(Debug, Copy, Clone)] +pub struct landlock_path_beneath_attr { +pub allowed_access: __u64, +pub parent_fd: __s32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct landlock_net_port_attr { +pub allowed_access: __u64, +pub port: __u64, +} +pub const __BITS_PER_LONG_LONG: u32 = 64; +pub const LANDLOCK_CREATE_RULESET_VERSION: u32 = 1; +pub const LANDLOCK_ACCESS_FS_EXECUTE: u32 = 1; +pub const LANDLOCK_ACCESS_FS_WRITE_FILE: u32 = 2; +pub const LANDLOCK_ACCESS_FS_READ_FILE: u32 = 4; +pub const LANDLOCK_ACCESS_FS_READ_DIR: u32 = 8; +pub const LANDLOCK_ACCESS_FS_REMOVE_DIR: u32 = 16; +pub const LANDLOCK_ACCESS_FS_REMOVE_FILE: u32 = 32; +pub const LANDLOCK_ACCESS_FS_MAKE_CHAR: u32 = 64; +pub const LANDLOCK_ACCESS_FS_MAKE_DIR: u32 = 128; +pub const LANDLOCK_ACCESS_FS_MAKE_REG: u32 = 256; +pub const LANDLOCK_ACCESS_FS_MAKE_SOCK: u32 = 512; +pub const LANDLOCK_ACCESS_FS_MAKE_FIFO: u32 = 1024; +pub const LANDLOCK_ACCESS_FS_MAKE_BLOCK: u32 = 2048; +pub const LANDLOCK_ACCESS_FS_MAKE_SYM: u32 = 4096; +pub const LANDLOCK_ACCESS_FS_REFER: u32 = 8192; +pub const LANDLOCK_ACCESS_FS_TRUNCATE: u32 = 16384; +pub const LANDLOCK_ACCESS_FS_IOCTL_DEV: u32 = 32768; +pub const LANDLOCK_ACCESS_NET_BIND_TCP: u32 = 1; +pub const LANDLOCK_ACCESS_NET_CONNECT_TCP: u32 = 2; +#[repr(u32)] +#[non_exhaustive] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub enum landlock_rule_type { +LANDLOCK_RULE_PATH_BENEATH = 1, +LANDLOCK_RULE_NET_PORT = 2, +} diff --git a/src/riscv64/landlock.rs b/src/riscv64/landlock.rs new file mode 100644 index 00000000..1857c9f1 --- /dev/null +++ b/src/riscv64/landlock.rs @@ -0,0 +1,97 @@ +/* automatically generated by rust-bindgen 0.70.1 */ + +pub type __s8 = crate::ctypes::c_schar; +pub type __u8 = crate::ctypes::c_uchar; +pub type __s16 = crate::ctypes::c_short; +pub type __u16 = crate::ctypes::c_ushort; +pub type __s32 = crate::ctypes::c_int; +pub type __u32 = crate::ctypes::c_uint; +pub type __s64 = crate::ctypes::c_longlong; +pub type __u64 = crate::ctypes::c_ulonglong; +pub type __kernel_key_t = crate::ctypes::c_int; +pub type __kernel_mqd_t = crate::ctypes::c_int; +pub type __kernel_long_t = crate::ctypes::c_long; +pub type __kernel_ulong_t = crate::ctypes::c_ulong; +pub type __kernel_ino_t = __kernel_ulong_t; +pub type __kernel_mode_t = crate::ctypes::c_uint; +pub type __kernel_pid_t = crate::ctypes::c_int; +pub type __kernel_ipc_pid_t = crate::ctypes::c_int; +pub type __kernel_uid_t = crate::ctypes::c_uint; +pub type __kernel_gid_t = crate::ctypes::c_uint; +pub type __kernel_suseconds_t = __kernel_long_t; +pub type __kernel_daddr_t = crate::ctypes::c_int; +pub type __kernel_uid32_t = crate::ctypes::c_uint; +pub type __kernel_gid32_t = crate::ctypes::c_uint; +pub type __kernel_old_uid_t = __kernel_uid_t; +pub type __kernel_old_gid_t = __kernel_gid_t; +pub type __kernel_old_dev_t = crate::ctypes::c_uint; +pub type __kernel_size_t = __kernel_ulong_t; +pub type __kernel_ssize_t = __kernel_long_t; +pub type __kernel_ptrdiff_t = __kernel_long_t; +pub type __kernel_off_t = __kernel_long_t; +pub type __kernel_loff_t = crate::ctypes::c_longlong; +pub type __kernel_old_time_t = __kernel_long_t; +pub type __kernel_time_t = __kernel_long_t; +pub type __kernel_time64_t = crate::ctypes::c_longlong; +pub type __kernel_clock_t = __kernel_long_t; +pub type __kernel_timer_t = crate::ctypes::c_int; +pub type __kernel_clockid_t = crate::ctypes::c_int; +pub type __kernel_caddr_t = *mut crate::ctypes::c_char; +pub type __kernel_uid16_t = crate::ctypes::c_ushort; +pub type __kernel_gid16_t = crate::ctypes::c_ushort; +pub type __s128 = i128; +pub type __u128 = u128; +pub type __le16 = __u16; +pub type __be16 = __u16; +pub type __le32 = __u32; +pub type __be32 = __u32; +pub type __le64 = __u64; +pub type __be64 = __u64; +pub type __sum16 = __u16; +pub type __wsum = __u32; +pub type __poll_t = crate::ctypes::c_uint; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct landlock_ruleset_attr { +pub handled_access_fs: __u64, +pub handled_access_net: __u64, +} +#[repr(C, packed)] +#[derive(Debug, Copy, Clone)] +pub struct landlock_path_beneath_attr { +pub allowed_access: __u64, +pub parent_fd: __s32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct landlock_net_port_attr { +pub allowed_access: __u64, +pub port: __u64, +} +pub const __BITS_PER_LONG_LONG: u32 = 64; +pub const LANDLOCK_CREATE_RULESET_VERSION: u32 = 1; +pub const LANDLOCK_ACCESS_FS_EXECUTE: u32 = 1; +pub const LANDLOCK_ACCESS_FS_WRITE_FILE: u32 = 2; +pub const LANDLOCK_ACCESS_FS_READ_FILE: u32 = 4; +pub const LANDLOCK_ACCESS_FS_READ_DIR: u32 = 8; +pub const LANDLOCK_ACCESS_FS_REMOVE_DIR: u32 = 16; +pub const LANDLOCK_ACCESS_FS_REMOVE_FILE: u32 = 32; +pub const LANDLOCK_ACCESS_FS_MAKE_CHAR: u32 = 64; +pub const LANDLOCK_ACCESS_FS_MAKE_DIR: u32 = 128; +pub const LANDLOCK_ACCESS_FS_MAKE_REG: u32 = 256; +pub const LANDLOCK_ACCESS_FS_MAKE_SOCK: u32 = 512; +pub const LANDLOCK_ACCESS_FS_MAKE_FIFO: u32 = 1024; +pub const LANDLOCK_ACCESS_FS_MAKE_BLOCK: u32 = 2048; +pub const LANDLOCK_ACCESS_FS_MAKE_SYM: u32 = 4096; +pub const LANDLOCK_ACCESS_FS_REFER: u32 = 8192; +pub const LANDLOCK_ACCESS_FS_TRUNCATE: u32 = 16384; +pub const LANDLOCK_ACCESS_FS_IOCTL_DEV: u32 = 32768; +pub const LANDLOCK_ACCESS_NET_BIND_TCP: u32 = 1; +pub const LANDLOCK_ACCESS_NET_CONNECT_TCP: u32 = 2; +#[repr(u32)] +#[non_exhaustive] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub enum landlock_rule_type { +LANDLOCK_RULE_PATH_BENEATH = 1, +LANDLOCK_RULE_NET_PORT = 2, +} diff --git a/src/s390x/landlock.rs b/src/s390x/landlock.rs new file mode 100644 index 00000000..1ed1c110 --- /dev/null +++ b/src/s390x/landlock.rs @@ -0,0 +1,117 @@ +/* automatically generated by rust-bindgen 0.70.1 */ + +pub type __s8 = crate::ctypes::c_schar; +pub type __u8 = crate::ctypes::c_uchar; +pub type __s16 = crate::ctypes::c_short; +pub type __u16 = crate::ctypes::c_ushort; +pub type __s32 = crate::ctypes::c_int; +pub type __u32 = crate::ctypes::c_uint; +pub type __s64 = crate::ctypes::c_longlong; +pub type __u64 = crate::ctypes::c_ulonglong; +pub type addr_t = crate::ctypes::c_ulong; +pub type saddr_t = crate::ctypes::c_long; +pub type __kernel_key_t = crate::ctypes::c_int; +pub type __kernel_mqd_t = crate::ctypes::c_int; +pub type __kernel_size_t = crate::ctypes::c_ulong; +pub type __kernel_ssize_t = crate::ctypes::c_long; +pub type __kernel_old_dev_t = crate::ctypes::c_ushort; +pub type __kernel_ino_t = crate::ctypes::c_uint; +pub type __kernel_mode_t = crate::ctypes::c_uint; +pub type __kernel_ipc_pid_t = crate::ctypes::c_int; +pub type __kernel_uid_t = crate::ctypes::c_uint; +pub type __kernel_gid_t = crate::ctypes::c_uint; +pub type __kernel_ptrdiff_t = crate::ctypes::c_long; +pub type __kernel_sigset_t = crate::ctypes::c_ulong; +pub type __kernel_long_t = crate::ctypes::c_long; +pub type __kernel_ulong_t = crate::ctypes::c_ulong; +pub type __kernel_pid_t = crate::ctypes::c_int; +pub type __kernel_suseconds_t = __kernel_long_t; +pub type __kernel_daddr_t = crate::ctypes::c_int; +pub type __kernel_uid32_t = crate::ctypes::c_uint; +pub type __kernel_gid32_t = crate::ctypes::c_uint; +pub type __kernel_old_uid_t = __kernel_uid_t; +pub type __kernel_old_gid_t = __kernel_gid_t; +pub type __kernel_off_t = __kernel_long_t; +pub type __kernel_loff_t = crate::ctypes::c_longlong; +pub type __kernel_old_time_t = __kernel_long_t; +pub type __kernel_time_t = __kernel_long_t; +pub type __kernel_time64_t = crate::ctypes::c_longlong; +pub type __kernel_clock_t = __kernel_long_t; +pub type __kernel_timer_t = crate::ctypes::c_int; +pub type __kernel_clockid_t = crate::ctypes::c_int; +pub type __kernel_caddr_t = *mut crate::ctypes::c_char; +pub type __kernel_uid16_t = crate::ctypes::c_ushort; +pub type __kernel_gid16_t = crate::ctypes::c_ushort; +pub type __s128 = i128; +pub type __u128 = u128; +pub type __le16 = __u16; +pub type __be16 = __u16; +pub type __le32 = __u32; +pub type __be32 = __u32; +pub type __le64 = __u64; +pub type __be64 = __u64; +pub type __sum16 = __u16; +pub type __wsum = __u32; +pub type __poll_t = crate::ctypes::c_uint; +#[repr(C, packed(4))] +#[derive(Copy, Clone)] +pub struct __vector128 { +pub __bindgen_anon_1: __vector128__bindgen_ty_1, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct __vector128__bindgen_ty_1__bindgen_ty_1 { +pub high: __u64, +pub low: __u64, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct landlock_ruleset_attr { +pub handled_access_fs: __u64, +pub handled_access_net: __u64, +} +#[repr(C, packed)] +#[derive(Debug, Copy, Clone)] +pub struct landlock_path_beneath_attr { +pub allowed_access: __u64, +pub parent_fd: __s32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct landlock_net_port_attr { +pub allowed_access: __u64, +pub port: __u64, +} +pub const __BITS_PER_LONG_LONG: u32 = 64; +pub const LANDLOCK_CREATE_RULESET_VERSION: u32 = 1; +pub const LANDLOCK_ACCESS_FS_EXECUTE: u32 = 1; +pub const LANDLOCK_ACCESS_FS_WRITE_FILE: u32 = 2; +pub const LANDLOCK_ACCESS_FS_READ_FILE: u32 = 4; +pub const LANDLOCK_ACCESS_FS_READ_DIR: u32 = 8; +pub const LANDLOCK_ACCESS_FS_REMOVE_DIR: u32 = 16; +pub const LANDLOCK_ACCESS_FS_REMOVE_FILE: u32 = 32; +pub const LANDLOCK_ACCESS_FS_MAKE_CHAR: u32 = 64; +pub const LANDLOCK_ACCESS_FS_MAKE_DIR: u32 = 128; +pub const LANDLOCK_ACCESS_FS_MAKE_REG: u32 = 256; +pub const LANDLOCK_ACCESS_FS_MAKE_SOCK: u32 = 512; +pub const LANDLOCK_ACCESS_FS_MAKE_FIFO: u32 = 1024; +pub const LANDLOCK_ACCESS_FS_MAKE_BLOCK: u32 = 2048; +pub const LANDLOCK_ACCESS_FS_MAKE_SYM: u32 = 4096; +pub const LANDLOCK_ACCESS_FS_REFER: u32 = 8192; +pub const LANDLOCK_ACCESS_FS_TRUNCATE: u32 = 16384; +pub const LANDLOCK_ACCESS_FS_IOCTL_DEV: u32 = 32768; +pub const LANDLOCK_ACCESS_NET_BIND_TCP: u32 = 1; +pub const LANDLOCK_ACCESS_NET_CONNECT_TCP: u32 = 2; +#[repr(u32)] +#[non_exhaustive] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub enum landlock_rule_type { +LANDLOCK_RULE_PATH_BENEATH = 1, +LANDLOCK_RULE_NET_PORT = 2, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union __vector128__bindgen_ty_1 { +pub __bindgen_anon_1: __vector128__bindgen_ty_1__bindgen_ty_1, +pub u: [__u32; 4usize], +} diff --git a/src/sparc/landlock.rs b/src/sparc/landlock.rs new file mode 100644 index 00000000..fb18eef3 --- /dev/null +++ b/src/sparc/landlock.rs @@ -0,0 +1,95 @@ +/* automatically generated by rust-bindgen 0.70.1 */ + +pub type __s8 = crate::ctypes::c_schar; +pub type __u8 = crate::ctypes::c_uchar; +pub type __s16 = crate::ctypes::c_short; +pub type __u16 = crate::ctypes::c_ushort; +pub type __s32 = crate::ctypes::c_int; +pub type __u32 = crate::ctypes::c_uint; +pub type __s64 = crate::ctypes::c_longlong; +pub type __u64 = crate::ctypes::c_ulonglong; +pub type __kernel_key_t = crate::ctypes::c_int; +pub type __kernel_mqd_t = crate::ctypes::c_int; +pub type __kernel_size_t = crate::ctypes::c_uint; +pub type __kernel_ssize_t = crate::ctypes::c_int; +pub type __kernel_ptrdiff_t = crate::ctypes::c_long; +pub type __kernel_ipc_pid_t = crate::ctypes::c_ushort; +pub type __kernel_uid_t = crate::ctypes::c_ushort; +pub type __kernel_gid_t = crate::ctypes::c_ushort; +pub type __kernel_mode_t = crate::ctypes::c_ushort; +pub type __kernel_daddr_t = crate::ctypes::c_long; +pub type __kernel_old_dev_t = crate::ctypes::c_ushort; +pub type __kernel_long_t = crate::ctypes::c_long; +pub type __kernel_ulong_t = crate::ctypes::c_ulong; +pub type __kernel_ino_t = __kernel_ulong_t; +pub type __kernel_pid_t = crate::ctypes::c_int; +pub type __kernel_suseconds_t = __kernel_long_t; +pub type __kernel_uid32_t = crate::ctypes::c_uint; +pub type __kernel_gid32_t = crate::ctypes::c_uint; +pub type __kernel_old_uid_t = __kernel_uid_t; +pub type __kernel_old_gid_t = __kernel_gid_t; +pub type __kernel_off_t = __kernel_long_t; +pub type __kernel_loff_t = crate::ctypes::c_longlong; +pub type __kernel_old_time_t = __kernel_long_t; +pub type __kernel_time_t = __kernel_long_t; +pub type __kernel_time64_t = crate::ctypes::c_longlong; +pub type __kernel_clock_t = __kernel_long_t; +pub type __kernel_timer_t = crate::ctypes::c_int; +pub type __kernel_clockid_t = crate::ctypes::c_int; +pub type __kernel_caddr_t = *mut crate::ctypes::c_char; +pub type __kernel_uid16_t = crate::ctypes::c_ushort; +pub type __kernel_gid16_t = crate::ctypes::c_ushort; +pub type __le16 = __u16; +pub type __be16 = __u16; +pub type __le32 = __u32; +pub type __be32 = __u32; +pub type __le64 = __u64; +pub type __be64 = __u64; +pub type __sum16 = __u16; +pub type __wsum = __u32; +pub type __poll_t = crate::ctypes::c_uint; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct landlock_ruleset_attr { +pub handled_access_fs: __u64, +pub handled_access_net: __u64, +} +#[repr(C, packed)] +#[derive(Debug, Copy, Clone)] +pub struct landlock_path_beneath_attr { +pub allowed_access: __u64, +pub parent_fd: __s32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct landlock_net_port_attr { +pub allowed_access: __u64, +pub port: __u64, +} +pub const __BITS_PER_LONG_LONG: u32 = 64; +pub const LANDLOCK_CREATE_RULESET_VERSION: u32 = 1; +pub const LANDLOCK_ACCESS_FS_EXECUTE: u32 = 1; +pub const LANDLOCK_ACCESS_FS_WRITE_FILE: u32 = 2; +pub const LANDLOCK_ACCESS_FS_READ_FILE: u32 = 4; +pub const LANDLOCK_ACCESS_FS_READ_DIR: u32 = 8; +pub const LANDLOCK_ACCESS_FS_REMOVE_DIR: u32 = 16; +pub const LANDLOCK_ACCESS_FS_REMOVE_FILE: u32 = 32; +pub const LANDLOCK_ACCESS_FS_MAKE_CHAR: u32 = 64; +pub const LANDLOCK_ACCESS_FS_MAKE_DIR: u32 = 128; +pub const LANDLOCK_ACCESS_FS_MAKE_REG: u32 = 256; +pub const LANDLOCK_ACCESS_FS_MAKE_SOCK: u32 = 512; +pub const LANDLOCK_ACCESS_FS_MAKE_FIFO: u32 = 1024; +pub const LANDLOCK_ACCESS_FS_MAKE_BLOCK: u32 = 2048; +pub const LANDLOCK_ACCESS_FS_MAKE_SYM: u32 = 4096; +pub const LANDLOCK_ACCESS_FS_REFER: u32 = 8192; +pub const LANDLOCK_ACCESS_FS_TRUNCATE: u32 = 16384; +pub const LANDLOCK_ACCESS_FS_IOCTL_DEV: u32 = 32768; +pub const LANDLOCK_ACCESS_NET_BIND_TCP: u32 = 1; +pub const LANDLOCK_ACCESS_NET_CONNECT_TCP: u32 = 2; +#[repr(u32)] +#[non_exhaustive] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub enum landlock_rule_type { +LANDLOCK_RULE_PATH_BENEATH = 1, +LANDLOCK_RULE_NET_PORT = 2, +} diff --git a/src/sparc64/landlock.rs b/src/sparc64/landlock.rs new file mode 100644 index 00000000..b1240976 --- /dev/null +++ b/src/sparc64/landlock.rs @@ -0,0 +1,103 @@ +/* automatically generated by rust-bindgen 0.70.1 */ + +pub type __s8 = crate::ctypes::c_schar; +pub type __u8 = crate::ctypes::c_uchar; +pub type __s16 = crate::ctypes::c_short; +pub type __u16 = crate::ctypes::c_ushort; +pub type __s32 = crate::ctypes::c_int; +pub type __u32 = crate::ctypes::c_uint; +pub type __s64 = crate::ctypes::c_longlong; +pub type __u64 = crate::ctypes::c_ulonglong; +pub type __kernel_key_t = crate::ctypes::c_int; +pub type __kernel_mqd_t = crate::ctypes::c_int; +pub type __kernel_old_uid_t = crate::ctypes::c_ushort; +pub type __kernel_old_gid_t = crate::ctypes::c_ushort; +pub type __kernel_suseconds_t = crate::ctypes::c_int; +pub type __kernel_long_t = crate::ctypes::c_long; +pub type __kernel_ulong_t = crate::ctypes::c_ulong; +pub type __kernel_ino_t = __kernel_ulong_t; +pub type __kernel_mode_t = crate::ctypes::c_uint; +pub type __kernel_pid_t = crate::ctypes::c_int; +pub type __kernel_ipc_pid_t = crate::ctypes::c_int; +pub type __kernel_uid_t = crate::ctypes::c_uint; +pub type __kernel_gid_t = crate::ctypes::c_uint; +pub type __kernel_daddr_t = crate::ctypes::c_int; +pub type __kernel_uid32_t = crate::ctypes::c_uint; +pub type __kernel_gid32_t = crate::ctypes::c_uint; +pub type __kernel_old_dev_t = crate::ctypes::c_uint; +pub type __kernel_size_t = __kernel_ulong_t; +pub type __kernel_ssize_t = __kernel_long_t; +pub type __kernel_ptrdiff_t = __kernel_long_t; +pub type __kernel_off_t = __kernel_long_t; +pub type __kernel_loff_t = crate::ctypes::c_longlong; +pub type __kernel_old_time_t = __kernel_long_t; +pub type __kernel_time_t = __kernel_long_t; +pub type __kernel_time64_t = crate::ctypes::c_longlong; +pub type __kernel_clock_t = __kernel_long_t; +pub type __kernel_timer_t = crate::ctypes::c_int; +pub type __kernel_clockid_t = crate::ctypes::c_int; +pub type __kernel_caddr_t = *mut crate::ctypes::c_char; +pub type __kernel_uid16_t = crate::ctypes::c_ushort; +pub type __kernel_gid16_t = crate::ctypes::c_ushort; +pub type __s128 = i128; +pub type __u128 = u128; +pub type __le16 = __u16; +pub type __be16 = __u16; +pub type __le32 = __u32; +pub type __be32 = __u32; +pub type __le64 = __u64; +pub type __be64 = __u64; +pub type __sum16 = __u16; +pub type __wsum = __u32; +pub type __poll_t = crate::ctypes::c_uint; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct __kernel_old_timeval { +pub tv_sec: __kernel_long_t, +pub tv_usec: __kernel_suseconds_t, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct landlock_ruleset_attr { +pub handled_access_fs: __u64, +pub handled_access_net: __u64, +} +#[repr(C, packed)] +#[derive(Debug, Copy, Clone)] +pub struct landlock_path_beneath_attr { +pub allowed_access: __u64, +pub parent_fd: __s32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct landlock_net_port_attr { +pub allowed_access: __u64, +pub port: __u64, +} +pub const __BITS_PER_LONG_LONG: u32 = 64; +pub const LANDLOCK_CREATE_RULESET_VERSION: u32 = 1; +pub const LANDLOCK_ACCESS_FS_EXECUTE: u32 = 1; +pub const LANDLOCK_ACCESS_FS_WRITE_FILE: u32 = 2; +pub const LANDLOCK_ACCESS_FS_READ_FILE: u32 = 4; +pub const LANDLOCK_ACCESS_FS_READ_DIR: u32 = 8; +pub const LANDLOCK_ACCESS_FS_REMOVE_DIR: u32 = 16; +pub const LANDLOCK_ACCESS_FS_REMOVE_FILE: u32 = 32; +pub const LANDLOCK_ACCESS_FS_MAKE_CHAR: u32 = 64; +pub const LANDLOCK_ACCESS_FS_MAKE_DIR: u32 = 128; +pub const LANDLOCK_ACCESS_FS_MAKE_REG: u32 = 256; +pub const LANDLOCK_ACCESS_FS_MAKE_SOCK: u32 = 512; +pub const LANDLOCK_ACCESS_FS_MAKE_FIFO: u32 = 1024; +pub const LANDLOCK_ACCESS_FS_MAKE_BLOCK: u32 = 2048; +pub const LANDLOCK_ACCESS_FS_MAKE_SYM: u32 = 4096; +pub const LANDLOCK_ACCESS_FS_REFER: u32 = 8192; +pub const LANDLOCK_ACCESS_FS_TRUNCATE: u32 = 16384; +pub const LANDLOCK_ACCESS_FS_IOCTL_DEV: u32 = 32768; +pub const LANDLOCK_ACCESS_NET_BIND_TCP: u32 = 1; +pub const LANDLOCK_ACCESS_NET_CONNECT_TCP: u32 = 2; +#[repr(u32)] +#[non_exhaustive] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub enum landlock_rule_type { +LANDLOCK_RULE_PATH_BENEATH = 1, +LANDLOCK_RULE_NET_PORT = 2, +} diff --git a/src/x32/landlock.rs b/src/x32/landlock.rs new file mode 100644 index 00000000..62b136b7 --- /dev/null +++ b/src/x32/landlock.rs @@ -0,0 +1,97 @@ +/* automatically generated by rust-bindgen 0.70.1 */ + +pub type __s8 = crate::ctypes::c_schar; +pub type __u8 = crate::ctypes::c_uchar; +pub type __s16 = crate::ctypes::c_short; +pub type __u16 = crate::ctypes::c_ushort; +pub type __s32 = crate::ctypes::c_int; +pub type __u32 = crate::ctypes::c_uint; +pub type __s64 = crate::ctypes::c_longlong; +pub type __u64 = crate::ctypes::c_ulonglong; +pub type __kernel_key_t = crate::ctypes::c_int; +pub type __kernel_mqd_t = crate::ctypes::c_int; +pub type __kernel_long_t = crate::ctypes::c_longlong; +pub type __kernel_ulong_t = crate::ctypes::c_ulonglong; +pub type __kernel_old_uid_t = crate::ctypes::c_ushort; +pub type __kernel_old_gid_t = crate::ctypes::c_ushort; +pub type __kernel_old_dev_t = crate::ctypes::c_ulong; +pub type __kernel_ino_t = __kernel_ulong_t; +pub type __kernel_mode_t = crate::ctypes::c_uint; +pub type __kernel_pid_t = crate::ctypes::c_int; +pub type __kernel_ipc_pid_t = crate::ctypes::c_int; +pub type __kernel_uid_t = crate::ctypes::c_uint; +pub type __kernel_gid_t = crate::ctypes::c_uint; +pub type __kernel_suseconds_t = __kernel_long_t; +pub type __kernel_daddr_t = crate::ctypes::c_int; +pub type __kernel_uid32_t = crate::ctypes::c_uint; +pub type __kernel_gid32_t = crate::ctypes::c_uint; +pub type __kernel_size_t = crate::ctypes::c_uint; +pub type __kernel_ssize_t = crate::ctypes::c_int; +pub type __kernel_ptrdiff_t = crate::ctypes::c_int; +pub type __kernel_off_t = __kernel_long_t; +pub type __kernel_loff_t = crate::ctypes::c_longlong; +pub type __kernel_old_time_t = __kernel_long_t; +pub type __kernel_time_t = __kernel_long_t; +pub type __kernel_time64_t = crate::ctypes::c_longlong; +pub type __kernel_clock_t = __kernel_long_t; +pub type __kernel_timer_t = crate::ctypes::c_int; +pub type __kernel_clockid_t = crate::ctypes::c_int; +pub type __kernel_caddr_t = *mut crate::ctypes::c_char; +pub type __kernel_uid16_t = crate::ctypes::c_ushort; +pub type __kernel_gid16_t = crate::ctypes::c_ushort; +pub type __s128 = i128; +pub type __u128 = u128; +pub type __le16 = __u16; +pub type __be16 = __u16; +pub type __le32 = __u32; +pub type __be32 = __u32; +pub type __le64 = __u64; +pub type __be64 = __u64; +pub type __sum16 = __u16; +pub type __wsum = __u32; +pub type __poll_t = crate::ctypes::c_uint; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct landlock_ruleset_attr { +pub handled_access_fs: __u64, +pub handled_access_net: __u64, +} +#[repr(C, packed)] +#[derive(Debug, Copy, Clone)] +pub struct landlock_path_beneath_attr { +pub allowed_access: __u64, +pub parent_fd: __s32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct landlock_net_port_attr { +pub allowed_access: __u64, +pub port: __u64, +} +pub const __BITS_PER_LONG_LONG: u32 = 64; +pub const LANDLOCK_CREATE_RULESET_VERSION: u32 = 1; +pub const LANDLOCK_ACCESS_FS_EXECUTE: u32 = 1; +pub const LANDLOCK_ACCESS_FS_WRITE_FILE: u32 = 2; +pub const LANDLOCK_ACCESS_FS_READ_FILE: u32 = 4; +pub const LANDLOCK_ACCESS_FS_READ_DIR: u32 = 8; +pub const LANDLOCK_ACCESS_FS_REMOVE_DIR: u32 = 16; +pub const LANDLOCK_ACCESS_FS_REMOVE_FILE: u32 = 32; +pub const LANDLOCK_ACCESS_FS_MAKE_CHAR: u32 = 64; +pub const LANDLOCK_ACCESS_FS_MAKE_DIR: u32 = 128; +pub const LANDLOCK_ACCESS_FS_MAKE_REG: u32 = 256; +pub const LANDLOCK_ACCESS_FS_MAKE_SOCK: u32 = 512; +pub const LANDLOCK_ACCESS_FS_MAKE_FIFO: u32 = 1024; +pub const LANDLOCK_ACCESS_FS_MAKE_BLOCK: u32 = 2048; +pub const LANDLOCK_ACCESS_FS_MAKE_SYM: u32 = 4096; +pub const LANDLOCK_ACCESS_FS_REFER: u32 = 8192; +pub const LANDLOCK_ACCESS_FS_TRUNCATE: u32 = 16384; +pub const LANDLOCK_ACCESS_FS_IOCTL_DEV: u32 = 32768; +pub const LANDLOCK_ACCESS_NET_BIND_TCP: u32 = 1; +pub const LANDLOCK_ACCESS_NET_CONNECT_TCP: u32 = 2; +#[repr(u32)] +#[non_exhaustive] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub enum landlock_rule_type { +LANDLOCK_RULE_PATH_BENEATH = 1, +LANDLOCK_RULE_NET_PORT = 2, +} diff --git a/src/x86/landlock.rs b/src/x86/landlock.rs new file mode 100644 index 00000000..a713cbe9 --- /dev/null +++ b/src/x86/landlock.rs @@ -0,0 +1,95 @@ +/* automatically generated by rust-bindgen 0.70.1 */ + +pub type __s8 = crate::ctypes::c_schar; +pub type __u8 = crate::ctypes::c_uchar; +pub type __s16 = crate::ctypes::c_short; +pub type __u16 = crate::ctypes::c_ushort; +pub type __s32 = crate::ctypes::c_int; +pub type __u32 = crate::ctypes::c_uint; +pub type __s64 = crate::ctypes::c_longlong; +pub type __u64 = crate::ctypes::c_ulonglong; +pub type __kernel_key_t = crate::ctypes::c_int; +pub type __kernel_mqd_t = crate::ctypes::c_int; +pub type __kernel_mode_t = crate::ctypes::c_ushort; +pub type __kernel_ipc_pid_t = crate::ctypes::c_ushort; +pub type __kernel_uid_t = crate::ctypes::c_ushort; +pub type __kernel_gid_t = crate::ctypes::c_ushort; +pub type __kernel_old_dev_t = crate::ctypes::c_ushort; +pub type __kernel_long_t = crate::ctypes::c_long; +pub type __kernel_ulong_t = crate::ctypes::c_ulong; +pub type __kernel_ino_t = __kernel_ulong_t; +pub type __kernel_pid_t = crate::ctypes::c_int; +pub type __kernel_suseconds_t = __kernel_long_t; +pub type __kernel_daddr_t = crate::ctypes::c_int; +pub type __kernel_uid32_t = crate::ctypes::c_uint; +pub type __kernel_gid32_t = crate::ctypes::c_uint; +pub type __kernel_old_uid_t = __kernel_uid_t; +pub type __kernel_old_gid_t = __kernel_gid_t; +pub type __kernel_size_t = crate::ctypes::c_uint; +pub type __kernel_ssize_t = crate::ctypes::c_int; +pub type __kernel_ptrdiff_t = crate::ctypes::c_int; +pub type __kernel_off_t = __kernel_long_t; +pub type __kernel_loff_t = crate::ctypes::c_longlong; +pub type __kernel_old_time_t = __kernel_long_t; +pub type __kernel_time_t = __kernel_long_t; +pub type __kernel_time64_t = crate::ctypes::c_longlong; +pub type __kernel_clock_t = __kernel_long_t; +pub type __kernel_timer_t = crate::ctypes::c_int; +pub type __kernel_clockid_t = crate::ctypes::c_int; +pub type __kernel_caddr_t = *mut crate::ctypes::c_char; +pub type __kernel_uid16_t = crate::ctypes::c_ushort; +pub type __kernel_gid16_t = crate::ctypes::c_ushort; +pub type __le16 = __u16; +pub type __be16 = __u16; +pub type __le32 = __u32; +pub type __be32 = __u32; +pub type __le64 = __u64; +pub type __be64 = __u64; +pub type __sum16 = __u16; +pub type __wsum = __u32; +pub type __poll_t = crate::ctypes::c_uint; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct landlock_ruleset_attr { +pub handled_access_fs: __u64, +pub handled_access_net: __u64, +} +#[repr(C, packed)] +#[derive(Debug, Copy, Clone)] +pub struct landlock_path_beneath_attr { +pub allowed_access: __u64, +pub parent_fd: __s32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct landlock_net_port_attr { +pub allowed_access: __u64, +pub port: __u64, +} +pub const __BITS_PER_LONG_LONG: u32 = 64; +pub const LANDLOCK_CREATE_RULESET_VERSION: u32 = 1; +pub const LANDLOCK_ACCESS_FS_EXECUTE: u32 = 1; +pub const LANDLOCK_ACCESS_FS_WRITE_FILE: u32 = 2; +pub const LANDLOCK_ACCESS_FS_READ_FILE: u32 = 4; +pub const LANDLOCK_ACCESS_FS_READ_DIR: u32 = 8; +pub const LANDLOCK_ACCESS_FS_REMOVE_DIR: u32 = 16; +pub const LANDLOCK_ACCESS_FS_REMOVE_FILE: u32 = 32; +pub const LANDLOCK_ACCESS_FS_MAKE_CHAR: u32 = 64; +pub const LANDLOCK_ACCESS_FS_MAKE_DIR: u32 = 128; +pub const LANDLOCK_ACCESS_FS_MAKE_REG: u32 = 256; +pub const LANDLOCK_ACCESS_FS_MAKE_SOCK: u32 = 512; +pub const LANDLOCK_ACCESS_FS_MAKE_FIFO: u32 = 1024; +pub const LANDLOCK_ACCESS_FS_MAKE_BLOCK: u32 = 2048; +pub const LANDLOCK_ACCESS_FS_MAKE_SYM: u32 = 4096; +pub const LANDLOCK_ACCESS_FS_REFER: u32 = 8192; +pub const LANDLOCK_ACCESS_FS_TRUNCATE: u32 = 16384; +pub const LANDLOCK_ACCESS_FS_IOCTL_DEV: u32 = 32768; +pub const LANDLOCK_ACCESS_NET_BIND_TCP: u32 = 1; +pub const LANDLOCK_ACCESS_NET_CONNECT_TCP: u32 = 2; +#[repr(u32)] +#[non_exhaustive] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub enum landlock_rule_type { +LANDLOCK_RULE_PATH_BENEATH = 1, +LANDLOCK_RULE_NET_PORT = 2, +} diff --git a/src/x86_64/landlock.rs b/src/x86_64/landlock.rs new file mode 100644 index 00000000..47eebead --- /dev/null +++ b/src/x86_64/landlock.rs @@ -0,0 +1,97 @@ +/* automatically generated by rust-bindgen 0.70.1 */ + +pub type __s8 = crate::ctypes::c_schar; +pub type __u8 = crate::ctypes::c_uchar; +pub type __s16 = crate::ctypes::c_short; +pub type __u16 = crate::ctypes::c_ushort; +pub type __s32 = crate::ctypes::c_int; +pub type __u32 = crate::ctypes::c_uint; +pub type __s64 = crate::ctypes::c_longlong; +pub type __u64 = crate::ctypes::c_ulonglong; +pub type __kernel_key_t = crate::ctypes::c_int; +pub type __kernel_mqd_t = crate::ctypes::c_int; +pub type __kernel_old_uid_t = crate::ctypes::c_ushort; +pub type __kernel_old_gid_t = crate::ctypes::c_ushort; +pub type __kernel_old_dev_t = crate::ctypes::c_ulong; +pub type __kernel_long_t = crate::ctypes::c_long; +pub type __kernel_ulong_t = crate::ctypes::c_ulong; +pub type __kernel_ino_t = __kernel_ulong_t; +pub type __kernel_mode_t = crate::ctypes::c_uint; +pub type __kernel_pid_t = crate::ctypes::c_int; +pub type __kernel_ipc_pid_t = crate::ctypes::c_int; +pub type __kernel_uid_t = crate::ctypes::c_uint; +pub type __kernel_gid_t = crate::ctypes::c_uint; +pub type __kernel_suseconds_t = __kernel_long_t; +pub type __kernel_daddr_t = crate::ctypes::c_int; +pub type __kernel_uid32_t = crate::ctypes::c_uint; +pub type __kernel_gid32_t = crate::ctypes::c_uint; +pub type __kernel_size_t = __kernel_ulong_t; +pub type __kernel_ssize_t = __kernel_long_t; +pub type __kernel_ptrdiff_t = __kernel_long_t; +pub type __kernel_off_t = __kernel_long_t; +pub type __kernel_loff_t = crate::ctypes::c_longlong; +pub type __kernel_old_time_t = __kernel_long_t; +pub type __kernel_time_t = __kernel_long_t; +pub type __kernel_time64_t = crate::ctypes::c_longlong; +pub type __kernel_clock_t = __kernel_long_t; +pub type __kernel_timer_t = crate::ctypes::c_int; +pub type __kernel_clockid_t = crate::ctypes::c_int; +pub type __kernel_caddr_t = *mut crate::ctypes::c_char; +pub type __kernel_uid16_t = crate::ctypes::c_ushort; +pub type __kernel_gid16_t = crate::ctypes::c_ushort; +pub type __s128 = i128; +pub type __u128 = u128; +pub type __le16 = __u16; +pub type __be16 = __u16; +pub type __le32 = __u32; +pub type __be32 = __u32; +pub type __le64 = __u64; +pub type __be64 = __u64; +pub type __sum16 = __u16; +pub type __wsum = __u32; +pub type __poll_t = crate::ctypes::c_uint; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct landlock_ruleset_attr { +pub handled_access_fs: __u64, +pub handled_access_net: __u64, +} +#[repr(C, packed)] +#[derive(Debug, Copy, Clone)] +pub struct landlock_path_beneath_attr { +pub allowed_access: __u64, +pub parent_fd: __s32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct landlock_net_port_attr { +pub allowed_access: __u64, +pub port: __u64, +} +pub const __BITS_PER_LONG_LONG: u32 = 64; +pub const LANDLOCK_CREATE_RULESET_VERSION: u32 = 1; +pub const LANDLOCK_ACCESS_FS_EXECUTE: u32 = 1; +pub const LANDLOCK_ACCESS_FS_WRITE_FILE: u32 = 2; +pub const LANDLOCK_ACCESS_FS_READ_FILE: u32 = 4; +pub const LANDLOCK_ACCESS_FS_READ_DIR: u32 = 8; +pub const LANDLOCK_ACCESS_FS_REMOVE_DIR: u32 = 16; +pub const LANDLOCK_ACCESS_FS_REMOVE_FILE: u32 = 32; +pub const LANDLOCK_ACCESS_FS_MAKE_CHAR: u32 = 64; +pub const LANDLOCK_ACCESS_FS_MAKE_DIR: u32 = 128; +pub const LANDLOCK_ACCESS_FS_MAKE_REG: u32 = 256; +pub const LANDLOCK_ACCESS_FS_MAKE_SOCK: u32 = 512; +pub const LANDLOCK_ACCESS_FS_MAKE_FIFO: u32 = 1024; +pub const LANDLOCK_ACCESS_FS_MAKE_BLOCK: u32 = 2048; +pub const LANDLOCK_ACCESS_FS_MAKE_SYM: u32 = 4096; +pub const LANDLOCK_ACCESS_FS_REFER: u32 = 8192; +pub const LANDLOCK_ACCESS_FS_TRUNCATE: u32 = 16384; +pub const LANDLOCK_ACCESS_FS_IOCTL_DEV: u32 = 32768; +pub const LANDLOCK_ACCESS_NET_BIND_TCP: u32 = 1; +pub const LANDLOCK_ACCESS_NET_CONNECT_TCP: u32 = 2; +#[repr(u32)] +#[non_exhaustive] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub enum landlock_rule_type { +LANDLOCK_RULE_PATH_BENEATH = 1, +LANDLOCK_RULE_NET_PORT = 2, +}