Skip to content

Comments

Add ability to resolve (and cache) multicast groups for a given family name#16

Open
Sh3Rm4n wants to merge 7 commits intorust-netlink:mainfrom
Sh3Rm4n:feat/multi-cast
Open

Add ability to resolve (and cache) multicast groups for a given family name#16
Sh3Rm4n wants to merge 7 commits intorust-netlink:mainfrom
Sh3Rm4n:feat/multi-cast

Conversation

@Sh3Rm4n
Copy link
Contributor

@Sh3Rm4n Sh3Rm4n commented Sep 5, 2025

Continuation of #12

let mut genlmsg: GenlMessage<GenlCtrl> =
GenlMessage::from_payload(GenlCtrl {
cmd: GenlCtrlCmd::GetFamily,
nlas: vec![GenlCtrlAttrs::FamilyName(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this multicast group is also in GetFamily reply, I think we should merge this function into query_family_id(), so we have single netlink request to get both caches ready.

Copy link
Contributor Author

@Sh3Rm4n Sh3Rm4n Dec 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. But in that case query_family_ids function signature does not really fit anymore.

What about

fn query_family(&mut self, handle: &GenetlinkHandle, family_name: &str) -> (u16, HashMap<String, u32>)

which returns both id and the groups. At this point, I should probably introduce a struct instead of the tuple from above.

We could still keep query_family_id (and query_family_multicast_groups, which would call query_family internally for backwards compatibility. WDTY?

@cathay4t
Copy link
Member

@Sh3Rm4n ping

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants