Skip to content

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

Open
Sh3Rm4n wants to merge 8 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 8 commits intorust-netlink:mainfrom
Sh3Rm4n:feat/multi-cast

Conversation

@Sh3Rm4n
Copy link
Copy Markdown
Contributor

@Sh3Rm4n Sh3Rm4n commented Sep 5, 2025

Continuation of #12

Comment thread src/resolver.rs Outdated
let mut genlmsg: GenlMessage<GenlCtrl> =
GenlMessage::from_payload(GenlCtrl {
cmd: GenlCtrlCmd::GetFamily,
nlas: vec![GenlCtrlAttrs::FamilyName(
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Member

@Sh3Rm4n ping

@Sh3Rm4n Sh3Rm4n requested a review from cathay4t March 11, 2026 09:47
@Sh3Rm4n
Copy link
Copy Markdown
Contributor Author

Sh3Rm4n commented Mar 11, 2026

I've unified the interface based on #16 (comment)

Instead of removing, I've deprecated obsolete functions, so that this PR is not a breaking change. If this doesn't matter, I could remove those deprecated functions as well.

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