Results 1 to 1 of 1
I'm now working on a project about multicasting and I had came across the struct group_req as follow:
Code:
struct group_req
{
__u32 gr_interface; /* interface index */
struct __kernel_sockaddr_storage ...
- 03-19-2009 #1Just Joined!
- Join Date
- Nov 2008
- Posts
- 25
Question about struct group_req
I'm now working on a project about multicasting and I had came across the struct group_req as follow:
what I found from online resources about gr_interface is that the interface index of the local interface on which the multicast group should be joined or dropped.Code:struct group_req { __u32 gr_interface; /* interface index */ struct __kernel_sockaddr_storage gr_group; /* group address */ };
However, what is interface index regarded here? In Ubuntu 8.04, the interfaces shown by using ifconfig command is "eth0" and "wlan0". Do they have the same interface index (i.e. "0")? If they do, how the struct group_req differentiate them? I used if_nametoindex() function when assigning value to the member gr_interface.
Or I totally misunderstood the meaning of gr_interface or if_nametoindex() function? Can anyone gives me some guide?
Thanks.


Reply With Quote