INET Framework for OMNeT++/OMNEST
inet::IGMPv2 Class Reference

#include <IGMPv2.h>

Inheritance diagram for inet::IGMPv2:

Classes

struct  HostGroupData
 
struct  HostInterfaceData
 
struct  IGMPHostTimerContext
 
struct  IGMPRouterTimerContext
 
struct  RouterGroupData
 
struct  RouterInterfaceData
 

Protected Types

enum  RouterState { IGMP_RS_INITIAL, IGMP_RS_QUERIER, IGMP_RS_NON_QUERIER }
 
enum  RouterGroupState { IGMP_RGS_NO_MEMBERS_PRESENT, IGMP_RGS_MEMBERS_PRESENT, IGMP_RGS_V1_MEMBERS_PRESENT, IGMP_RGS_CHECKING_MEMBERSHIP }
 
enum  HostGroupState { IGMP_HGS_NON_MEMBER, IGMP_HGS_DELAYING_MEMBER, IGMP_HGS_IDLE_MEMBER }
 
enum  IGMPTimerKind { IGMP_QUERY_TIMER, IGMP_HOSTGROUP_TIMER, IGMP_LEAVE_TIMER, IGMP_REXMT_TIMER }
 
typedef std::map< IPv4Address, HostGroupData * > GroupToHostDataMap
 
typedef std::map< IPv4Address, RouterGroupData * > GroupToRouterDataMap
 
typedef std::map< int, HostInterfaceData * > InterfaceToHostDataMap
 
typedef std::map< int, RouterInterfaceData * > InterfaceToRouterDataMap
 

Protected Member Functions

virtual int numInitStages () const override
 
virtual void initialize (int stage) override
 
virtual void handleMessage (cMessage *msg) override
 
virtual void receiveSignal (cComponent *source, simsignal_t signalID, cObject *obj, cObject *details) override
 
virtual ~IGMPv2 ()
 
virtual HostInterfaceDatacreateHostInterfaceData ()
 
virtual RouterInterfaceDatacreateRouterInterfaceData ()
 
virtual HostGroupDatacreateHostGroupData (InterfaceEntry *ie, const IPv4Address &group)
 
virtual RouterGroupDatacreateRouterGroupData (InterfaceEntry *ie, const IPv4Address &group)
 
virtual HostInterfaceDatagetHostInterfaceData (InterfaceEntry *ie)
 
virtual RouterInterfaceDatagetRouterInterfaceData (InterfaceEntry *ie)
 
virtual HostGroupDatagetHostGroupData (InterfaceEntry *ie, const IPv4Address &group)
 
virtual RouterGroupDatagetRouterGroupData (InterfaceEntry *ie, const IPv4Address &group)
 
virtual void deleteHostInterfaceData (int interfaceId)
 
virtual void deleteRouterInterfaceData (int interfaceId)
 
virtual void deleteHostGroupData (InterfaceEntry *ie, const IPv4Address &group)
 
virtual void deleteRouterGroupData (InterfaceEntry *ie, const IPv4Address &group)
 
virtual void configureInterface (InterfaceEntry *ie)
 
virtual void multicastGroupJoined (InterfaceEntry *ie, const IPv4Address &groupAddr)
 
virtual void multicastGroupLeft (InterfaceEntry *ie, const IPv4Address &groupAddr)
 
virtual void startTimer (cMessage *timer, double interval)
 
virtual void startHostTimer (InterfaceEntry *ie, HostGroupData *group, double maxRespTime)
 
virtual void sendQuery (InterfaceEntry *ie, const IPv4Address &groupAddr, double maxRespTime)
 
virtual void sendReport (InterfaceEntry *ie, HostGroupData *group)
 
virtual void sendLeave (InterfaceEntry *ie, HostGroupData *group)
 
virtual void sendToIP (IGMPMessage *msg, InterfaceEntry *ie, const IPv4Address &dest)
 
virtual void processQueryTimer (cMessage *msg)
 
virtual void processHostGroupTimer (cMessage *msg)
 
virtual void processLeaveTimer (cMessage *msg)
 
virtual void processRexmtTimer (cMessage *msg)
 
virtual void processIgmpMessage (IGMPMessage *msg)
 
virtual void processQuery (InterfaceEntry *ie, const IPv4Address &sender, IGMPQuery *msg)
 
virtual void processGroupQuery (InterfaceEntry *ie, HostGroupData *group, int maxRespTime)
 
virtual void processV2Report (InterfaceEntry *ie, IGMPv2Report *msg)
 
virtual void processLeave (InterfaceEntry *ie, IGMPv2Leave *msg)
 

Protected Attributes

IIPv4RoutingTablert
 
IInterfaceTableift
 
bool enabled
 
bool externalRouter
 
int robustness
 
double queryInterval
 
double queryResponseInterval
 
double groupMembershipInterval
 
double otherQuerierPresentInterval
 
double startupQueryInterval
 
double startupQueryCount
 
double lastMemberQueryInterval
 
double lastMemberQueryCount
 
double unsolicitedReportInterval
 
InterfaceToHostDataMap hostData
 
InterfaceToRouterDataMap routerData
 
int numGroups
 
int numHostGroups
 
int numRouterGroups
 
int numQueriesSent
 
int numQueriesRecv
 
int numGeneralQueriesSent
 
int numGeneralQueriesRecv
 
int numGroupSpecificQueriesSent
 
int numGroupSpecificQueriesRecv
 
int numReportsSent
 
int numReportsRecv
 
int numLeavesSent
 
int numLeavesRecv
 

Member Typedef Documentation

typedef std::map<int, HostInterfaceData *> inet::IGMPv2::InterfaceToHostDataMap
protected
typedef std::map<int, RouterInterfaceData *> inet::IGMPv2::InterfaceToRouterDataMap
protected

Member Enumeration Documentation

Enumerator
IGMP_HGS_NON_MEMBER 
IGMP_HGS_DELAYING_MEMBER 
IGMP_HGS_IDLE_MEMBER 
Enumerator
IGMP_QUERY_TIMER 
IGMP_HOSTGROUP_TIMER 
IGMP_LEAVE_TIMER 
IGMP_REXMT_TIMER 
106  {
111  };
Definition: IGMPv2.h:108
Definition: IGMPv2.h:110
Definition: IGMPv2.h:109
Definition: IGMPv2.h:107
Enumerator
IGMP_RGS_NO_MEMBERS_PRESENT 
IGMP_RGS_MEMBERS_PRESENT 
IGMP_RGS_V1_MEMBERS_PRESENT 
IGMP_RGS_CHECKING_MEMBERSHIP 
enum inet::IGMPv2::RouterState
protected
Enumerator
IGMP_RS_INITIAL 
IGMP_RS_QUERIER 
IGMP_RS_NON_QUERIER 
37  {
41  };
Definition: IGMPv2.h:40
Definition: IGMPv2.h:38
Definition: IGMPv2.h:39

Constructor & Destructor Documentation

inet::IGMPv2::~IGMPv2 ( )
protectedvirtual
399 {
400  while (!hostData.empty())
401  deleteHostInterfaceData(hostData.begin()->first);
402  while (!routerData.empty())
403  deleteRouterInterfaceData(routerData.begin()->first);
404 }
virtual void deleteRouterInterfaceData(int interfaceId)
Definition: IGMPv2.cc:294
InterfaceToRouterDataMap routerData
Definition: IGMPv2.h:147
virtual void deleteHostInterfaceData(int interfaceId)
Definition: IGMPv2.cc:284
InterfaceToHostDataMap hostData
Definition: IGMPv2.h:146

Member Function Documentation

void inet::IGMPv2::configureInterface ( InterfaceEntry ie)
protectedvirtual

Referenced by initialize(), and receiveSignal().

438 {
440  // start querier on this interface
441  cMessage *timer = new cMessage("IGMPv2 query timer", IGMP_QUERY_TIMER);
442  timer->setContextPointer(ie);
443  RouterInterfaceData *routerData = getRouterInterfaceData(ie);
444  routerData->igmpQueryTimer = timer;
445  routerData->igmpRouterState = IGMP_RS_QUERIER;
446  sendQuery(ie, IPv4Address(), queryResponseInterval); // general query
448  }
449 }
IIPv4RoutingTable * rt
Definition: IGMPv2.h:128
Definition: IGMPv2.h:39
bool externalRouter
Definition: IGMPv2.h:132
virtual void startTimer(cMessage *timer, double interval)
Definition: IGMPv2.cc:530
InterfaceToRouterDataMap routerData
Definition: IGMPv2.h:147
virtual void sendQuery(InterfaceEntry *ie, const IPv4Address &groupAddr, double maxRespTime)
Definition: IGMPv2.cc:549
virtual bool isMulticastForwardingEnabled() const =0
Multicast forwarding on/off.
double startupQueryInterval
Definition: IGMPv2.h:138
Definition: IGMPv2.h:107
double queryResponseInterval
Definition: IGMPv2.h:135
virtual RouterInterfaceData * getRouterInterfaceData(InterfaceEntry *ie)
Definition: IGMPv2.cc:257
bool enabled
Definition: IGMPv2.h:131
IGMPv2::HostGroupData * inet::IGMPv2::createHostGroupData ( InterfaceEntry ie,
const IPv4Address group 
)
protectedvirtual

Referenced by multicastGroupJoined().

227 {
228  HostInterfaceData *interfaceData = getHostInterfaceData(ie);
229  ASSERT(interfaceData->groups.find(group) == interfaceData->groups.end());
230  HostGroupData *data = new HostGroupData(this, group);
231  interfaceData->groups[group] = data;
232  return data;
233 }
virtual HostInterfaceData * getHostInterfaceData(InterfaceEntry *ie)
Definition: IGMPv2.cc:244
IGMPv2::HostInterfaceData * inet::IGMPv2::createHostInterfaceData ( )
protectedvirtual

Referenced by getHostInterfaceData().

217 {
218  return new HostInterfaceData(this);
219 }
IGMPv2::RouterGroupData * inet::IGMPv2::createRouterGroupData ( InterfaceEntry ie,
const IPv4Address group 
)
protectedvirtual

Referenced by processV2Report().

236 {
237  RouterInterfaceData *interfaceData = getRouterInterfaceData(ie);
238  ASSERT(interfaceData->groups.find(group) == interfaceData->groups.end());
239  RouterGroupData *data = new RouterGroupData(this, group);
240  interfaceData->groups[group] = data;
241  return data;
242 }
virtual RouterInterfaceData * getRouterInterfaceData(InterfaceEntry *ie)
Definition: IGMPv2.cc:257
IGMPv2::RouterInterfaceData * inet::IGMPv2::createRouterInterfaceData ( )
protectedvirtual

Referenced by getRouterInterfaceData().

222 {
223  return new RouterInterfaceData(this);
224 }
void inet::IGMPv2::deleteHostGroupData ( InterfaceEntry ie,
const IPv4Address group 
)
protectedvirtual

Referenced by multicastGroupLeft().

305 {
306  HostInterfaceData *interfaceData = getHostInterfaceData(ie);
307  auto it = interfaceData->groups.find(group);
308  if (it != interfaceData->groups.end()) {
309  HostGroupData *data = it->second;
310  interfaceData->groups.erase(it);
311  delete data;
312  }
313 }
virtual HostInterfaceData * getHostInterfaceData(InterfaceEntry *ie)
Definition: IGMPv2.cc:244
void inet::IGMPv2::deleteHostInterfaceData ( int  interfaceId)
protectedvirtual

Referenced by receiveSignal(), and ~IGMPv2().

285 {
286  auto interfaceIt = hostData.find(interfaceId);
287  if (interfaceIt != hostData.end()) {
288  HostInterfaceData *interface = interfaceIt->second;
289  hostData.erase(interfaceIt);
290  delete interface;
291  }
292 }
InterfaceToHostDataMap hostData
Definition: IGMPv2.h:146
void inet::IGMPv2::deleteRouterGroupData ( InterfaceEntry ie,
const IPv4Address group 
)
protectedvirtual

Referenced by processLeaveTimer().

316 {
317  RouterInterfaceData *interfaceData = getRouterInterfaceData(ie);
318  auto it = interfaceData->groups.find(group);
319  if (it != interfaceData->groups.end()) {
320  RouterGroupData *data = it->second;
321  interfaceData->groups.erase(it);
322  delete data;
323  }
324 }
virtual RouterInterfaceData * getRouterInterfaceData(InterfaceEntry *ie)
Definition: IGMPv2.cc:257
void inet::IGMPv2::deleteRouterInterfaceData ( int  interfaceId)
protectedvirtual

Referenced by receiveSignal(), and ~IGMPv2().

295 {
296  auto interfaceIt = routerData.find(interfaceId);
297  if (interfaceIt != routerData.end()) {
298  RouterInterfaceData *interface = interfaceIt->second;
299  routerData.erase(interfaceIt);
300  delete interface;
301  }
302 }
InterfaceToRouterDataMap routerData
Definition: IGMPv2.h:147
IGMPv2::HostGroupData * inet::IGMPv2::getHostGroupData ( InterfaceEntry ie,
const IPv4Address group 
)
protectedvirtual

Referenced by multicastGroupLeft(), and processV2Report().

271 {
272  HostInterfaceData *interfaceData = getHostInterfaceData(ie);
273  auto it = interfaceData->groups.find(group);
274  return it != interfaceData->groups.end() ? it->second : nullptr;
275 }
virtual HostInterfaceData * getHostInterfaceData(InterfaceEntry *ie)
Definition: IGMPv2.cc:244
IGMPv2::HostInterfaceData * inet::IGMPv2::getHostInterfaceData ( InterfaceEntry ie)
protectedvirtual

Referenced by createHostGroupData(), deleteHostGroupData(), getHostGroupData(), and processQuery().

245 {
246  int interfaceId = ie->getInterfaceId();
247  auto it = hostData.find(interfaceId);
248  if (it != hostData.end())
249  return it->second;
250 
251  // create one
252  HostInterfaceData *data = createHostInterfaceData();
253  hostData[interfaceId] = data;
254  return data;
255 }
virtual HostInterfaceData * createHostInterfaceData()
Definition: IGMPv2.cc:216
InterfaceToHostDataMap hostData
Definition: IGMPv2.h:146
IGMPv2::RouterGroupData * inet::IGMPv2::getRouterGroupData ( InterfaceEntry ie,
const IPv4Address group 
)
protectedvirtual

Referenced by processLeave(), processQuery(), and processV2Report().

278 {
279  RouterInterfaceData *interfaceData = getRouterInterfaceData(ie);
280  auto it = interfaceData->groups.find(group);
281  return it != interfaceData->groups.end() ? it->second : nullptr;
282 }
virtual RouterInterfaceData * getRouterInterfaceData(InterfaceEntry *ie)
Definition: IGMPv2.cc:257
IGMPv2::RouterInterfaceData * inet::IGMPv2::getRouterInterfaceData ( InterfaceEntry ie)
protectedvirtual

Referenced by configureInterface(), createRouterGroupData(), deleteRouterGroupData(), getRouterGroupData(), processLeave(), processQuery(), processQueryTimer(), and sendQuery().

258 {
259  int interfaceId = ie->getInterfaceId();
260  auto it = routerData.find(interfaceId);
261  if (it != routerData.end())
262  return it->second;
263 
264  // create one
265  RouterInterfaceData *data = createRouterInterfaceData();
266  routerData[interfaceId] = data;
267  return data;
268 }
virtual RouterInterfaceData * createRouterInterfaceData()
Definition: IGMPv2.cc:221
InterfaceToRouterDataMap routerData
Definition: IGMPv2.h:147
void inet::IGMPv2::handleMessage ( cMessage *  msg)
overrideprotectedvirtual
452 {
453  if (!enabled) {
454  if (!msg->isSelfMessage()) {
455  EV_ERROR << "IGMPv2 disabled, dropping packet.\n";
456  delete msg;
457  }
458  return;
459  }
460 
461  if (msg->isSelfMessage()) {
462  switch (msg->getKind()) {
463  case IGMP_QUERY_TIMER:
464  processQueryTimer(msg);
465  break;
466 
469  break;
470 
471  case IGMP_LEAVE_TIMER:
472  processLeaveTimer(msg);
473  break;
474 
475  case IGMP_REXMT_TIMER:
476  processRexmtTimer(msg);
477  break;
478 
479  default:
480  ASSERT(false);
481  break;
482  }
483  }
484  else if (!strcmp(msg->getArrivalGate()->getName(), "routerIn"))
485  send(msg, "ipOut");
486  else if (dynamic_cast<IGMPMessage *>(msg))
487  processIgmpMessage((IGMPMessage *)msg);
488  else
489  ASSERT(false);
490 }
Definition: IGMPv2.h:108
virtual void processRexmtTimer(cMessage *msg)
Definition: IGMPv2.cc:687
virtual void processHostGroupTimer(cMessage *msg)
Definition: IGMPv2.cc:661
virtual void processIgmpMessage(IGMPMessage *msg)
Definition: IGMPv2.cc:615
Definition: IGMPv2.h:110
Definition: IGMPv2.h:109
virtual void processLeaveTimer(cMessage *msg)
Definition: IGMPv2.cc:670
Definition: IGMPv2.h:107
virtual void processQueryTimer(cMessage *msg)
Definition: IGMPv2.cc:647
bool enabled
Definition: IGMPv2.h:131
void inet::IGMPv2::initialize ( int  stage)
overrideprotectedvirtual
327 {
328  cSimpleModule::initialize(stage);
329 
330  if (stage == INITSTAGE_LOCAL) {
331  ift = getModuleFromPar<IInterfaceTable>(par("interfaceTableModule"), this);
332  rt = getModuleFromPar<IIPv4RoutingTable>(par("routingTableModule"), this);
333 
334  cModule *host = getContainingNode(this);
335  host->subscribe(NF_INTERFACE_DELETED, this);
336  host->subscribe(NF_IPv4_MCAST_JOIN, this);
337  host->subscribe(NF_IPv4_MCAST_LEAVE, this);
338 
339  enabled = par("enabled");
340  externalRouter = gate("routerIn")->isPathOK() && gate("routerOut")->isPathOK();
341  robustness = par("robustnessVariable");
342  queryInterval = par("queryInterval");
343  queryResponseInterval = par("queryResponseInterval");
344  groupMembershipInterval = par("groupMembershipInterval");
345  otherQuerierPresentInterval = par("otherQuerierPresentInterval");
346  startupQueryInterval = par("startupQueryInterval");
347  startupQueryCount = par("startupQueryCount");
348  lastMemberQueryInterval = par("lastMemberQueryInterval");
349  lastMemberQueryCount = par("lastMemberQueryCount");
350  unsolicitedReportInterval = par("unsolicitedReportInterval");
351  //version1RouterPresentInterval = par("version1RouterPresentInterval");
352 
353  numGroups = 0;
354  numHostGroups = 0;
355  numRouterGroups = 0;
356 
357  numQueriesSent = 0;
358  numQueriesRecv = 0;
363  numReportsSent = 0;
364  numReportsRecv = 0;
365  numLeavesSent = 0;
366  numLeavesRecv = 0;
367 
368  WATCH(numGroups);
369  WATCH(numHostGroups);
370  WATCH(numRouterGroups);
371 
372  WATCH(numQueriesSent);
373  WATCH(numQueriesRecv);
374  WATCH(numGeneralQueriesSent);
375  WATCH(numGeneralQueriesRecv);
378  WATCH(numReportsSent);
379  WATCH(numReportsRecv);
380  WATCH(numLeavesSent);
381  WATCH(numLeavesRecv);
382  }
383  else if (stage == INITSTAGE_NETWORK_LAYER) {
384  for (int i = 0; i < (int)ift->getNumInterfaces(); ++i) {
385  InterfaceEntry *ie = ift->getInterface(i);
386  if (ie->isMulticast())
387  configureInterface(ie);
388  }
389  cModule *host = getContainingNode(this);
390  host->subscribe(NF_INTERFACE_CREATED, this);
391  }
392  else if (stage == INITSTAGE_NETWORK_LAYER_2) {
393  IPSocket ipSocket(gate("ipOut"));
394  ipSocket.registerProtocol(IP_PROT_IGMP);
395  }
396 }
double lastMemberQueryInterval
Definition: IGMPv2.h:140
int numGeneralQueriesSent
Definition: IGMPv2.h:157
IIPv4RoutingTable * rt
Definition: IGMPv2.h:128
int numQueriesSent
Definition: IGMPv2.h:155
simsignal_t NF_IPv4_MCAST_LEAVE
Definition: NotifierConsts.cc:65
double lastMemberQueryCount
Definition: IGMPv2.h:141
int numGeneralQueriesRecv
Definition: IGMPv2.h:158
bool externalRouter
Definition: IGMPv2.h:132
double queryInterval
Definition: IGMPv2.h:134
IInterfaceTable * ift
Definition: IGMPv2.h:129
int numGroups
Definition: IGMPv2.h:150
int numGroupSpecificQueriesRecv
Definition: IGMPv2.h:160
int numReportsRecv
Definition: IGMPv2.h:162
Initialization of network-layer protocols, stage 1.
Definition: InitStages.h:72
Local initializations.
Definition: InitStages.h:35
double groupMembershipInterval
Definition: IGMPv2.h:136
double startupQueryCount
Definition: IGMPv2.h:139
double otherQuerierPresentInterval
Definition: IGMPv2.h:137
cModule * getContainingNode(const cModule *from)
Find the node containing the given module.
Definition: ModuleAccess.cc:65
virtual int getNumInterfaces() const =0
Returns the number of interfaces.
simsignal_t NF_INTERFACE_CREATED
Definition: NotifierConsts.cc:48
int numLeavesRecv
Definition: IGMPv2.h:164
double unsolicitedReportInterval
Definition: IGMPv2.h:142
double startupQueryInterval
Definition: IGMPv2.h:138
double queryResponseInterval
Definition: IGMPv2.h:135
int numLeavesSent
Definition: IGMPv2.h:163
int numGroupSpecificQueriesSent
Definition: IGMPv2.h:159
Initialization of network-layer protocols, stage 2.
Definition: InitStages.h:78
int numQueriesRecv
Definition: IGMPv2.h:156
int numHostGroups
Definition: IGMPv2.h:151
int robustness
Definition: IGMPv2.h:133
simsignal_t NF_INTERFACE_DELETED
Definition: NotifierConsts.cc:49
virtual InterfaceEntry * getInterface(int pos) const =0
Returns the InterfaceEntry specified by an index 0..numInterfaces-1.
Definition: IPProtocolId_m.h:78
virtual void configureInterface(InterfaceEntry *ie)
Definition: IGMPv2.cc:437
simsignal_t NF_IPv4_MCAST_JOIN
Definition: NotifierConsts.cc:64
int numReportsSent
Definition: IGMPv2.h:161
int numRouterGroups
Definition: IGMPv2.h:152
bool enabled
Definition: IGMPv2.h:131
void inet::IGMPv2::multicastGroupJoined ( InterfaceEntry ie,
const IPv4Address groupAddr 
)
protectedvirtual

Referenced by receiveSignal().

493 {
494  ASSERT(ie && ie->isMulticast());
495  ASSERT(groupAddr.isMulticast());
496 
497  if (enabled && !groupAddr.isLinkLocalMulticast()) {
498  HostGroupData *groupData = createHostGroupData(ie, groupAddr);
499  numGroups++;
500  numHostGroups++;
501 
502  sendReport(ie, groupData);
503  groupData->flag = true;
505  groupData->state = IGMP_HGS_DELAYING_MEMBER;
506  }
507 }
virtual HostGroupData * createHostGroupData(InterfaceEntry *ie, const IPv4Address &group)
Definition: IGMPv2.cc:226
int numGroups
Definition: IGMPv2.h:150
double unsolicitedReportInterval
Definition: IGMPv2.h:142
virtual void startHostTimer(InterfaceEntry *ie, HostGroupData *group, double maxRespTime)
Definition: IGMPv2.cc:537
int numHostGroups
Definition: IGMPv2.h:151
virtual void sendReport(InterfaceEntry *ie, HostGroupData *group)
Definition: IGMPv2.cc:576
bool enabled
Definition: IGMPv2.h:131
void inet::IGMPv2::multicastGroupLeft ( InterfaceEntry ie,
const IPv4Address groupAddr 
)
protectedvirtual

Referenced by receiveSignal().

510 {
511  ASSERT(ie && ie->isMulticast());
512  ASSERT(groupAddr.isMulticast());
513 
514  if (enabled && !groupAddr.isLinkLocalMulticast()) {
515  HostGroupData *groupData = getHostGroupData(ie, groupAddr);
516  if (groupData) {
517  if (groupData->state == IGMP_HGS_DELAYING_MEMBER)
518  cancelEvent(groupData->timer);
519 
520  if (groupData->flag)
521  sendLeave(ie, groupData);
522  }
523 
524  deleteHostGroupData(ie, groupAddr);
525  numHostGroups--;
526  numGroups--;
527  }
528 }
virtual void deleteHostGroupData(InterfaceEntry *ie, const IPv4Address &group)
Definition: IGMPv2.cc:304
virtual HostGroupData * getHostGroupData(InterfaceEntry *ie, const IPv4Address &group)
Definition: IGMPv2.cc:270
int numGroups
Definition: IGMPv2.h:150
virtual void sendLeave(InterfaceEntry *ie, HostGroupData *group)
Definition: IGMPv2.cc:588
int numHostGroups
Definition: IGMPv2.h:151
bool enabled
Definition: IGMPv2.h:131
virtual int inet::IGMPv2::numInitStages ( ) const
inlineoverrideprotectedvirtual
167 { return NUM_INIT_STAGES; }
The number of initialization stages.
Definition: InitStages.h:116
void inet::IGMPv2::processGroupQuery ( InterfaceEntry ie,
HostGroupData group,
int  maxRespTime 
)
protectedvirtual

Referenced by processQuery().

750 {
751  double maxRespTimeSecs = (double)maxRespTime / 10.0;
752 
753  if (group->state == IGMP_HGS_DELAYING_MEMBER) {
754  cMessage *timer = group->timer;
755  simtime_t maxAbsoluteRespTime = simTime() + maxRespTimeSecs;
756  if (timer->isScheduled() && maxAbsoluteRespTime < timer->getArrivalTime())
757  startHostTimer(ie, group, maxRespTimeSecs);
758  }
759  else if (group->state == IGMP_HGS_IDLE_MEMBER) {
760  startHostTimer(ie, group, maxRespTimeSecs);
761  group->state = IGMP_HGS_DELAYING_MEMBER;
762  }
763  else {
764  // ignored
765  }
766 }
Definition: IGMPv2.h:53
virtual void startHostTimer(InterfaceEntry *ie, HostGroupData *group, double maxRespTime)
Definition: IGMPv2.cc:537
void inet::IGMPv2::processHostGroupTimer ( cMessage *  msg)
protectedvirtual

Referenced by handleMessage().

662 {
663  IGMPHostTimerContext *ctx = (IGMPHostTimerContext *)msg->getContextPointer();
664  EV_DEBUG << "IGMPv2: Host Timer expired for group=" << ctx->hostGroup->groupAddr << " iface=" << ctx->ie->getName() << "\n";
665  sendReport(ctx->ie, ctx->hostGroup);
666  ctx->hostGroup->flag = true;
667  ctx->hostGroup->state = IGMP_HGS_IDLE_MEMBER;
668 }
Definition: IGMPv2.h:53
virtual void sendReport(InterfaceEntry *ie, HostGroupData *group)
Definition: IGMPv2.cc:576
void inet::IGMPv2::processIgmpMessage ( IGMPMessage msg)
protectedvirtual

Referenced by handleMessage().

616 {
617  IPv4ControlInfo *controlInfo = (IPv4ControlInfo *)msg->getControlInfo();
618  InterfaceEntry *ie = ift->getInterfaceById(controlInfo->getInterfaceId());
619  switch (msg->getType()) {
621  processQuery(ie, controlInfo->getSrcAddr(), check_and_cast<IGMPQuery *>(msg));
622  break;
623 
624  //case IGMPV1_MEMBERSHIP_REPORT:
625  // processV1Report(ie, msg);
626  // delete msg;
627  // break;
629  processV2Report(ie, check_and_cast<IGMPv2Report *>(msg));
630  break;
631 
632  case IGMPV2_LEAVE_GROUP:
633  processLeave(ie, check_and_cast<IGMPv2Leave *>(msg));
634  break;
635 
636  default:
637  if (externalRouter)
638  send(msg, "routerOut");
639  else {
640  //delete msg;
641  throw cRuntimeError("IGMPv2: Unhandled message type (%dq)", msg->getType());
642  }
643  break;
644  }
645 }
virtual InterfaceEntry * getInterfaceById(int id) const =0
Returns an interface by its Id.
Definition: IGMPMessage_m.h:61
virtual void processLeave(InterfaceEntry *ie, IGMPv2Leave *msg)
Definition: IGMPv2.cc:823
bool externalRouter
Definition: IGMPv2.h:132
virtual void processQuery(InterfaceEntry *ie, const IPv4Address &sender, IGMPQuery *msg)
Definition: IGMPv2.cc:696
Definition: IGMPMessage_m.h:60
IInterfaceTable * ift
Definition: IGMPv2.h:129
Definition: IGMPMessage_m.h:58
virtual void processV2Report(InterfaceEntry *ie, IGMPv2Report *msg)
Definition: IGMPv2.cc:768
void inet::IGMPv2::processLeave ( InterfaceEntry ie,
IGMPv2Leave msg 
)
protectedvirtual

Referenced by processIgmpMessage().

824 {
825  ASSERT(ie->isMulticast());
826 
827  EV_INFO << "IGMPv2: received Leave Group for group=" << msg->getGroupAddress() << " iface=" << ie->getName() << "\n";
828 
829  numLeavesRecv++;
830 
832  if (externalRouter) {
833  send(msg, "routerOut");
834  return;
835  }
836 
837  IPv4Address& groupAddr = msg->getGroupAddress();
838  RouterInterfaceData *interfaceData = getRouterInterfaceData(ie);
839  RouterGroupData *groupData = getRouterGroupData(ie, groupAddr);
840  if (groupData) {
841  if (groupData->state == IGMP_RGS_MEMBERS_PRESENT && interfaceData->igmpRouterState == IGMP_RS_QUERIER) {
843  startTimer(groupData->rexmtTimer, lastMemberQueryInterval);
844  sendQuery(ie, groupAddr, lastMemberQueryInterval);
845  groupData->state = IGMP_RGS_CHECKING_MEMBERSHIP;
846  }
847  }
848  }
849 
850  delete msg;
851 }
double lastMemberQueryInterval
Definition: IGMPv2.h:140
IIPv4RoutingTable * rt
Definition: IGMPv2.h:128
virtual RouterGroupData * getRouterGroupData(InterfaceEntry *ie, const IPv4Address &group)
Definition: IGMPv2.cc:277
Definition: IGMPv2.h:39
double lastMemberQueryCount
Definition: IGMPv2.h:141
bool externalRouter
Definition: IGMPv2.h:132
virtual void startTimer(cMessage *timer, double interval)
Definition: IGMPv2.cc:530
int numLeavesRecv
Definition: IGMPv2.h:164
virtual void sendQuery(InterfaceEntry *ie, const IPv4Address &groupAddr, double maxRespTime)
Definition: IGMPv2.cc:549
virtual bool isMulticastForwardingEnabled() const =0
Multicast forwarding on/off.
virtual RouterInterfaceData * getRouterInterfaceData(InterfaceEntry *ie)
Definition: IGMPv2.cc:257
void inet::IGMPv2::processLeaveTimer ( cMessage *  msg)
protectedvirtual

Referenced by handleMessage().

671 {
672  IGMPRouterTimerContext *ctx = (IGMPRouterTimerContext *)msg->getContextPointer();
673  EV_DEBUG << "IGMPv2: Leave Timer expired, deleting " << ctx->routerGroup->groupAddr << " from listener list of '" << ctx->ie->getName() << "'\n";
674 
675  // notify IPv4InterfaceData to update its listener list
676  ctx->ie->ipv4Data()->removeMulticastListener(ctx->routerGroup->groupAddr);
677  numRouterGroups--;
678 
679  if (ctx->routerGroup->state == IGMP_RGS_CHECKING_MEMBERSHIP)
680  cancelEvent(ctx->routerGroup->rexmtTimer);
681 
682  ctx->routerGroup->state = IGMP_RGS_NO_MEMBERS_PRESENT;
683  deleteRouterGroupData(ctx->ie, ctx->routerGroup->groupAddr);
684  numGroups--;
685 }
int numGroups
Definition: IGMPv2.h:150
virtual void deleteRouterGroupData(InterfaceEntry *ie, const IPv4Address &group)
Definition: IGMPv2.cc:315
int numRouterGroups
Definition: IGMPv2.h:152
void inet::IGMPv2::processQuery ( InterfaceEntry ie,
const IPv4Address sender,
IGMPQuery msg 
)
protectedvirtual

Referenced by processIgmpMessage().

697 {
698  ASSERT(ie->isMulticast());
699 
700  HostInterfaceData *interfaceData = getHostInterfaceData(ie);
701 
702  numQueriesRecv++;
703 
704  IPv4Address& groupAddr = msg->getGroupAddress();
705  IGMPv2Query *v2Query = dynamic_cast<IGMPv2Query *>(msg);
706  int maxRespTime = v2Query ? v2Query->getMaxRespTime() : 100;
707 
708  if (groupAddr.isUnspecified()) {
709  // general query
710  EV_INFO << "IGMPv2: received General Membership Query on iface=" << ie->getName() << "\n";
712  for (auto & elem : interfaceData->groups)
713  processGroupQuery(ie, elem.second, maxRespTime);
714  }
715  else {
716  // group-specific query
717  EV_INFO << "IGMPv2: received Membership Query for group=" << groupAddr << " iface=" << ie->getName() << "\n";
719  auto it = interfaceData->groups.find(groupAddr);
720  if (it != interfaceData->groups.end())
721  processGroupQuery(ie, it->second, maxRespTime);
722  }
723 
725  if (externalRouter) {
726  send(msg, "routerOut");
727  return;
728  }
729 
730  RouterInterfaceData *routerInterfaceData = getRouterInterfaceData(ie);
731  if (sender < ie->ipv4Data()->getIPAddress()) {
732  startTimer(routerInterfaceData->igmpQueryTimer, otherQuerierPresentInterval);
733  routerInterfaceData->igmpRouterState = IGMP_RS_NON_QUERIER;
734  }
735 
736  if (!groupAddr.isUnspecified() && routerInterfaceData->igmpRouterState == IGMP_RS_NON_QUERIER) { // group specific query
737  RouterGroupData *groupData = getRouterGroupData(ie, groupAddr);
738  if (groupData->state == IGMP_RGS_MEMBERS_PRESENT) {
739  double maxResponseTime = (double)maxRespTime / 10.0;
740  startTimer(groupData->timer, maxResponseTime * lastMemberQueryCount);
741  groupData->state = IGMP_RGS_CHECKING_MEMBERSHIP;
742  }
743  }
744  }
745 
746  delete msg;
747 }
Definition: IGMPv2.h:40
virtual HostInterfaceData * getHostInterfaceData(InterfaceEntry *ie)
Definition: IGMPv2.cc:244
IIPv4RoutingTable * rt
Definition: IGMPv2.h:128
virtual RouterGroupData * getRouterGroupData(InterfaceEntry *ie, const IPv4Address &group)
Definition: IGMPv2.cc:277
double lastMemberQueryCount
Definition: IGMPv2.h:141
int numGeneralQueriesRecv
Definition: IGMPv2.h:158
bool externalRouter
Definition: IGMPv2.h:132
virtual void startTimer(cMessage *timer, double interval)
Definition: IGMPv2.cc:530
int numGroupSpecificQueriesRecv
Definition: IGMPv2.h:160
double otherQuerierPresentInterval
Definition: IGMPv2.h:137
virtual bool isMulticastForwardingEnabled() const =0
Multicast forwarding on/off.
virtual RouterInterfaceData * getRouterInterfaceData(InterfaceEntry *ie)
Definition: IGMPv2.cc:257
int numQueriesRecv
Definition: IGMPv2.h:156
virtual void processGroupQuery(InterfaceEntry *ie, HostGroupData *group, int maxRespTime)
Definition: IGMPv2.cc:749
void inet::IGMPv2::processQueryTimer ( cMessage *  msg)
protectedvirtual

Referenced by handleMessage().

648 {
649  InterfaceEntry *ie = (InterfaceEntry *)msg->getContextPointer();
650  ASSERT(ie);
651  EV_DEBUG << "IGMPv2: General Query timer expired, iface=" << ie->getName() << "\n";
652  RouterInterfaceData *interfaceData = getRouterInterfaceData(ie);
653  RouterState state = interfaceData->igmpRouterState;
654  if (state == IGMP_RS_QUERIER || state == IGMP_RS_NON_QUERIER) {
655  interfaceData->igmpRouterState = IGMP_RS_QUERIER;
656  sendQuery(ie, IPv4Address(), queryResponseInterval); // general query
658  }
659 }
Definition: IGMPv2.h:40
RouterState
Definition: IGMPv2.h:37
Definition: IGMPv2.h:39
double queryInterval
Definition: IGMPv2.h:134
virtual void startTimer(cMessage *timer, double interval)
Definition: IGMPv2.cc:530
virtual void sendQuery(InterfaceEntry *ie, const IPv4Address &groupAddr, double maxRespTime)
Definition: IGMPv2.cc:549
double queryResponseInterval
Definition: IGMPv2.h:135
virtual RouterInterfaceData * getRouterInterfaceData(InterfaceEntry *ie)
Definition: IGMPv2.cc:257
void inet::IGMPv2::processRexmtTimer ( cMessage *  msg)
protectedvirtual

Referenced by handleMessage().

688 {
689  IGMPRouterTimerContext *ctx = (IGMPRouterTimerContext *)msg->getContextPointer();
690  EV_DEBUG << "IGMPv2: Rexmt Timer expired for group=" << ctx->routerGroup->groupAddr << " iface=" << ctx->ie->getName() << "\n";
691  sendQuery(ctx->ie, ctx->routerGroup->groupAddr, lastMemberQueryInterval);
692  startTimer(ctx->routerGroup->rexmtTimer, lastMemberQueryInterval);
693  ctx->routerGroup->state = IGMP_RGS_CHECKING_MEMBERSHIP;
694 }
double lastMemberQueryInterval
Definition: IGMPv2.h:140
virtual void startTimer(cMessage *timer, double interval)
Definition: IGMPv2.cc:530
virtual void sendQuery(InterfaceEntry *ie, const IPv4Address &groupAddr, double maxRespTime)
Definition: IGMPv2.cc:549
void inet::IGMPv2::processV2Report ( InterfaceEntry ie,
IGMPv2Report msg 
)
protectedvirtual

Referenced by processIgmpMessage().

769 {
770  ASSERT(ie->isMulticast());
771 
772  IPv4Address& groupAddr = msg->getGroupAddress();
773 
774  EV_INFO << "IGMPv2: received V2 Membership Report for group=" << groupAddr << " iface=" << ie->getName() << "\n";
775 
776  numReportsRecv++;
777 
778  HostGroupData *hostGroupData = getHostGroupData(ie, groupAddr);
779  if (hostGroupData) {
780  if (hostGroupData && hostGroupData->state == IGMP_HGS_DELAYING_MEMBER) {
781  cancelEvent(hostGroupData->timer);
782  hostGroupData->flag = false;
783  hostGroupData->state = IGMP_HGS_IDLE_MEMBER;
784  }
785  }
786 
788  if (externalRouter) {
789  send(msg, "routerOut");
790  return;
791  }
792 
793  RouterGroupData *routerGroupData = getRouterGroupData(ie, groupAddr);
794  if (!routerGroupData) {
795  routerGroupData = createRouterGroupData(ie, groupAddr);
796  numGroups++;
797  }
798 
799  if (!routerGroupData->timer) {
800  routerGroupData->timer = new cMessage("IGMPv2 leave timer", IGMP_LEAVE_TIMER);
801  routerGroupData->timer->setContextPointer(new IGMPRouterTimerContext(ie, routerGroupData));
802  }
803  if (!routerGroupData->rexmtTimer) {
804  routerGroupData->rexmtTimer = new cMessage("IGMPv2 rexmt timer", IGMP_REXMT_TIMER);
805  routerGroupData->rexmtTimer->setContextPointer(new IGMPRouterTimerContext(ie, routerGroupData));
806  }
807 
808  if (routerGroupData->state == IGMP_RGS_NO_MEMBERS_PRESENT) {
809  // notify IPv4InterfaceData to update its listener list
810  ie->ipv4Data()->addMulticastListener(groupAddr);
811  numRouterGroups++;
812  }
813  else if (routerGroupData->state == IGMP_RGS_CHECKING_MEMBERSHIP)
814  cancelEvent(routerGroupData->rexmtTimer);
815 
816  startTimer(routerGroupData->timer, groupMembershipInterval);
817  routerGroupData->state = IGMP_RGS_MEMBERS_PRESENT;
818  }
819 
820  delete msg;
821 }
IIPv4RoutingTable * rt
Definition: IGMPv2.h:128
virtual RouterGroupData * getRouterGroupData(InterfaceEntry *ie, const IPv4Address &group)
Definition: IGMPv2.cc:277
virtual HostGroupData * getHostGroupData(InterfaceEntry *ie, const IPv4Address &group)
Definition: IGMPv2.cc:270
Definition: IGMPv2.h:53
bool externalRouter
Definition: IGMPv2.h:132
int numGroups
Definition: IGMPv2.h:150
virtual void startTimer(cMessage *timer, double interval)
Definition: IGMPv2.cc:530
Definition: IGMPv2.h:110
virtual RouterGroupData * createRouterGroupData(InterfaceEntry *ie, const IPv4Address &group)
Definition: IGMPv2.cc:235
int numReportsRecv
Definition: IGMPv2.h:162
double groupMembershipInterval
Definition: IGMPv2.h:136
Definition: IGMPv2.h:109
virtual bool isMulticastForwardingEnabled() const =0
Multicast forwarding on/off.
int numRouterGroups
Definition: IGMPv2.h:152
void inet::IGMPv2::receiveSignal ( cComponent *  source,
simsignal_t  signalID,
cObject *  obj,
cObject *  details 
)
overrideprotectedvirtual
407 {
408  Enter_Method_Silent();
409 
410  InterfaceEntry *ie;
411  int interfaceId;
412  const IPv4MulticastGroupInfo *info;
413 
414  if (signalID == NF_INTERFACE_CREATED) {
415  ie = check_and_cast<InterfaceEntry *>(obj);
416  if (ie->isMulticast())
417  configureInterface(ie);
418  }
419  else if (signalID == NF_INTERFACE_DELETED) {
420  ie = check_and_cast<InterfaceEntry *>(obj);
421  if (ie->isMulticast()) {
422  interfaceId = ie->getInterfaceId();
423  deleteHostInterfaceData(interfaceId);
424  deleteRouterInterfaceData(interfaceId);
425  }
426  }
427  else if (signalID == NF_IPv4_MCAST_JOIN) {
428  info = check_and_cast<const IPv4MulticastGroupInfo *>(obj);
429  multicastGroupJoined(info->ie, info->groupAddress);
430  }
431  else if (signalID == NF_IPv4_MCAST_LEAVE) {
432  info = check_and_cast<const IPv4MulticastGroupInfo *>(obj);
433  multicastGroupLeft(info->ie, info->groupAddress);
434  }
435 }
simsignal_t NF_IPv4_MCAST_LEAVE
Definition: NotifierConsts.cc:65
virtual void multicastGroupJoined(InterfaceEntry *ie, const IPv4Address &groupAddr)
Definition: IGMPv2.cc:492
virtual void deleteRouterInterfaceData(int interfaceId)
Definition: IGMPv2.cc:294
simsignal_t NF_INTERFACE_CREATED
Definition: NotifierConsts.cc:48
virtual void multicastGroupLeft(InterfaceEntry *ie, const IPv4Address &groupAddr)
Definition: IGMPv2.cc:509
simsignal_t NF_INTERFACE_DELETED
Definition: NotifierConsts.cc:49
virtual void configureInterface(InterfaceEntry *ie)
Definition: IGMPv2.cc:437
virtual void deleteHostInterfaceData(int interfaceId)
Definition: IGMPv2.cc:284
simsignal_t NF_IPv4_MCAST_JOIN
Definition: NotifierConsts.cc:64
void inet::IGMPv2::sendLeave ( InterfaceEntry ie,
HostGroupData group 
)
protectedvirtual

Referenced by multicastGroupLeft().

589 {
590  ASSERT(group->groupAddr.isMulticast() && !group->groupAddr.isLinkLocalMulticast());
591 
592  EV_INFO << "IGMPv2: sending Leave Group for group=" << group->groupAddr << " on iface=" << ie->getName() << "\n";
593  IGMPv2Leave *msg = new IGMPv2Leave("IGMPv2 leave");
594  msg->setGroupAddress(group->groupAddr);
595  msg->setByteLength(8);
597  numLeavesSent++;
598 }
virtual void sendToIP(IGMPMessage *msg, InterfaceEntry *ie, const IPv4Address &dest)
Definition: IGMPv2.cc:601
int numLeavesSent
Definition: IGMPv2.h:163
static const IPv4Address ALL_ROUTERS_MCAST
224.0.0.2 All routers on a subnet
Definition: IPv4Address.h:108
void inet::IGMPv2::sendQuery ( InterfaceEntry ie,
const IPv4Address groupAddr,
double  maxRespTime 
)
protectedvirtual

Referenced by configureInterface(), processLeave(), processQueryTimer(), and processRexmtTimer().

550 {
551  ASSERT(groupAddr.isUnspecified() || (groupAddr.isMulticast() && !groupAddr.isLinkLocalMulticast()));
552 
553  RouterInterfaceData *interfaceData = getRouterInterfaceData(ie);
554 
555  if (interfaceData->igmpRouterState == IGMP_RS_QUERIER) {
556  if (groupAddr.isUnspecified())
557  EV_INFO << "IGMPv2: sending General Membership Query on iface=" << ie->getName() << "\n";
558  else
559  EV_INFO << "IGMPv2: sending Membership Query for group=" << groupAddr << " on iface=" << ie->getName() << "\n";
560 
561  IGMPv2Query *msg = new IGMPv2Query("IGMPv2 query");
562  msg->setType(IGMP_MEMBERSHIP_QUERY);
563  msg->setGroupAddress(groupAddr);
564  msg->setMaxRespTime((int)(maxRespTime * 10.0));
565  msg->setByteLength(8);
566  sendToIP(msg, ie, groupAddr.isUnspecified() ? IPv4Address::ALL_HOSTS_MCAST : groupAddr);
567 
568  numQueriesSent++;
569  if (groupAddr.isUnspecified())
571  else
573  }
574 }
virtual void sendToIP(IGMPMessage *msg, InterfaceEntry *ie, const IPv4Address &dest)
Definition: IGMPv2.cc:601
int numGeneralQueriesSent
Definition: IGMPv2.h:157
int numQueriesSent
Definition: IGMPv2.h:155
Definition: IGMPv2.h:39
Definition: IGMPMessage_m.h:58
static const IPv4Address ALL_HOSTS_MCAST
224.0.0.1 All hosts on a subnet
Definition: IPv4Address.h:107
virtual RouterInterfaceData * getRouterInterfaceData(InterfaceEntry *ie)
Definition: IGMPv2.cc:257
int numGroupSpecificQueriesSent
Definition: IGMPv2.h:159
void inet::IGMPv2::sendReport ( InterfaceEntry ie,
HostGroupData group 
)
protectedvirtual

Referenced by multicastGroupJoined(), and processHostGroupTimer().

577 {
578  ASSERT(group->groupAddr.isMulticast() && !group->groupAddr.isLinkLocalMulticast());
579 
580  EV_INFO << "IGMPv2: sending Membership Report for group=" << group->groupAddr << " on iface=" << ie->getName() << "\n";
581  IGMPv2Report *msg = new IGMPv2Report("IGMPv2 report");
582  msg->setGroupAddress(group->groupAddr);
583  msg->setByteLength(8);
584  sendToIP(msg, ie, group->groupAddr);
585  numReportsSent++;
586 }
virtual void sendToIP(IGMPMessage *msg, InterfaceEntry *ie, const IPv4Address &dest)
Definition: IGMPv2.cc:601
int numReportsSent
Definition: IGMPv2.h:161
void inet::IGMPv2::sendToIP ( IGMPMessage msg,
InterfaceEntry ie,
const IPv4Address dest 
)
protectedvirtual

Referenced by sendLeave(), sendQuery(), and sendReport().

602 {
603  ASSERT(ie->isMulticast());
604 
605  IPv4ControlInfo *controlInfo = new IPv4ControlInfo();
606  controlInfo->setProtocol(IP_PROT_IGMP);
607  controlInfo->setInterfaceId(ie->getInterfaceId());
608  controlInfo->setTimeToLive(1);
609  controlInfo->setDestAddr(dest);
610  msg->setControlInfo(controlInfo);
611 
612  send(msg, "ipOut");
613 }
Definition: IPProtocolId_m.h:78
void inet::IGMPv2::startHostTimer ( InterfaceEntry ie,
HostGroupData group,
double  maxRespTime 
)
protectedvirtual

Referenced by multicastGroupJoined(), and processGroupQuery().

538 {
539  if (!group->timer) {
540  group->timer = new cMessage("IGMPv2 group timer", IGMP_HOSTGROUP_TIMER);
541  group->timer->setContextPointer(new IGMPHostTimerContext(ie, group));
542  }
543 
544  double delay = uniform(0.0, maxRespTime);
545  EV_DEBUG << "setting host timer for " << ie->getName() << " and group " << group->groupAddr.str() << " to " << delay << "\n";
546  startTimer(group->timer, delay);
547 }
Definition: IGMPv2.h:108
virtual void startTimer(cMessage *timer, double interval)
Definition: IGMPv2.cc:530
void inet::IGMPv2::startTimer ( cMessage *  timer,
double  interval 
)
protectedvirtual

Referenced by configureInterface(), processLeave(), processQuery(), processQueryTimer(), processRexmtTimer(), processV2Report(), and startHostTimer().

531 {
532  ASSERT(timer);
533  cancelEvent(timer);
534  scheduleAt(simTime() + interval, timer);
535 }

Member Data Documentation

bool inet::IGMPv2::enabled
protected
bool inet::IGMPv2::externalRouter
protected
double inet::IGMPv2::groupMembershipInterval
protected

Referenced by initialize(), and processV2Report().

InterfaceToHostDataMap inet::IGMPv2::hostData
protected
IInterfaceTable* inet::IGMPv2::ift
protected

Referenced by initialize(), and processIgmpMessage().

double inet::IGMPv2::lastMemberQueryCount
protected
double inet::IGMPv2::lastMemberQueryInterval
protected
int inet::IGMPv2::numGeneralQueriesRecv
protected

Referenced by initialize(), and processQuery().

int inet::IGMPv2::numGeneralQueriesSent
protected

Referenced by initialize(), and sendQuery().

int inet::IGMPv2::numGroups
protected
int inet::IGMPv2::numGroupSpecificQueriesRecv
protected

Referenced by initialize(), and processQuery().

int inet::IGMPv2::numGroupSpecificQueriesSent
protected

Referenced by initialize(), and sendQuery().

int inet::IGMPv2::numHostGroups
protected
int inet::IGMPv2::numLeavesRecv
protected

Referenced by initialize(), and processLeave().

int inet::IGMPv2::numLeavesSent
protected

Referenced by initialize(), and sendLeave().

int inet::IGMPv2::numQueriesRecv
protected

Referenced by initialize(), and processQuery().

int inet::IGMPv2::numQueriesSent
protected

Referenced by initialize(), and sendQuery().

int inet::IGMPv2::numReportsRecv
protected

Referenced by initialize(), and processV2Report().

int inet::IGMPv2::numReportsSent
protected

Referenced by initialize(), and sendReport().

int inet::IGMPv2::numRouterGroups
protected
double inet::IGMPv2::otherQuerierPresentInterval
protected

Referenced by initialize(), and processQuery().

double inet::IGMPv2::queryInterval
protected

Referenced by initialize(), and processQueryTimer().

double inet::IGMPv2::queryResponseInterval
protected
int inet::IGMPv2::robustness
protected

Referenced by initialize().

double inet::IGMPv2::startupQueryCount
protected

Referenced by initialize().

double inet::IGMPv2::startupQueryInterval
protected

Referenced by configureInterface(), and initialize().

double inet::IGMPv2::unsolicitedReportInterval
protected

Referenced by initialize(), and multicastGroupJoined().


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