pub fn bind(&self, pid: Option<u32>, groups: U32Bitmask) -> Result<(), io::Error> {
        let mut nladdr = unsafe { zeroed::<libc::sockaddr_nl>() };
        nladdr.nl_family = libc::c_int::from(AddrFamily::Netlink) as u16;
        nladdr.nl_pid = pid.unwrap_or(0);
        nladdr.nl_groups = 0;
        match unsafe {
            libc::bind(
                self.fd,
                &nladdr as *const _ as *const libc::sockaddr,
                size_of::<libc::sockaddr_nl>() as u32,
            )
        } {
            i if i >= 0 => (),
            _ => return Err(io::Error::last_os_error()),
        };
        if !groups.is_empty() {
            self.add_mcast_membership(groups)?;
        }
        Ok(())
    }
/// 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.
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.
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 bind(&self, pid: Option<u32>, groups: U32Bitmask) -> Result<(), io::Error> {
        let mut nladdr = unsafe { zeroed::<libc::sockaddr_nl>() };
        nladdr.nl_family = libc::c_int::from(AddrFamily::Netlink) as u16;
        nladdr.nl_pid = pid.unwrap_or(0);
        nladdr.nl_groups = 0;
        match unsafe {
            libc::bind(
                self.fd,
                &nladdr as *const _ as *const libc::sockaddr,
                size_of::<libc::sockaddr_nl>() as u32,
            )
        } {
            i if i >= 0 => (),
            _ => return Err(io::Error::last_os_error()),
        };
        if !groups.is_empty() {
            self.add_mcast_membership(groups)?;
        }
        Ok(())
    }
pub fn bind ( & self , pid : Option < u32 > , groups : U32Bitmask ) -> Result < ( ) , io :: Error > { let mut nladdr = unsafe { zeroed :: < libc :: sockaddr_nl > ( ) } ; nladdr . nl_family = libc :: c_int :: from ( AddrFamily :: Netlink ) as u16 ; nladdr . nl_pid = pid . unwrap_or ( 0 ) ; nladdr . nl_groups = 0 ; match unsafe { libc :: bind ( self . fd , & nladdr as * const _ as * const libc :: sockaddr , size_of :: < libc :: sockaddr_nl > ( ) as u32 , ) } { i if i >= 0 => ( ) , _ => return Err ( io :: Error :: last_os_error ( ) ) , } ; if ! groups . is_empty ( ) { self . add_mcast_membership ( groups ) ? ; } Ok ( ( ) ) }
Use this function to bind to a netlink ID and subscribe to
groups.
Use this function to bind to a netlink ID and subscribe to groups .
&self
pid
Option<u32>
groups
U32Bitmask
&self
pid
Option<u32>
groups
U32Bitmask