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

◆ HostMulticastGroupData()

inet::Ipv4InterfaceData::HostMulticastGroupData::HostMulticastGroupData ( Ipv4Address  multicastGroup)
inline

Member Function Documentation

◆ updateSourceList()

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.

286 {
287  // Filter mode is EXCLUDE if any of the sockets are in EXCLUDE mode, otherwise INCLUDE
289 
291  if (numOfExcludeModeSockets == 0) {
292  // If all socket is in INCLUDE mode, then the sourceList is the union of included sources
293  for (auto& elem : includeCounts)
294  sourceList.push_back(elem.first);
295  }
296  else {
297  // If some socket is in EXCLUDE mode, then the sourceList contains the sources that are
298  // excluded by all EXCLUDE mode sockets except if there is a socket including the source.
299  for (auto& elem : excludeCounts)
300  if (elem.second == numOfExcludeModeSockets && !containsKey(includeCounts, elem.first))
301  sourceList.push_back(elem.first);
302  }
303 
304  if (this->sourceList.filterMode != filterMode || this->sourceList.sources != sourceList) {
305  this->sourceList.filterMode = filterMode;
306  this->sourceList.sources = sourceList;
307  return true;
308  }
309  else
310  return false;
311 }

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

Member Data Documentation

◆ excludeCounts

std::map<Ipv4Address, int> inet::Ipv4InterfaceData::HostMulticastGroupData::excludeCounts

◆ includeCounts

std::map<Ipv4Address, int> inet::Ipv4InterfaceData::HostMulticastGroupData::includeCounts

◆ multicastGroup

Ipv4Address inet::Ipv4InterfaceData::HostMulticastGroupData::multicastGroup

◆ numOfExcludeModeSockets

int inet::Ipv4InterfaceData::HostMulticastGroupData::numOfExcludeModeSockets

◆ sourceList

Ipv4MulticastSourceList inet::Ipv4InterfaceData::HostMulticastGroupData::sourceList

The documentation for this struct was generated from the following files:
inet::Ipv4MulticastSourceList::filterMode
McastSourceFilterMode filterMode
Definition: Ipv4InterfaceData.h:21
inet::Ipv4InterfaceData::HostMulticastGroupData::numOfExcludeModeSockets
int numOfExcludeModeSockets
Definition: Ipv4InterfaceData.h:86
inet::Ipv4InterfaceData::Ipv4AddressVector
std::vector< Ipv4Address > Ipv4AddressVector
Definition: Ipv4InterfaceData.h:75
inet::Ipv4InterfaceData::HostMulticastGroupData::includeCounts
std::map< Ipv4Address, int > includeCounts
Definition: Ipv4InterfaceData.h:84
inet::McastSourceFilterMode
McastSourceFilterMode
Definition: NetworkInterface.h:33
inet::Ipv4InterfaceData::HostMulticastGroupData::multicastGroup
Ipv4Address multicastGroup
Definition: Ipv4InterfaceData.h:83
inet::Ipv4InterfaceData::HostMulticastGroupData::sourceList
Ipv4MulticastSourceList sourceList
Definition: Ipv4InterfaceData.h:89
inet::MCAST_EXCLUDE_SOURCES
@ MCAST_EXCLUDE_SOURCES
Definition: NetworkInterface.h:33
inet::MCAST_INCLUDE_SOURCES
@ MCAST_INCLUDE_SOURCES
Definition: NetworkInterface.h:33
inet::Ipv4InterfaceData::HostMulticastGroupData::excludeCounts
std::map< Ipv4Address, int > excludeCounts
Definition: Ipv4InterfaceData.h:85
inet::containsKey
bool containsKey(const std::map< K, V, _C > &m, const Tk &a)
Definition: stlutils.h:80