'Which all multicast groups are available under custom netlink protocol

I am trying to send a notification message from a kernel module to user space application using netlink sockets interface and custom netlink protocol.

My understanding is that,to achieve this communication we need to assign the user application to group(32 bit value) where each bit represent a group.The nl_groups field in struct sockaddr_nl represent the group to which the userspace application is assigned.

1)When i assign the userspace application to either group0 or group1 by setting the bit0 or bit1 position in nl_groups field the notification message is successfully sent from kernel module to userspace application.

2)But if i assign the userspace application to any other group(from bit2-bit31),the kernel module fails to send message and returns error number as -3(No such process).

How to know which all multicast groups are available under any netlink protocol.

Any inputs on this issue will be helpful as i have just started with linux kernel programming.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source