Struct neli::socket::NlSocket

source ·
pub struct NlSocket { /* private fields */ }
Expand description

Low level access to a netlink socket.

Implementations§

Wrapper around socket() syscall filling in the netlink-specific information.

Equivalent of socket and bind calls.

Set underlying socket file descriptor to be blocking.

Set underlying socket file descriptor to be non blocking.

Determines if underlying file descriptor is blocking.

Use this function to bind to a netlink ID and subscribe to groups. See netlink(7) man pages for more information on netlink IDs and groups.

Join multicast groups for a socket.

Leave multicast groups for a socket.

List joined groups for a socket.

Send message encoded as byte slice to the netlink ID specified in the netlink header Nlmsghdr

Receive message encoded as byte slice from the netlink socket.

Get the PID for this socket.

Trait Implementations§

Extracts the raw file descriptor. Read more

Closes underlying file descriptor to avoid file descriptor leaks.

Converts to this type from the input type.
Constructs a new instance of Self from the given raw file descriptor. Read more
Consumes this object, returning the raw underlying file descriptor. Read more

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

Returns the argument unchanged.

Calls U::from(self).

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

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.