INET Framework for OMNeT++/OMNEST
inet::IPv4InterfaceData::HostMulticastGroupData Struct Reference

#include <IPv4InterfaceData.h>

Public Member Functions

 HostMulticastGroupData (IPv4Address multicastGroup)
 
bool updateSourceList ()
 Computes the filterMode and sourceList of the interface from the socket reference counts according to RFC3376 3.2. More...
 

Public Attributes

IPv4Address multicastGroup
 
std::map< IPv4Address, int > includeCounts
 
std::map< IPv4Address, int > excludeCounts
 
int numOfExcludeModeSockets
 
IPv4MulticastSourceList sourceList
 

Constructor & Destructor Documentation

inet::IPv4InterfaceData::HostMulticastGroupData::HostMulticastGroupData ( IPv4Address  multicastGroup)
inline
IPv4Address multicastGroup
Definition: IPv4InterfaceData.h:101
int numOfExcludeModeSockets
Definition: IPv4InterfaceData.h:104

Member Function Documentation

bool inet::IPv4InterfaceData::HostMulticastGroupData::updateSourceList ( )

Computes the filterMode and sourceList of the interface from the socket reference counts according to RFC3376 3.2.

Returns true if filterMode or sourceList has been changed.

Referenced by inet::IPv4InterfaceData::changeMulticastGroupMembership().

296 {
297  // Filter mode is EXCLUDE if any of the sockets are in EXCLUDE mode, otherwise INCLUDE
299 
301  if (numOfExcludeModeSockets == 0) {
302  // If all socket is in INCLUDE mode, then the sourceList is the union of included sources
303  for (auto & elem : includeCounts)
304  sourceList.push_back(elem.first);
305  }
306  else {
307  // If some socket is in EXCLUDE mode, then the sourceList contains the sources that are
308  // excluded by all EXCLUDE mode sockets except if there is a socket including the source.
309  for (auto & elem : excludeCounts)
310  if (elem.second == numOfExcludeModeSockets && includeCounts.find(elem.first) == includeCounts.end())
311  sourceList.push_back(elem.first);
312 
313  }
314 
315  if (this->sourceList.filterMode != filterMode || this->sourceList.sources != sourceList) {
316  this->sourceList.filterMode = filterMode;
317  this->sourceList.sources = sourceList;
318  return true;
319  }
320  else
321  return false;
322 }
IPv4MulticastSourceList sourceList
Definition: IPv4InterfaceData.h:107
std::vector< IPv4Address > IPv4AddressVector
Definition: IPv4InterfaceData.h:92
McastSourceFilterMode filterMode
Definition: IPv4InterfaceData.h:38
std::map< IPv4Address, int > excludeCounts
Definition: IPv4InterfaceData.h:103
int numOfExcludeModeSockets
Definition: IPv4InterfaceData.h:104
Definition: InterfaceEntry.h:44
Definition: InterfaceEntry.h:44
McastSourceFilterMode
Definition: InterfaceEntry.h:44
std::map< IPv4Address, int > includeCounts
Definition: IPv4InterfaceData.h:102

Member Data Documentation

std::map<IPv4Address, int> inet::IPv4InterfaceData::HostMulticastGroupData::excludeCounts
std::map<IPv4Address, int> inet::IPv4InterfaceData::HostMulticastGroupData::includeCounts
IPv4Address inet::IPv4InterfaceData::HostMulticastGroupData::multicastGroup
int inet::IPv4InterfaceData::HostMulticastGroupData::numOfExcludeModeSockets
IPv4MulticastSourceList inet::IPv4InterfaceData::HostMulticastGroupData::sourceList

The documentation for this struct was generated from the following files: