[][src]Struct netlink_sys::Socket

pub struct Socket(_);

Implementations

impl Socket[src]

pub fn new(protocol: Protocol) -> Result<Self>[src]

pub fn bind(&mut self, addr: &SocketAddr) -> Result<()>[src]

pub fn bind_auto(&mut self) -> Result<SocketAddr>[src]

pub fn get_address(&self, addr: &mut SocketAddr) -> Result<()>[src]

pub fn set_non_blocking(&self, non_blocking: bool) -> Result<()>[src]

pub fn connect(&self, remote_addr: &SocketAddr) -> Result<()>[src]

pub fn recv_from(
    &self,
    buf: &mut [u8],
    flags: c_int
) -> Result<(usize, SocketAddr)>
[src]

pub fn recv(&self, buf: &mut [u8], flags: c_int) -> Result<usize>[src]

pub fn recv_from_full(&self) -> Result<(Vec<u8>, SocketAddr)>[src]

Receive a full message. Unlike recv_from, which truncates messages that exceed the length of the buffer passed as argument, this method always reads a whole message, no matter its size.

pub fn send_to(
    &self,
    buf: &[u8],
    addr: &SocketAddr,
    flags: c_int
) -> Result<usize>
[src]

pub fn send(&self, buf: &[u8], flags: c_int) -> Result<usize>[src]

pub fn set_pktinfo(&mut self, value: bool) -> Result<()>[src]

pub fn get_pktinfo(&self) -> Result<bool>[src]

pub fn add_membership(&mut self, group: u32) -> Result<()>[src]

pub fn drop_membership(&mut self, group: u32) -> Result<()>[src]

pub fn set_broadcast_error(&mut self, value: bool) -> Result<()>[src]

NETLINK_BROADCAST_ERROR (since Linux 2.6.30). When not set, netlink_broadcast() only reports ESRCH errors and silently ignore NOBUFS errors.

pub fn get_broadcast_error(&self) -> Result<bool>[src]

pub fn set_no_enobufs(&mut self, value: bool) -> Result<()>[src]

NETLINK_NO_ENOBUFS (since Linux 2.6.30). This flag can be used by unicast and broadcast listeners to avoid receiving ENOBUFS errors.

pub fn get_no_enobufs(&self) -> Result<bool>[src]

pub fn set_listen_all_namespaces(&mut self, value: bool) -> Result<()>[src]

NETLINK_LISTEN_ALL_NSID (since Linux 4.2). When set, this socket will receive netlink notifications from all network namespaces that have an nsid assigned into the network namespace where the socket has been opened. The nsid is sent to user space via an ancillary data.

pub fn get_listen_all_namespaces(&self) -> Result<bool>[src]

pub fn set_cap_ack(&mut self, value: bool) -> Result<()>[src]

NETLINK_CAP_ACK (since Linux 4.2). The kernel may fail to allocate the necessary room for the acknowledgment message back to user space. This option trims off the payload of the original netlink message. The netlink message header is still included, so the user can guess from the sequence number which message triggered the acknowledgment.

pub fn get_cap_ack(&self) -> Result<bool>[src]

Trait Implementations

impl AsRawFd for Socket[src]

impl Clone for Socket[src]

impl Debug for Socket[src]

impl Drop for Socket[src]

impl FromRawFd for Socket[src]

Auto Trait Implementations

impl RefUnwindSafe for Socket

impl Send for Socket

impl Sync for Socket

impl Unpin for Socket

impl UnwindSafe for Socket

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.