Skip to main content

KernelClass

Enum KernelClass 

Source
#[repr(u32)]
pub enum KernelClass {
Show 52 variants AnonFsNode = 0, Binder = 1, BlkFile = 2, Bpf = 3, Capability = 4, Capability2 = 5, ChrFile = 6, Dir = 7, Fd = 8, FifoFile = 9, File = 10, FileSystem = 11, IcmpSocket = 12, KeySocket = 13, LnkFile = 14, MemFdFile = 15, NetlinkAuditSocket = 16, NetlinkConnectorSocket = 17, NetlinkCryptoSocket = 18, NetlinkDnrtSocket = 19, NetlinkFibLookupSocket = 20, NetlinkFirewallSocket = 21, NetlinkGenericSocket = 22, NetlinkIp6FwSocket = 23, NetlinkIscsiSocket = 24, NetlinkKobjectUeventSocket = 25, NetlinkNetfilterSocket = 26, NetlinkNflogSocket = 27, NetlinkRdmaSocket = 28, NetlinkRouteSocket = 29, NetlinkScsitransportSocket = 30, NetlinkSelinuxSocket = 31, NetlinkSocket = 32, NetlinkTcpDiagSocket = 33, NetlinkXfrmSocket = 34, PacketSocket = 35, PerfEvent = 36, Process = 37, Process2 = 38, QipcrtrSocket = 39, RawIpSocket = 40, SctpSocket = 41, Security = 42, SockFile = 43, Socket = 44, System = 45, TcpSocket = 46, TunSocket = 47, UdpSocket = 48, UnixDgramSocket = 49, UnixStreamSocket = 50, VsockSocket = 51,
}
Expand description

Allow callers to use the kernel class & permission definitions. A well-known class in SELinux policy that has a particular meaning in policy enforcement hooks.

Variants§

§

AnonFsNode = 0

The SELinux “anon_inode” object class.

§

Binder = 1

The SELinux “binder” object class.

§

BlkFile = 2

The SELinux “blk_file” object class.

§

Bpf = 3

The SELinux “bpf” object class.

§

Capability = 4

The SELinux “capability” object class.

§

Capability2 = 5

The SELinux “capability2” object class.

§

ChrFile = 6

The SELinux “chr_file” object class.

§

Dir = 7

The SELinux “dir” object class.

§

Fd = 8

The SELinux “fd” object class.

§

FifoFile = 9

The SELinux “fifo_file” object class.

§

File = 10

The SELinux “file” object class.

§

FileSystem = 11

The SELinux “filesystem” object class.

§

IcmpSocket = 12

“icmp_socket” class enabled via the “extended_socket_class” policy capability.

§

KeySocket = 13

The SELinux “key_socket” object class.

§

LnkFile = 14

The SELinux “lnk_file” object class.

§

MemFdFile = 15

The SELinux “memfd_file” object class.

§

NetlinkAuditSocket = 16

The SELinux “netlink_audit_socket” object class.

§

NetlinkConnectorSocket = 17

The SELinux “netlink_connector_socket” object class.

§

NetlinkCryptoSocket = 18

The SELinux “netlink_crypto_socket” object class.

§

NetlinkDnrtSocket = 19

The SELinux “netlink_dnrt_socket” object class.

§

NetlinkFibLookupSocket = 20

The SELinux “netlink_fib_lookup_socket” object class.

§

NetlinkFirewallSocket = 21

The SELinux “netlink_firewall_socket” object class.

§

NetlinkGenericSocket = 22

The SELinux “netlink_generic_socket” object class.

§

NetlinkIp6FwSocket = 23

The SELinux “netlink_ip6fw_socket” object class.

§

NetlinkIscsiSocket = 24

The SELinux “netlink_iscsi_socket” object class.

§

NetlinkKobjectUeventSocket = 25

The SELinux “netlink_kobject_uevent_socket” object class.

§

NetlinkNetfilterSocket = 26

The SELinux “netlink_netfilter_socket” object class.

§

NetlinkNflogSocket = 27

The SELinux “netlink_nflog_socket” object class.

§

NetlinkRdmaSocket = 28

The SELinux “netlink_rdma_socket” object class.

§

NetlinkRouteSocket = 29

The SELinux “netlink_route_socket” object class.

§

NetlinkScsitransportSocket = 30

The SELinux “netlink_scsitransport_socket” object class.

§

NetlinkSelinuxSocket = 31

The SELinux “netlink_selinux_socket” object class.

§

NetlinkSocket = 32

The SELinux “netlink_socket” object class.

§

NetlinkTcpDiagSocket = 33

The SELinux “netlink_tcpdiag_socket” object class.

§

NetlinkXfrmSocket = 34

The SELinux “netlink_xfrm_socket” object class.

§

PacketSocket = 35

The SELinux “packet_socket” object class.

§

PerfEvent = 36

The SELinux “perf_event” object class.

§

Process = 37

The SELinux “process” object class.

§

Process2 = 38

The SELinux “process2” object class.

§

QipcrtrSocket = 39

The SELinux “qipcrtr_socket” object class.

§

RawIpSocket = 40

The SELinux “rawip_socket” object class.

§

SctpSocket = 41

“sctp_socket” class enabled via the “extended_socket_class” policy capability.

§

Security = 42

The SELinux “security” object class.

§

SockFile = 43

The SELinux “sock_file” object class.

§

Socket = 44

The SELinux “socket” object class.

§

System = 45

The SELinux “system” object class.

§

TcpSocket = 46

The SELinux “tcp_socket” object class.

§

TunSocket = 47

The SELinux “tun_socket” object class.

§

UdpSocket = 48

The SELinux “udp_socket” object class.

§

UnixDgramSocket = 49

The SELinux “unix_dgram_socket” object class.

§

UnixStreamSocket = 50

The SELinux “unix_stream_socket” object class.

§

VsockSocket = 51

“vsock_socket” class enabled via the “extended_socket_class” policy capability.

Implementations§

Source§

impl KernelClass

Source

pub fn name(&self) -> &'static str

Source§

impl KernelClass

Source

pub const fn permissions(&self) -> &'static [KernelPermission]

Trait Implementations§

Source§

impl Clone for KernelClass

Source§

fn clone(&self) -> KernelClass

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for KernelClass

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl From<Cap2Class> for KernelClass

Source§

fn from(other: Cap2Class) -> Self

Converts to this type from the input type.
Source§

impl From<CapClass> for KernelClass

Source§

fn from(other: CapClass) -> Self

Converts to this type from the input type.
Source§

impl From<FileClass> for KernelClass

Source§

fn from(other: FileClass) -> Self

Converts to this type from the input type.
Source§

impl From<FsNodeClass> for KernelClass

Source§

fn from(class: FsNodeClass) -> Self

Converts to this type from the input type.
Source§

impl From<SocketClass> for KernelClass

Source§

fn from(other: SocketClass) -> Self

Converts to this type from the input type.
Source§

impl Hash for KernelClass

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl IntoBytes for KernelClass
where (): PaddingFree<Self, { _ }>,

Source§

fn as_bytes(&self) -> &[u8]
where Self: Immutable,

Gets the bytes of this value. Read more
Source§

fn write_to(&self, dst: &mut [u8]) -> Result<(), SizeError<&Self, &mut [u8]>>
where Self: Immutable,

Writes a copy of self to dst. Read more
Source§

fn write_to_prefix( &self, dst: &mut [u8], ) -> Result<(), SizeError<&Self, &mut [u8]>>
where Self: Immutable,

Writes a copy of self to the prefix of dst. Read more
Source§

fn write_to_suffix( &self, dst: &mut [u8], ) -> Result<(), SizeError<&Self, &mut [u8]>>
where Self: Immutable,

Writes a copy of self to the suffix of dst. Read more
Source§

impl PartialEq for KernelClass

Source§

fn eq(&self, other: &KernelClass) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl VariantArray for KernelClass

Source§

const VARIANTS: &'static [Self]

Source§

impl Copy for KernelClass

Source§

impl Eq for KernelClass

Source§

impl Immutable for KernelClass

Source§

impl StructuralPartialEq for KernelClass

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> AsAny for T
where T: Any,

Source§

fn as_any(&self) -> &(dyn Any + 'static)

Source§

fn type_name(&self) -> &'static str

Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

§

impl<T, D> Encode<Ambiguous1, D> for T
where D: ResourceDialect,

§

unsafe fn encode( self, _encoder: &mut Encoder<'_, D>, _offset: usize, _depth: Depth, ) -> Result<(), Error>

Encodes the object into the encoder’s buffers. Any handles stored in the object are swapped for Handle::INVALID. Read more
§

impl<T, D> Encode<Ambiguous2, D> for T
where D: ResourceDialect,

§

unsafe fn encode( self, _encoder: &mut Encoder<'_, D>, _offset: usize, _depth: Depth, ) -> Result<(), Error>

Encodes the object into the encoder’s buffers. Any handles stored in the object are swapped for Handle::INVALID. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
§

impl<F, N> FidlIntoNative<Box<N>> for F
where F: FidlIntoNative<N>,

§

fn fidl_into_native(self) -> Box<N>

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> Into32<U> for T
where U: MultiArchFrom<T>,

Source§

fn into_32(self) -> U

Source§

impl<T, U> Into64<U> for T
where U: MultiArchFrom<T>,

Source§

fn into_64(self) -> U

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T, U> MultiArchFrom<T> for U
where U: From<T>,

Source§

fn from_64(value: T) -> U

Source§

fn from_32(value: T) -> U

§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

Source§

impl<B, A> LockBefore<B> for A
where B: LockAfter<A>,

Source§

impl<B, A> LockEqualOrBefore<B> for A
where A: LockBefore<B>,