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 } … } }