Enum netlink_packet_sock_diag::unix::nlas::Nla[][src]

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

Variants

Name(String)

Tuple Fields

0: String

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

Vfs(Vfs)

Tuple Fields

0: Vfs

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

Peer(u32)

Tuple Fields

0: 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>)

Tuple Fields

0: 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(u32u32)

Tuple Fields

0: u32
1: 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)

Tuple Fields

Socket memory information. See MemInfo for more details.

Shutdown(u8)

Tuple Fields

0: u8

Shutown state: one of SHUT_RD, SHUT_WR or SHUT_RDWR

Other(DefaultNla)

Tuple Fields

Unknown attribute

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Deserialize the current type.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Return the length of the serialized data.

Serialize this types and write the serialized data into the given buffer. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

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

🔬 This is a nightly-only experimental API. (toowned_clone_into)

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

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.