From 7ac68520ecd4f757cc6808ae4b2e97c645aa2ebb Mon Sep 17 00:00:00 2001 From: Federico Maria Morrone Date: Tue, 24 Sep 2024 15:09:33 +0200 Subject: [PATCH 1/2] Add landlock api --- gen/modules/general.h | 1 + src/aarch64/general.rs | 44 ++++++++++++++++++++++++++++++++++++++ src/arm/general.rs | 44 ++++++++++++++++++++++++++++++++++++++ src/csky/general.rs | 44 ++++++++++++++++++++++++++++++++++++++ src/loongarch64/general.rs | 44 ++++++++++++++++++++++++++++++++++++++ src/mips/general.rs | 44 ++++++++++++++++++++++++++++++++++++++ src/mips32r6/general.rs | 44 ++++++++++++++++++++++++++++++++++++++ src/mips64/general.rs | 44 ++++++++++++++++++++++++++++++++++++++ src/mips64r6/general.rs | 44 ++++++++++++++++++++++++++++++++++++++ src/powerpc/general.rs | 44 ++++++++++++++++++++++++++++++++++++++ src/powerpc64/general.rs | 44 ++++++++++++++++++++++++++++++++++++++ src/riscv32/general.rs | 44 ++++++++++++++++++++++++++++++++++++++ src/riscv64/general.rs | 44 ++++++++++++++++++++++++++++++++++++++ src/s390x/general.rs | 44 ++++++++++++++++++++++++++++++++++++++ src/sparc/general.rs | 44 ++++++++++++++++++++++++++++++++++++++ src/sparc64/general.rs | 44 ++++++++++++++++++++++++++++++++++++++ src/x32/general.rs | 44 ++++++++++++++++++++++++++++++++++++++ src/x86/general.rs | 44 ++++++++++++++++++++++++++++++++++++++ src/x86_64/general.rs | 44 ++++++++++++++++++++++++++++++++++++++ 19 files changed, 793 insertions(+) diff --git a/gen/modules/general.h b/gen/modules/general.h index 0a73416f..7ba2200f 100644 --- a/gen/modules/general.h +++ b/gen/modules/general.h @@ -14,6 +14,7 @@ #include #include #include +#include #include #include #include diff --git a/src/aarch64/general.rs b/src/aarch64/general.rs index 1e1e87dd..6f571b8f 100644 --- a/src/aarch64/general.rs +++ b/src/aarch64/general.rs @@ -426,6 +426,24 @@ pub name: __IncompleteArrayField, } #[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, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] pub struct cachestat_range { pub off: __u64, pub len: __u64, @@ -1551,6 +1569,25 @@ pub const IN_ONESHOT: u32 = 2147483648; pub const IN_ALL_EVENTS: u32 = 4095; pub const IN_CLOEXEC: u32 = 524288; pub const IN_NONBLOCK: u32 = 2048; +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; pub const ADFS_SUPER_MAGIC: u32 = 44533; pub const AFFS_SUPER_MAGIC: u32 = 44543; pub const AFS_SUPER_MAGIC: u32 = 1397113167; @@ -2749,6 +2786,13 @@ PROCMAP_QUERY_FILE_BACKED_VMA = 32, #[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(u32)] +#[non_exhaustive] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub enum membarrier_cmd { MEMBARRIER_CMD_QUERY = 0, MEMBARRIER_CMD_GLOBAL = 1, diff --git a/src/arm/general.rs b/src/arm/general.rs index 3268e102..047e2b9d 100644 --- a/src/arm/general.rs +++ b/src/arm/general.rs @@ -424,6 +424,24 @@ pub name: __IncompleteArrayField, } #[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, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] pub struct cachestat_range { pub off: __u64, pub len: __u64, @@ -1582,6 +1600,25 @@ pub const IN_ONESHOT: u32 = 2147483648; pub const IN_ALL_EVENTS: u32 = 4095; pub const IN_CLOEXEC: u32 = 524288; pub const IN_NONBLOCK: u32 = 2048; +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; pub const ADFS_SUPER_MAGIC: u32 = 44533; pub const AFFS_SUPER_MAGIC: u32 = 44543; pub const AFS_SUPER_MAGIC: u32 = 1397113167; @@ -2886,6 +2923,13 @@ PROCMAP_QUERY_FILE_BACKED_VMA = 32, #[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(u32)] +#[non_exhaustive] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub enum membarrier_cmd { MEMBARRIER_CMD_QUERY = 0, MEMBARRIER_CMD_GLOBAL = 1, diff --git a/src/csky/general.rs b/src/csky/general.rs index 7c064f02..4cd2f282 100644 --- a/src/csky/general.rs +++ b/src/csky/general.rs @@ -424,6 +424,24 @@ pub name: __IncompleteArrayField, } #[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, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] pub struct cachestat_range { pub off: __u64, pub len: __u64, @@ -1573,6 +1591,25 @@ pub const IN_ONESHOT: u32 = 2147483648; pub const IN_ALL_EVENTS: u32 = 4095; pub const IN_CLOEXEC: u32 = 524288; pub const IN_NONBLOCK: u32 = 2048; +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; pub const ADFS_SUPER_MAGIC: u32 = 44533; pub const AFFS_SUPER_MAGIC: u32 = 44543; pub const AFS_SUPER_MAGIC: u32 = 1397113167; @@ -2787,6 +2824,13 @@ PROCMAP_QUERY_FILE_BACKED_VMA = 32, #[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(u32)] +#[non_exhaustive] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub enum membarrier_cmd { MEMBARRIER_CMD_QUERY = 0, MEMBARRIER_CMD_GLOBAL = 1, diff --git a/src/loongarch64/general.rs b/src/loongarch64/general.rs index 6b9d7e7c..17918cd9 100644 --- a/src/loongarch64/general.rs +++ b/src/loongarch64/general.rs @@ -426,6 +426,24 @@ pub name: __IncompleteArrayField, } #[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, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] pub struct cachestat_range { pub off: __u64, pub len: __u64, @@ -1549,6 +1567,25 @@ pub const IN_ONESHOT: u32 = 2147483648; pub const IN_ALL_EVENTS: u32 = 4095; pub const IN_CLOEXEC: u32 = 524288; pub const IN_NONBLOCK: u32 = 2048; +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; pub const ADFS_SUPER_MAGIC: u32 = 44533; pub const AFFS_SUPER_MAGIC: u32 = 44543; pub const AFS_SUPER_MAGIC: u32 = 1397113167; @@ -2738,6 +2775,13 @@ PROCMAP_QUERY_FILE_BACKED_VMA = 32, #[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(u32)] +#[non_exhaustive] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub enum membarrier_cmd { MEMBARRIER_CMD_QUERY = 0, MEMBARRIER_CMD_GLOBAL = 1, diff --git a/src/mips/general.rs b/src/mips/general.rs index 0cf6d72d..c5029be9 100644 --- a/src/mips/general.rs +++ b/src/mips/general.rs @@ -427,6 +427,24 @@ pub name: __IncompleteArrayField, } #[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, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] pub struct cachestat_range { pub off: __u64, pub len: __u64, @@ -1600,6 +1618,25 @@ pub const IN_ONESHOT: u32 = 2147483648; pub const IN_ALL_EVENTS: u32 = 4095; pub const IN_CLOEXEC: u32 = 524288; pub const IN_NONBLOCK: u32 = 128; +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; pub const ADFS_SUPER_MAGIC: u32 = 44533; pub const AFFS_SUPER_MAGIC: u32 = 44543; pub const AFS_SUPER_MAGIC: u32 = 1397113167; @@ -3055,6 +3092,13 @@ PROCMAP_QUERY_FILE_BACKED_VMA = 32, #[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(u32)] +#[non_exhaustive] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub enum membarrier_cmd { MEMBARRIER_CMD_QUERY = 0, MEMBARRIER_CMD_GLOBAL = 1, diff --git a/src/mips32r6/general.rs b/src/mips32r6/general.rs index 0cf6d72d..c5029be9 100644 --- a/src/mips32r6/general.rs +++ b/src/mips32r6/general.rs @@ -427,6 +427,24 @@ pub name: __IncompleteArrayField, } #[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, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] pub struct cachestat_range { pub off: __u64, pub len: __u64, @@ -1600,6 +1618,25 @@ pub const IN_ONESHOT: u32 = 2147483648; pub const IN_ALL_EVENTS: u32 = 4095; pub const IN_CLOEXEC: u32 = 524288; pub const IN_NONBLOCK: u32 = 128; +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; pub const ADFS_SUPER_MAGIC: u32 = 44533; pub const AFFS_SUPER_MAGIC: u32 = 44543; pub const AFS_SUPER_MAGIC: u32 = 1397113167; @@ -3055,6 +3092,13 @@ PROCMAP_QUERY_FILE_BACKED_VMA = 32, #[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(u32)] +#[non_exhaustive] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub enum membarrier_cmd { MEMBARRIER_CMD_QUERY = 0, MEMBARRIER_CMD_GLOBAL = 1, diff --git a/src/mips64/general.rs b/src/mips64/general.rs index dd7369d9..ee6d879b 100644 --- a/src/mips64/general.rs +++ b/src/mips64/general.rs @@ -427,6 +427,24 @@ pub name: __IncompleteArrayField, } #[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, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] pub struct cachestat_range { pub off: __u64, pub len: __u64, @@ -1589,6 +1607,25 @@ pub const IN_ONESHOT: u32 = 2147483648; pub const IN_ALL_EVENTS: u32 = 4095; pub const IN_CLOEXEC: u32 = 524288; pub const IN_NONBLOCK: u32 = 128; +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; pub const ADFS_SUPER_MAGIC: u32 = 44533; pub const AFFS_SUPER_MAGIC: u32 = 44543; pub const AFS_SUPER_MAGIC: u32 = 1397113167; @@ -2974,6 +3011,13 @@ PROCMAP_QUERY_FILE_BACKED_VMA = 32, #[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(u32)] +#[non_exhaustive] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub enum membarrier_cmd { MEMBARRIER_CMD_QUERY = 0, MEMBARRIER_CMD_GLOBAL = 1, diff --git a/src/mips64r6/general.rs b/src/mips64r6/general.rs index dd7369d9..ee6d879b 100644 --- a/src/mips64r6/general.rs +++ b/src/mips64r6/general.rs @@ -427,6 +427,24 @@ pub name: __IncompleteArrayField, } #[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, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] pub struct cachestat_range { pub off: __u64, pub len: __u64, @@ -1589,6 +1607,25 @@ pub const IN_ONESHOT: u32 = 2147483648; pub const IN_ALL_EVENTS: u32 = 4095; pub const IN_CLOEXEC: u32 = 524288; pub const IN_NONBLOCK: u32 = 128; +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; pub const ADFS_SUPER_MAGIC: u32 = 44533; pub const AFFS_SUPER_MAGIC: u32 = 44543; pub const AFS_SUPER_MAGIC: u32 = 1397113167; @@ -2974,6 +3011,13 @@ PROCMAP_QUERY_FILE_BACKED_VMA = 32, #[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(u32)] +#[non_exhaustive] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub enum membarrier_cmd { MEMBARRIER_CMD_QUERY = 0, MEMBARRIER_CMD_GLOBAL = 1, diff --git a/src/powerpc/general.rs b/src/powerpc/general.rs index 7667759e..8cdeb22e 100644 --- a/src/powerpc/general.rs +++ b/src/powerpc/general.rs @@ -431,6 +431,24 @@ pub name: __IncompleteArrayField, } #[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, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] pub struct cachestat_range { pub off: __u64, pub len: __u64, @@ -1640,6 +1658,25 @@ pub const IN_ONESHOT: u32 = 2147483648; pub const IN_ALL_EVENTS: u32 = 4095; pub const IN_CLOEXEC: u32 = 524288; pub const IN_NONBLOCK: u32 = 2048; +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; pub const ADFS_SUPER_MAGIC: u32 = 44533; pub const AFFS_SUPER_MAGIC: u32 = 44543; pub const AFS_SUPER_MAGIC: u32 = 1397113167; @@ -2978,6 +3015,13 @@ PROCMAP_QUERY_FILE_BACKED_VMA = 32, #[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(u32)] +#[non_exhaustive] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub enum membarrier_cmd { MEMBARRIER_CMD_QUERY = 0, MEMBARRIER_CMD_GLOBAL = 1, diff --git a/src/powerpc64/general.rs b/src/powerpc64/general.rs index 9f976e43..9b704e36 100644 --- a/src/powerpc64/general.rs +++ b/src/powerpc64/general.rs @@ -433,6 +433,24 @@ pub name: __IncompleteArrayField, } #[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, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] pub struct cachestat_range { pub off: __u64, pub len: __u64, @@ -1619,6 +1637,25 @@ pub const IN_ONESHOT: u32 = 2147483648; pub const IN_ALL_EVENTS: u32 = 4095; pub const IN_CLOEXEC: u32 = 524288; pub const IN_NONBLOCK: u32 = 2048; +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; pub const ADFS_SUPER_MAGIC: u32 = 44533; pub const AFFS_SUPER_MAGIC: u32 = 44543; pub const AFS_SUPER_MAGIC: u32 = 1397113167; @@ -2927,6 +2964,13 @@ PROCMAP_QUERY_FILE_BACKED_VMA = 32, #[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(u32)] +#[non_exhaustive] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub enum membarrier_cmd { MEMBARRIER_CMD_QUERY = 0, MEMBARRIER_CMD_GLOBAL = 1, diff --git a/src/riscv32/general.rs b/src/riscv32/general.rs index 74b3ce09..6fbd37af 100644 --- a/src/riscv32/general.rs +++ b/src/riscv32/general.rs @@ -424,6 +424,24 @@ pub name: __IncompleteArrayField, } #[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, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] pub struct cachestat_range { pub off: __u64, pub len: __u64, @@ -1582,6 +1600,25 @@ pub const IN_ONESHOT: u32 = 2147483648; pub const IN_ALL_EVENTS: u32 = 4095; pub const IN_CLOEXEC: u32 = 524288; pub const IN_NONBLOCK: u32 = 2048; +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; pub const ADFS_SUPER_MAGIC: u32 = 44533; pub const AFFS_SUPER_MAGIC: u32 = 44543; pub const AFS_SUPER_MAGIC: u32 = 1397113167; @@ -2766,6 +2803,13 @@ PROCMAP_QUERY_FILE_BACKED_VMA = 32, #[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(u32)] +#[non_exhaustive] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub enum membarrier_cmd { MEMBARRIER_CMD_QUERY = 0, MEMBARRIER_CMD_GLOBAL = 1, diff --git a/src/riscv64/general.rs b/src/riscv64/general.rs index d058025a..698d46bc 100644 --- a/src/riscv64/general.rs +++ b/src/riscv64/general.rs @@ -426,6 +426,24 @@ pub name: __IncompleteArrayField, } #[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, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] pub struct cachestat_range { pub off: __u64, pub len: __u64, @@ -1557,6 +1575,25 @@ pub const IN_ONESHOT: u32 = 2147483648; pub const IN_ALL_EVENTS: u32 = 4095; pub const IN_CLOEXEC: u32 = 524288; pub const IN_NONBLOCK: u32 = 2048; +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; pub const ADFS_SUPER_MAGIC: u32 = 44533; pub const AFFS_SUPER_MAGIC: u32 = 44543; pub const AFS_SUPER_MAGIC: u32 = 1397113167; @@ -2751,6 +2788,13 @@ PROCMAP_QUERY_FILE_BACKED_VMA = 32, #[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(u32)] +#[non_exhaustive] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub enum membarrier_cmd { MEMBARRIER_CMD_QUERY = 0, MEMBARRIER_CMD_GLOBAL = 1, diff --git a/src/s390x/general.rs b/src/s390x/general.rs index 6e0dd13e..f82acbca 100644 --- a/src/s390x/general.rs +++ b/src/s390x/general.rs @@ -441,6 +441,24 @@ pub name: __IncompleteArrayField, } #[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, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] pub struct cachestat_range { pub off: __u64, pub len: __u64, @@ -1548,6 +1566,25 @@ pub const IN_ONESHOT: u32 = 2147483648; pub const IN_ALL_EVENTS: u32 = 4095; pub const IN_CLOEXEC: u32 = 524288; pub const IN_NONBLOCK: u32 = 2048; +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; pub const ADFS_SUPER_MAGIC: u32 = 44533; pub const AFFS_SUPER_MAGIC: u32 = 44543; pub const AFS_SUPER_MAGIC: u32 = 1397113167; @@ -2805,6 +2842,13 @@ PROCMAP_QUERY_FILE_BACKED_VMA = 32, #[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(u32)] +#[non_exhaustive] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub enum membarrier_cmd { MEMBARRIER_CMD_QUERY = 0, MEMBARRIER_CMD_GLOBAL = 1, diff --git a/src/sparc/general.rs b/src/sparc/general.rs index 3594c2c8..b8187d5b 100644 --- a/src/sparc/general.rs +++ b/src/sparc/general.rs @@ -426,6 +426,24 @@ pub name: __IncompleteArrayField, } #[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, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] pub struct cachestat_range { pub off: __u64, pub len: __u64, @@ -1592,6 +1610,25 @@ pub const IN_ONESHOT: u32 = 2147483648; pub const IN_ALL_EVENTS: u32 = 4095; pub const IN_CLOEXEC: u32 = 4194304; pub const IN_NONBLOCK: u32 = 16384; +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; pub const ADFS_SUPER_MAGIC: u32 = 44533; pub const AFFS_SUPER_MAGIC: u32 = 44543; pub const AFS_SUPER_MAGIC: u32 = 1397113167; @@ -2937,6 +2974,13 @@ PROCMAP_QUERY_FILE_BACKED_VMA = 32, #[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(u32)] +#[non_exhaustive] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub enum membarrier_cmd { MEMBARRIER_CMD_QUERY = 0, MEMBARRIER_CMD_GLOBAL = 1, diff --git a/src/sparc64/general.rs b/src/sparc64/general.rs index 85b0455e..d992935e 100644 --- a/src/sparc64/general.rs +++ b/src/sparc64/general.rs @@ -434,6 +434,24 @@ pub name: __IncompleteArrayField, } #[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, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] pub struct cachestat_range { pub off: __u64, pub len: __u64, @@ -1586,6 +1604,25 @@ pub const IN_ONESHOT: u32 = 2147483648; pub const IN_ALL_EVENTS: u32 = 4095; pub const IN_CLOEXEC: u32 = 4194304; pub const IN_NONBLOCK: u32 = 16384; +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; pub const ADFS_SUPER_MAGIC: u32 = 44533; pub const AFFS_SUPER_MAGIC: u32 = 44543; pub const AFS_SUPER_MAGIC: u32 = 1397113167; @@ -2893,6 +2930,13 @@ PROCMAP_QUERY_FILE_BACKED_VMA = 32, #[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(u32)] +#[non_exhaustive] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub enum membarrier_cmd { MEMBARRIER_CMD_QUERY = 0, MEMBARRIER_CMD_GLOBAL = 1, diff --git a/src/x32/general.rs b/src/x32/general.rs index 6ca18828..3590f4cc 100644 --- a/src/x32/general.rs +++ b/src/x32/general.rs @@ -427,6 +427,24 @@ pub name: __IncompleteArrayField, } #[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, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] pub struct cachestat_range { pub off: __u64, pub len: __u64, @@ -1564,6 +1582,25 @@ pub const IN_ONESHOT: u32 = 2147483648; pub const IN_ALL_EVENTS: u32 = 4095; pub const IN_CLOEXEC: u32 = 524288; pub const IN_NONBLOCK: u32 = 2048; +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; pub const ADFS_SUPER_MAGIC: u32 = 44533; pub const AFFS_SUPER_MAGIC: u32 = 44543; pub const AFS_SUPER_MAGIC: u32 = 1397113167; @@ -2809,6 +2846,13 @@ PROCMAP_QUERY_FILE_BACKED_VMA = 32, #[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(u32)] +#[non_exhaustive] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub enum membarrier_cmd { MEMBARRIER_CMD_QUERY = 0, MEMBARRIER_CMD_GLOBAL = 1, diff --git a/src/x86/general.rs b/src/x86/general.rs index ee1f484a..19ff2752 100644 --- a/src/x86/general.rs +++ b/src/x86/general.rs @@ -424,6 +424,24 @@ pub name: __IncompleteArrayField, } #[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, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] pub struct cachestat_range { pub off: __u64, pub len: __u64, @@ -1585,6 +1603,25 @@ pub const IN_ONESHOT: u32 = 2147483648; pub const IN_ALL_EVENTS: u32 = 4095; pub const IN_CLOEXEC: u32 = 524288; pub const IN_NONBLOCK: u32 = 2048; +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; pub const ADFS_SUPER_MAGIC: u32 = 44533; pub const AFFS_SUPER_MAGIC: u32 = 44543; pub const AFS_SUPER_MAGIC: u32 = 1397113167; @@ -2919,6 +2956,13 @@ PROCMAP_QUERY_FILE_BACKED_VMA = 32, #[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(u32)] +#[non_exhaustive] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub enum membarrier_cmd { MEMBARRIER_CMD_QUERY = 0, MEMBARRIER_CMD_GLOBAL = 1, diff --git a/src/x86_64/general.rs b/src/x86_64/general.rs index ae26aa3c..09dfb739 100644 --- a/src/x86_64/general.rs +++ b/src/x86_64/general.rs @@ -426,6 +426,24 @@ pub name: __IncompleteArrayField, } #[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, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] pub struct cachestat_range { pub off: __u64, pub len: __u64, @@ -1559,6 +1577,25 @@ pub const IN_ONESHOT: u32 = 2147483648; pub const IN_ALL_EVENTS: u32 = 4095; pub const IN_CLOEXEC: u32 = 524288; pub const IN_NONBLOCK: u32 = 2048; +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; pub const ADFS_SUPER_MAGIC: u32 = 44533; pub const AFFS_SUPER_MAGIC: u32 = 44543; pub const AFS_SUPER_MAGIC: u32 = 1397113167; @@ -2815,6 +2852,13 @@ PROCMAP_QUERY_FILE_BACKED_VMA = 32, #[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(u32)] +#[non_exhaustive] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub enum membarrier_cmd { MEMBARRIER_CMD_QUERY = 0, MEMBARRIER_CMD_GLOBAL = 1, From 1756507f4e0be1ab01e476ee22f905d021a2bd20 Mon Sep 17 00:00:00 2001 From: Federico Maria Morrone Date: Thu, 26 Sep 2024 00:02:47 +0200 Subject: [PATCH 2/2] Move landlock api to it's own module --- Cargo.toml | 3 +- gen/modules/general.h | 1 - gen/modules/landlock.h | 1 + src/aarch64/general.rs | 44 -------------- src/aarch64/landlock.rs | 97 ++++++++++++++++++++++++++++++ src/arm/general.rs | 44 -------------- src/arm/landlock.rs | 95 +++++++++++++++++++++++++++++ src/csky/general.rs | 44 -------------- src/csky/landlock.rs | 95 +++++++++++++++++++++++++++++ src/lib.rs | 72 ++++++++++++++++++++++ src/loongarch64/general.rs | 44 -------------- src/loongarch64/landlock.rs | 97 ++++++++++++++++++++++++++++++ src/mips/general.rs | 44 -------------- src/mips/landlock.rs | 105 ++++++++++++++++++++++++++++++++ src/mips32r6/general.rs | 44 -------------- src/mips32r6/landlock.rs | 105 ++++++++++++++++++++++++++++++++ src/mips64/general.rs | 44 -------------- src/mips64/landlock.rs | 107 +++++++++++++++++++++++++++++++++ src/mips64r6/general.rs | 44 -------------- src/mips64r6/landlock.rs | 107 +++++++++++++++++++++++++++++++++ src/powerpc/general.rs | 44 -------------- src/powerpc/landlock.rs | 101 +++++++++++++++++++++++++++++++ src/powerpc64/general.rs | 44 -------------- src/powerpc64/landlock.rs | 103 +++++++++++++++++++++++++++++++ src/riscv32/general.rs | 44 -------------- src/riscv32/landlock.rs | 95 +++++++++++++++++++++++++++++ src/riscv64/general.rs | 44 -------------- src/riscv64/landlock.rs | 97 ++++++++++++++++++++++++++++++ src/s390x/general.rs | 44 -------------- src/s390x/landlock.rs | 117 ++++++++++++++++++++++++++++++++++++ src/sparc/general.rs | 44 -------------- src/sparc/landlock.rs | 95 +++++++++++++++++++++++++++++ src/sparc64/general.rs | 44 -------------- src/sparc64/landlock.rs | 103 +++++++++++++++++++++++++++++++ src/x32/general.rs | 44 -------------- src/x32/landlock.rs | 97 ++++++++++++++++++++++++++++++ src/x86/general.rs | 44 -------------- src/x86/landlock.rs | 95 +++++++++++++++++++++++++++++ src/x86_64/general.rs | 44 -------------- src/x86_64/landlock.rs | 97 ++++++++++++++++++++++++++++++ 40 files changed, 1883 insertions(+), 794 deletions(-) create mode 100644 gen/modules/landlock.h create mode 100644 src/aarch64/landlock.rs create mode 100644 src/arm/landlock.rs create mode 100644 src/csky/landlock.rs create mode 100644 src/loongarch64/landlock.rs create mode 100644 src/mips/landlock.rs create mode 100644 src/mips32r6/landlock.rs create mode 100644 src/mips64/landlock.rs create mode 100644 src/mips64r6/landlock.rs create mode 100644 src/powerpc/landlock.rs create mode 100644 src/powerpc64/landlock.rs create mode 100644 src/riscv32/landlock.rs create mode 100644 src/riscv64/landlock.rs create mode 100644 src/s390x/landlock.rs create mode 100644 src/sparc/landlock.rs create mode 100644 src/sparc64/landlock.rs create mode 100644 src/x32/landlock.rs create mode 100644 src/x86/landlock.rs create mode 100644 src/x86_64/landlock.rs 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/general.h b/gen/modules/general.h index 7ba2200f..0a73416f 100644 --- a/gen/modules/general.h +++ b/gen/modules/general.h @@ -14,7 +14,6 @@ #include #include #include -#include #include #include #include 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/general.rs b/src/aarch64/general.rs index 6f571b8f..1e1e87dd 100644 --- a/src/aarch64/general.rs +++ b/src/aarch64/general.rs @@ -426,24 +426,6 @@ pub name: __IncompleteArrayField, } #[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, -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] pub struct cachestat_range { pub off: __u64, pub len: __u64, @@ -1569,25 +1551,6 @@ pub const IN_ONESHOT: u32 = 2147483648; pub const IN_ALL_EVENTS: u32 = 4095; pub const IN_CLOEXEC: u32 = 524288; pub const IN_NONBLOCK: u32 = 2048; -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; pub const ADFS_SUPER_MAGIC: u32 = 44533; pub const AFFS_SUPER_MAGIC: u32 = 44543; pub const AFS_SUPER_MAGIC: u32 = 1397113167; @@ -2786,13 +2749,6 @@ PROCMAP_QUERY_FILE_BACKED_VMA = 32, #[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(u32)] -#[non_exhaustive] -#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub enum membarrier_cmd { MEMBARRIER_CMD_QUERY = 0, MEMBARRIER_CMD_GLOBAL = 1, 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/general.rs b/src/arm/general.rs index 047e2b9d..3268e102 100644 --- a/src/arm/general.rs +++ b/src/arm/general.rs @@ -424,24 +424,6 @@ pub name: __IncompleteArrayField, } #[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, -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] pub struct cachestat_range { pub off: __u64, pub len: __u64, @@ -1600,25 +1582,6 @@ pub const IN_ONESHOT: u32 = 2147483648; pub const IN_ALL_EVENTS: u32 = 4095; pub const IN_CLOEXEC: u32 = 524288; pub const IN_NONBLOCK: u32 = 2048; -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; pub const ADFS_SUPER_MAGIC: u32 = 44533; pub const AFFS_SUPER_MAGIC: u32 = 44543; pub const AFS_SUPER_MAGIC: u32 = 1397113167; @@ -2923,13 +2886,6 @@ PROCMAP_QUERY_FILE_BACKED_VMA = 32, #[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(u32)] -#[non_exhaustive] -#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub enum membarrier_cmd { MEMBARRIER_CMD_QUERY = 0, MEMBARRIER_CMD_GLOBAL = 1, 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/general.rs b/src/csky/general.rs index 4cd2f282..7c064f02 100644 --- a/src/csky/general.rs +++ b/src/csky/general.rs @@ -424,24 +424,6 @@ pub name: __IncompleteArrayField, } #[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, -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] pub struct cachestat_range { pub off: __u64, pub len: __u64, @@ -1591,25 +1573,6 @@ pub const IN_ONESHOT: u32 = 2147483648; pub const IN_ALL_EVENTS: u32 = 4095; pub const IN_CLOEXEC: u32 = 524288; pub const IN_NONBLOCK: u32 = 2048; -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; pub const ADFS_SUPER_MAGIC: u32 = 44533; pub const AFFS_SUPER_MAGIC: u32 = 44543; pub const AFS_SUPER_MAGIC: u32 = 1397113167; @@ -2824,13 +2787,6 @@ PROCMAP_QUERY_FILE_BACKED_VMA = 32, #[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(u32)] -#[non_exhaustive] -#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub enum membarrier_cmd { MEMBARRIER_CMD_QUERY = 0, MEMBARRIER_CMD_GLOBAL = 1, 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/general.rs b/src/loongarch64/general.rs index 17918cd9..6b9d7e7c 100644 --- a/src/loongarch64/general.rs +++ b/src/loongarch64/general.rs @@ -426,24 +426,6 @@ pub name: __IncompleteArrayField, } #[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, -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] pub struct cachestat_range { pub off: __u64, pub len: __u64, @@ -1567,25 +1549,6 @@ pub const IN_ONESHOT: u32 = 2147483648; pub const IN_ALL_EVENTS: u32 = 4095; pub const IN_CLOEXEC: u32 = 524288; pub const IN_NONBLOCK: u32 = 2048; -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; pub const ADFS_SUPER_MAGIC: u32 = 44533; pub const AFFS_SUPER_MAGIC: u32 = 44543; pub const AFS_SUPER_MAGIC: u32 = 1397113167; @@ -2775,13 +2738,6 @@ PROCMAP_QUERY_FILE_BACKED_VMA = 32, #[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(u32)] -#[non_exhaustive] -#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub enum membarrier_cmd { MEMBARRIER_CMD_QUERY = 0, MEMBARRIER_CMD_GLOBAL = 1, 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/general.rs b/src/mips/general.rs index c5029be9..0cf6d72d 100644 --- a/src/mips/general.rs +++ b/src/mips/general.rs @@ -427,24 +427,6 @@ pub name: __IncompleteArrayField, } #[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, -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] pub struct cachestat_range { pub off: __u64, pub len: __u64, @@ -1618,25 +1600,6 @@ pub const IN_ONESHOT: u32 = 2147483648; pub const IN_ALL_EVENTS: u32 = 4095; pub const IN_CLOEXEC: u32 = 524288; pub const IN_NONBLOCK: u32 = 128; -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; pub const ADFS_SUPER_MAGIC: u32 = 44533; pub const AFFS_SUPER_MAGIC: u32 = 44543; pub const AFS_SUPER_MAGIC: u32 = 1397113167; @@ -3092,13 +3055,6 @@ PROCMAP_QUERY_FILE_BACKED_VMA = 32, #[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(u32)] -#[non_exhaustive] -#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub enum membarrier_cmd { MEMBARRIER_CMD_QUERY = 0, MEMBARRIER_CMD_GLOBAL = 1, 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/general.rs b/src/mips32r6/general.rs index c5029be9..0cf6d72d 100644 --- a/src/mips32r6/general.rs +++ b/src/mips32r6/general.rs @@ -427,24 +427,6 @@ pub name: __IncompleteArrayField, } #[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, -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] pub struct cachestat_range { pub off: __u64, pub len: __u64, @@ -1618,25 +1600,6 @@ pub const IN_ONESHOT: u32 = 2147483648; pub const IN_ALL_EVENTS: u32 = 4095; pub const IN_CLOEXEC: u32 = 524288; pub const IN_NONBLOCK: u32 = 128; -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; pub const ADFS_SUPER_MAGIC: u32 = 44533; pub const AFFS_SUPER_MAGIC: u32 = 44543; pub const AFS_SUPER_MAGIC: u32 = 1397113167; @@ -3092,13 +3055,6 @@ PROCMAP_QUERY_FILE_BACKED_VMA = 32, #[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(u32)] -#[non_exhaustive] -#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub enum membarrier_cmd { MEMBARRIER_CMD_QUERY = 0, MEMBARRIER_CMD_GLOBAL = 1, 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/general.rs b/src/mips64/general.rs index ee6d879b..dd7369d9 100644 --- a/src/mips64/general.rs +++ b/src/mips64/general.rs @@ -427,24 +427,6 @@ pub name: __IncompleteArrayField, } #[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, -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] pub struct cachestat_range { pub off: __u64, pub len: __u64, @@ -1607,25 +1589,6 @@ pub const IN_ONESHOT: u32 = 2147483648; pub const IN_ALL_EVENTS: u32 = 4095; pub const IN_CLOEXEC: u32 = 524288; pub const IN_NONBLOCK: u32 = 128; -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; pub const ADFS_SUPER_MAGIC: u32 = 44533; pub const AFFS_SUPER_MAGIC: u32 = 44543; pub const AFS_SUPER_MAGIC: u32 = 1397113167; @@ -3011,13 +2974,6 @@ PROCMAP_QUERY_FILE_BACKED_VMA = 32, #[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(u32)] -#[non_exhaustive] -#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub enum membarrier_cmd { MEMBARRIER_CMD_QUERY = 0, MEMBARRIER_CMD_GLOBAL = 1, 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/general.rs b/src/mips64r6/general.rs index ee6d879b..dd7369d9 100644 --- a/src/mips64r6/general.rs +++ b/src/mips64r6/general.rs @@ -427,24 +427,6 @@ pub name: __IncompleteArrayField, } #[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, -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] pub struct cachestat_range { pub off: __u64, pub len: __u64, @@ -1607,25 +1589,6 @@ pub const IN_ONESHOT: u32 = 2147483648; pub const IN_ALL_EVENTS: u32 = 4095; pub const IN_CLOEXEC: u32 = 524288; pub const IN_NONBLOCK: u32 = 128; -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; pub const ADFS_SUPER_MAGIC: u32 = 44533; pub const AFFS_SUPER_MAGIC: u32 = 44543; pub const AFS_SUPER_MAGIC: u32 = 1397113167; @@ -3011,13 +2974,6 @@ PROCMAP_QUERY_FILE_BACKED_VMA = 32, #[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(u32)] -#[non_exhaustive] -#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub enum membarrier_cmd { MEMBARRIER_CMD_QUERY = 0, MEMBARRIER_CMD_GLOBAL = 1, 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/general.rs b/src/powerpc/general.rs index 8cdeb22e..7667759e 100644 --- a/src/powerpc/general.rs +++ b/src/powerpc/general.rs @@ -431,24 +431,6 @@ pub name: __IncompleteArrayField, } #[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, -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] pub struct cachestat_range { pub off: __u64, pub len: __u64, @@ -1658,25 +1640,6 @@ pub const IN_ONESHOT: u32 = 2147483648; pub const IN_ALL_EVENTS: u32 = 4095; pub const IN_CLOEXEC: u32 = 524288; pub const IN_NONBLOCK: u32 = 2048; -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; pub const ADFS_SUPER_MAGIC: u32 = 44533; pub const AFFS_SUPER_MAGIC: u32 = 44543; pub const AFS_SUPER_MAGIC: u32 = 1397113167; @@ -3015,13 +2978,6 @@ PROCMAP_QUERY_FILE_BACKED_VMA = 32, #[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(u32)] -#[non_exhaustive] -#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub enum membarrier_cmd { MEMBARRIER_CMD_QUERY = 0, MEMBARRIER_CMD_GLOBAL = 1, 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/general.rs b/src/powerpc64/general.rs index 9b704e36..9f976e43 100644 --- a/src/powerpc64/general.rs +++ b/src/powerpc64/general.rs @@ -433,24 +433,6 @@ pub name: __IncompleteArrayField, } #[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, -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] pub struct cachestat_range { pub off: __u64, pub len: __u64, @@ -1637,25 +1619,6 @@ pub const IN_ONESHOT: u32 = 2147483648; pub const IN_ALL_EVENTS: u32 = 4095; pub const IN_CLOEXEC: u32 = 524288; pub const IN_NONBLOCK: u32 = 2048; -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; pub const ADFS_SUPER_MAGIC: u32 = 44533; pub const AFFS_SUPER_MAGIC: u32 = 44543; pub const AFS_SUPER_MAGIC: u32 = 1397113167; @@ -2964,13 +2927,6 @@ PROCMAP_QUERY_FILE_BACKED_VMA = 32, #[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(u32)] -#[non_exhaustive] -#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub enum membarrier_cmd { MEMBARRIER_CMD_QUERY = 0, MEMBARRIER_CMD_GLOBAL = 1, 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/general.rs b/src/riscv32/general.rs index 6fbd37af..74b3ce09 100644 --- a/src/riscv32/general.rs +++ b/src/riscv32/general.rs @@ -424,24 +424,6 @@ pub name: __IncompleteArrayField, } #[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, -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] pub struct cachestat_range { pub off: __u64, pub len: __u64, @@ -1600,25 +1582,6 @@ pub const IN_ONESHOT: u32 = 2147483648; pub const IN_ALL_EVENTS: u32 = 4095; pub const IN_CLOEXEC: u32 = 524288; pub const IN_NONBLOCK: u32 = 2048; -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; pub const ADFS_SUPER_MAGIC: u32 = 44533; pub const AFFS_SUPER_MAGIC: u32 = 44543; pub const AFS_SUPER_MAGIC: u32 = 1397113167; @@ -2803,13 +2766,6 @@ PROCMAP_QUERY_FILE_BACKED_VMA = 32, #[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(u32)] -#[non_exhaustive] -#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub enum membarrier_cmd { MEMBARRIER_CMD_QUERY = 0, MEMBARRIER_CMD_GLOBAL = 1, 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/general.rs b/src/riscv64/general.rs index 698d46bc..d058025a 100644 --- a/src/riscv64/general.rs +++ b/src/riscv64/general.rs @@ -426,24 +426,6 @@ pub name: __IncompleteArrayField, } #[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, -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] pub struct cachestat_range { pub off: __u64, pub len: __u64, @@ -1575,25 +1557,6 @@ pub const IN_ONESHOT: u32 = 2147483648; pub const IN_ALL_EVENTS: u32 = 4095; pub const IN_CLOEXEC: u32 = 524288; pub const IN_NONBLOCK: u32 = 2048; -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; pub const ADFS_SUPER_MAGIC: u32 = 44533; pub const AFFS_SUPER_MAGIC: u32 = 44543; pub const AFS_SUPER_MAGIC: u32 = 1397113167; @@ -2788,13 +2751,6 @@ PROCMAP_QUERY_FILE_BACKED_VMA = 32, #[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(u32)] -#[non_exhaustive] -#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub enum membarrier_cmd { MEMBARRIER_CMD_QUERY = 0, MEMBARRIER_CMD_GLOBAL = 1, 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/general.rs b/src/s390x/general.rs index f82acbca..6e0dd13e 100644 --- a/src/s390x/general.rs +++ b/src/s390x/general.rs @@ -441,24 +441,6 @@ pub name: __IncompleteArrayField, } #[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, -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] pub struct cachestat_range { pub off: __u64, pub len: __u64, @@ -1566,25 +1548,6 @@ pub const IN_ONESHOT: u32 = 2147483648; pub const IN_ALL_EVENTS: u32 = 4095; pub const IN_CLOEXEC: u32 = 524288; pub const IN_NONBLOCK: u32 = 2048; -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; pub const ADFS_SUPER_MAGIC: u32 = 44533; pub const AFFS_SUPER_MAGIC: u32 = 44543; pub const AFS_SUPER_MAGIC: u32 = 1397113167; @@ -2842,13 +2805,6 @@ PROCMAP_QUERY_FILE_BACKED_VMA = 32, #[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(u32)] -#[non_exhaustive] -#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub enum membarrier_cmd { MEMBARRIER_CMD_QUERY = 0, MEMBARRIER_CMD_GLOBAL = 1, 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/general.rs b/src/sparc/general.rs index b8187d5b..3594c2c8 100644 --- a/src/sparc/general.rs +++ b/src/sparc/general.rs @@ -426,24 +426,6 @@ pub name: __IncompleteArrayField, } #[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, -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] pub struct cachestat_range { pub off: __u64, pub len: __u64, @@ -1610,25 +1592,6 @@ pub const IN_ONESHOT: u32 = 2147483648; pub const IN_ALL_EVENTS: u32 = 4095; pub const IN_CLOEXEC: u32 = 4194304; pub const IN_NONBLOCK: u32 = 16384; -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; pub const ADFS_SUPER_MAGIC: u32 = 44533; pub const AFFS_SUPER_MAGIC: u32 = 44543; pub const AFS_SUPER_MAGIC: u32 = 1397113167; @@ -2974,13 +2937,6 @@ PROCMAP_QUERY_FILE_BACKED_VMA = 32, #[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(u32)] -#[non_exhaustive] -#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub enum membarrier_cmd { MEMBARRIER_CMD_QUERY = 0, MEMBARRIER_CMD_GLOBAL = 1, 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/general.rs b/src/sparc64/general.rs index d992935e..85b0455e 100644 --- a/src/sparc64/general.rs +++ b/src/sparc64/general.rs @@ -434,24 +434,6 @@ pub name: __IncompleteArrayField, } #[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, -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] pub struct cachestat_range { pub off: __u64, pub len: __u64, @@ -1604,25 +1586,6 @@ pub const IN_ONESHOT: u32 = 2147483648; pub const IN_ALL_EVENTS: u32 = 4095; pub const IN_CLOEXEC: u32 = 4194304; pub const IN_NONBLOCK: u32 = 16384; -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; pub const ADFS_SUPER_MAGIC: u32 = 44533; pub const AFFS_SUPER_MAGIC: u32 = 44543; pub const AFS_SUPER_MAGIC: u32 = 1397113167; @@ -2930,13 +2893,6 @@ PROCMAP_QUERY_FILE_BACKED_VMA = 32, #[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(u32)] -#[non_exhaustive] -#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub enum membarrier_cmd { MEMBARRIER_CMD_QUERY = 0, MEMBARRIER_CMD_GLOBAL = 1, 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/general.rs b/src/x32/general.rs index 3590f4cc..6ca18828 100644 --- a/src/x32/general.rs +++ b/src/x32/general.rs @@ -427,24 +427,6 @@ pub name: __IncompleteArrayField, } #[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, -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] pub struct cachestat_range { pub off: __u64, pub len: __u64, @@ -1582,25 +1564,6 @@ pub const IN_ONESHOT: u32 = 2147483648; pub const IN_ALL_EVENTS: u32 = 4095; pub const IN_CLOEXEC: u32 = 524288; pub const IN_NONBLOCK: u32 = 2048; -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; pub const ADFS_SUPER_MAGIC: u32 = 44533; pub const AFFS_SUPER_MAGIC: u32 = 44543; pub const AFS_SUPER_MAGIC: u32 = 1397113167; @@ -2846,13 +2809,6 @@ PROCMAP_QUERY_FILE_BACKED_VMA = 32, #[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(u32)] -#[non_exhaustive] -#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub enum membarrier_cmd { MEMBARRIER_CMD_QUERY = 0, MEMBARRIER_CMD_GLOBAL = 1, 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/general.rs b/src/x86/general.rs index 19ff2752..ee1f484a 100644 --- a/src/x86/general.rs +++ b/src/x86/general.rs @@ -424,24 +424,6 @@ pub name: __IncompleteArrayField, } #[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, -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] pub struct cachestat_range { pub off: __u64, pub len: __u64, @@ -1603,25 +1585,6 @@ pub const IN_ONESHOT: u32 = 2147483648; pub const IN_ALL_EVENTS: u32 = 4095; pub const IN_CLOEXEC: u32 = 524288; pub const IN_NONBLOCK: u32 = 2048; -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; pub const ADFS_SUPER_MAGIC: u32 = 44533; pub const AFFS_SUPER_MAGIC: u32 = 44543; pub const AFS_SUPER_MAGIC: u32 = 1397113167; @@ -2956,13 +2919,6 @@ PROCMAP_QUERY_FILE_BACKED_VMA = 32, #[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(u32)] -#[non_exhaustive] -#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub enum membarrier_cmd { MEMBARRIER_CMD_QUERY = 0, MEMBARRIER_CMD_GLOBAL = 1, 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/general.rs b/src/x86_64/general.rs index 09dfb739..ae26aa3c 100644 --- a/src/x86_64/general.rs +++ b/src/x86_64/general.rs @@ -426,24 +426,6 @@ pub name: __IncompleteArrayField, } #[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, -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] pub struct cachestat_range { pub off: __u64, pub len: __u64, @@ -1577,25 +1559,6 @@ pub const IN_ONESHOT: u32 = 2147483648; pub const IN_ALL_EVENTS: u32 = 4095; pub const IN_CLOEXEC: u32 = 524288; pub const IN_NONBLOCK: u32 = 2048; -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; pub const ADFS_SUPER_MAGIC: u32 = 44533; pub const AFFS_SUPER_MAGIC: u32 = 44543; pub const AFS_SUPER_MAGIC: u32 = 1397113167; @@ -2852,13 +2815,6 @@ PROCMAP_QUERY_FILE_BACKED_VMA = 32, #[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(u32)] -#[non_exhaustive] -#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub enum membarrier_cmd { MEMBARRIER_CMD_QUERY = 0, MEMBARRIER_CMD_GLOBAL = 1, 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, +}