Contains multicast membership information.
#include <netinet/in.h> struct ip_mreq { struct in_addr imr_multiaddr; struct in_addr imr_interface; };
Specifies the IP multicast address of the group.
Specifies the local IP address of the interface.
The setsockopt function uses the ip_mreq structure to add or remove members from a multicast group when the level parameter is set to IPPROTO_IP, the option parameter is set to IP_ADD_MEMBERSHIP or IP_DROP_MEMBERSHIP, and the optval parameter points to this structure.