ip_mreq

Contains multicast membership information.

Service:Networking

Syntax

  #include <netinet/in.h>
  
  struct ip_mreq
  {
     struct in_addr    imr_multiaddr;
     struct in_addr    imr_interface;
  };
  

Fields

imr_multiaddr

Specifies the IP multicast address of the group.

imr_interface

Specifies the local IP address of the interface.

Remarks

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.