Nla

Enum Nla 

Source
pub enum Nla {
    Name(String),
    Vfs(Vfs),
    Peer(u32),
    PendingConnections(Vec<u32>),
    ReceiveQueueLength(u32, u32),
    MemInfo(MemInfo),
    Shutdown(u8),
    Other(DefaultNla),
}

Variants§

§

Name(String)

Path to which the socket was bound. This attribute is known as UNIX_DIAG_NAME in the kernel.

§

Vfs(Vfs)

VFS information for this socket. This attribute is known as UNIX_DIAG_VFS in the kernel.

§

Peer(u32)

Inode number of the socket’s peer. This attribute is reported for connected socket only. This attribute is known as UNIX_DIAG_PEER in the kernel.

§

PendingConnections(Vec<u32>)

The payload associated with this attribute is an array of inode numbers of sockets that have passed the connect(2) call, but haven’t been processed with accept(2) yet. This attribute is reported for listening sockets only. This attribute is known as UNIX_DIAG_ICONS in the kernel.

§

ReceiveQueueLength(u32, u32)

This attribute corresponds to the UNIX_DIAG_RQLEN. It reports the length of the socket receive queue, and the queue size limit. Note that for listening sockets the receive queue is used to store actual data sent by other sockets. It is used to store pending connections. So the meaning of this attribute differs for listening sockets.

For listening sockets:

  • the first the number is the number of pending connections. It should be equal to Nla::PendingConnections value’s length.
  • the second number is the backlog queue maximum length, which equals to the value passed as the second argument to listen(2)

For other sockets:

  • the first number is the amount of data in receive queue (note: I am not sure if it is the actual amount of data or the amount of memory allocated. The two might differ because of memory allocation strategies: more memory than strictly necessary may be allocated for a given sk_buff)
  • the second number is the memory used by outgoing data. Note that strictly UNIX sockets don’t have a send queue, since the data they send is directly written into the destination socket receive queue. But the memory allocated for this data is still counted from the sender point of view.
§

MemInfo(MemInfo)

Socket memory information. See MemInfo for more details.

§

Shutdown(u8)

Shutown state: one of SHUT_RD, SHUT_WR or SHUT_RDWR

§

Other(DefaultNla)

Unknown attribute

Trait Implementations§

Source§

impl Clone for Nla

Source§

fn clone(&self) -> Nla

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for Nla

Source§

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

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

impl Nla for Nla

Source§

fn value_len(&self) -> usize

Source§

fn emit_value(&self, buffer: &mut [u8])

Source§

fn kind(&self) -> u16

Source§

fn is_nested(&self) -> bool

Source§

fn is_network_byteorder(&self) -> bool

Source§

impl<'a, T: AsRef<[u8]> + ?Sized> Parseable<NlaBuffer<&'a T>> for Nla

Source§

type Error = DecodeError

Source§

fn parse(buf: &NlaBuffer<&'a T>) -> Result<Self, DecodeError>

Deserialize the current type.
Source§

impl PartialEq for Nla

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · 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 Eq for Nla

Source§

impl StructuralPartialEq for Nla

Auto Trait Implementations§

§

impl Freeze for Nla

§

impl RefUnwindSafe for Nla

§

impl Send for Nla

§

impl Sync for Nla

§

impl Unpin for Nla

§

impl UnwindSafe for Nla

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> 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> Emitable for T
where T: Nla,

Source§

fn buffer_len(&self) -> usize

Return the length of the serialized data.
Source§

fn emit(&self, buffer: &mut [u8])

Serialize this types and write the serialized data into the given buffer. Read more
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> 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.