[−][src]Struct neli::socket::NlSocket
Low level access to a netlink socket.
Implementations
impl NlSocket
[src]
pub fn new(proto: NlFamily) -> Result<Self, Error>
[src]
Wrapper around socket()
syscall filling in the
netlink-specific information.
pub fn connect(
proto: NlFamily,
pid: Option<u32>,
groups: U32Bitmask
) -> Result<Self, Error>
[src]
proto: NlFamily,
pid: Option<u32>,
groups: U32Bitmask
) -> Result<Self, Error>
Equivalent of socket
and bind
calls.
pub fn block(&self) -> Result<(), Error>
[src]
Set underlying socket file descriptor to be blocking.
pub fn nonblock(&self) -> Result<(), Error>
[src]
Set underlying socket file descriptor to be non blocking.
pub fn is_blocking(&self) -> Result<bool, Error>
[src]
Determines if underlying file descriptor is blocking.
pub fn bind(&self, pid: Option<u32>, groups: U32Bitmask) -> Result<(), Error>
[src]
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.
pub fn add_mcast_membership(&self, groups: U32Bitmask) -> Result<(), Error>
[src]
Join multicast groups for a socket.
pub fn drop_mcast_membership(&self, groups: U32Bitmask) -> Result<(), Error>
[src]
Leave multicast groups for a socket.
pub fn list_mcast_membership(&self) -> Result<U32Bitmask, Error>
[src]
List joined groups for a socket.
pub fn send<B>(&self, buf: B, flags: i32) -> Result<size_t, Error> where
B: AsRef<[u8]>,
[src]
B: AsRef<[u8]>,
Send message encoded as byte slice to the netlink ID
specified in the netlink header
Nlmsghdr
pub fn recv<B>(&self, buf: B, flags: i32) -> Result<size_t, Error> where
B: AsMut<[u8]>,
[src]
B: AsMut<[u8]>,
Receive message encoded as byte slice from the netlink socket.
Trait Implementations
impl AsRawFd for NlSocket
[src]
impl Drop for NlSocket
[src]
impl From<NlSocketHandle> for NlSocket
[src]
pub fn from(s: NlSocketHandle) -> Self
[src]
impl FromRawFd for NlSocket
[src]
pub unsafe fn from_raw_fd(fd: RawFd) -> Self
[src]
impl IntoRawFd for NlSocket
[src]
pub fn into_raw_fd(self) -> RawFd
[src]
Auto Trait Implementations
impl RefUnwindSafe for NlSocket
[src]
impl Send for NlSocket
[src]
impl Sync for NlSocket
[src]
impl Unpin for NlSocket
[src]
impl UnwindSafe for NlSocket
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,