Can we add this to libnl?

Thomas Graf tgraf at suug.ch
Wed Jul 16 01:57:19 PDT 2014


On 07/15/14 at 08:57pm, Andy Grover wrote:
> Hi all,
> 
> I was in the process of writing some genl code, and happened upon code
> implementing nl_get_multicast_id() in the iw repo[1] that did exactly what I
> needed... and in fact the source file has a comment "this ought to be
> provided by libnl" :-)
> 
> So before I cut and paste this code into my project, what do you all think
> about doing just that, and including this function in libnl?
> 
> Code attached.

If i'm not mistaken libnl already provides such an API [0]:

#include <netlink/genl/ctrl.h>

/**
 * Resolve Generic Netlink family group name
 * @arg sk              Generic Netlink socket
 * @arg family_name     Name of Generic Netlink family
 * @arg grp_name        Name of group to resolve
 *
 * Looks up the family object and resolves the group name to the numeric
 * group identifier.
 *
 * @return Numeric group identifier or a negative error code.
 */
int genl_ctrl_resolve_grp(struct nl_sock *sk, const char *family_name,
                          const char *grp_name)

[0] http://www.infradead.org/~tgr/libnl/doc/api/group__genl__ctrl.html#gae4be9d99838db33cabc818cd6db6e26c



More information about the libnl mailing list