Struct base::sys::linux::NetlinkGenericRead
source · pub struct NetlinkGenericRead {
allocation: LayoutAllocation,
len: usize,
}
Fields§
§allocation: LayoutAllocation
§len: usize
Implementations§
source§impl NetlinkGenericRead
impl NetlinkGenericRead
pub fn iter(&self) -> NetlinkMessageIter<'_> ⓘ
sourcepub fn get_multicast_group_id(&self, group_name: String) -> Option<u32>
pub fn get_multicast_group_id(&self, group_name: String) -> Option<u32>
Parse NetlinkGeneric response in order to get multicast group id
On success, returns group_id for a given group_name
§Arguments
group_name
- String with group_name for which we are looking group_id
Response from family_name_query (CTRL_CMD_GETFAMILY) is a netlink message with multiple attributes encapsulated (some of them are nested). An example response layout is illustrated below:
{ CTRL_ATTR_FAMILY_NAME CTRL_ATTR_FAMILY_ID CTRL_ATTR_VERSION … CTRL_ATTR_MCAST_GROUPS { GR1 (nl_attr._type = 1) { CTRL_ATTR_MCAST_GRP_ID *we need parse this attr to obtain group id used for the group mask CTRL_ATTR_MCAST_GRP_NAME *group_name that we need to match with } GR2 (nl_attr._type = 2) { CTRL_ATTR_MCAST_GRP_ID CTRL_ATTR_MCAST_GRP_NAME } … } }
Auto Trait Implementations§
impl RefUnwindSafe for NetlinkGenericRead
impl !Send for NetlinkGenericRead
impl !Sync for NetlinkGenericRead
impl Unpin for NetlinkGenericRead
impl UnwindSafe for NetlinkGenericRead
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more