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

#include <Igmpv2.h>

Inheritance diagram for inet::Igmpv2:
inet::DefaultProtocolRegistrationListener inet::IProtocolRegistrationListener

Classes

struct  HostGroupData
 
struct  HostInterfaceData
 
struct  IgmpHostTimerContext
 
struct  IgmpRouterTimerContext
 
struct  RouterGroupData
 
struct  RouterInterfaceData
 

Public Member Functions

void insertCrc (const Ptr< IgmpMessage > &igmpMsg, Packet *payload)
 
bool verifyCrc (const Packet *packet)
 
- Public Member Functions inherited from inet::DefaultProtocolRegistrationListener
virtual void handleRegisterServiceGroup (const ProtocolGroup &protocolGroup, cGate *gate, ServicePrimitive servicePrimitive) override
 
virtual void handleRegisterProtocolGroup (const ProtocolGroup &protocolGroup, cGate *gate, ServicePrimitive servicePrimitive) override
 
virtual void handleRegisterAnyService (cGate *gate, ServicePrimitive servicePrimitive) override
 
virtual void handleRegisterAnyProtocol (cGate *gate, ServicePrimitive servicePrimitive) override
 

Static Public Member Functions

static const std::string getRouterStateString (RouterState rs)
 
static const std::string getRouterGroupStateString (RouterGroupState rgs)
 
static const std::string getHostGroupStateString (HostGroupState hgs)
 
static void insertCrc (CrcMode crcMode, const Ptr< IgmpMessage > &igmpMsg, Packet *payload)
 

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 handleRegisterService (const Protocol &protocol, cGate *gate, ServicePrimitive servicePrimitive) override
 
virtual void handleRegisterProtocol (const Protocol &protocol, cGate *gate, ServicePrimitive servicePrimitive) override
 
virtual void receiveSignal (cComponent *source, simsignal_t signalID, cObject *obj, cObject *details) override
 
virtual ~Igmpv2 ()
 
void addWatches ()
 
virtual void multicastGroupJoined (NetworkInterface *ie, const Ipv4Address &groupAddr)
 
virtual void multicastGroupLeft (NetworkInterface *ie, const Ipv4Address &groupAddr)
 
virtual void configureInterface (NetworkInterface *ie)
 
virtual void deleteHostInterfaceData (int interfaceId)
 
virtual void deleteRouterInterfaceData (int interfaceId)
 
virtual void processQueryTimer (cMessage *msg)
 
virtual void processHostGroupTimer (cMessage *msg)
 
virtual void processLeaveTimer (cMessage *msg)
 
virtual void processRexmtTimer (cMessage *msg)
 
virtual void startTimer (cMessage *timer, double interval)
 
virtual void startHostTimer (NetworkInterface *ie, HostGroupData *group, double maxRespTime)
 
virtual void processIgmpMessage (Packet *packet)
 
virtual void processQuery (NetworkInterface *ie, Packet *packet)
 
virtual void processGroupQuery (NetworkInterface *ie, HostGroupData *group, simtime_t maxRespTime)
 
virtual void processV2Report (NetworkInterface *ie, Packet *packet)
 
virtual void processLeave (NetworkInterface *ie, Packet *packet)
 
virtual void sendQuery (NetworkInterface *ie, const Ipv4Address &groupAddr, double maxRespTime)
 
virtual void sendReport (NetworkInterface *ie, HostGroupData *group)
 
virtual void sendLeave (NetworkInterface *ie, HostGroupData *group)
 
virtual void sendToIP (Packet *msg, NetworkInterface *ie, const Ipv4Address &dest)
 
virtual RouterGroupDatacreateRouterGroupData (NetworkInterface *ie, const Ipv4Address &group)
 
virtual HostGroupDatacreateHostGroupData (NetworkInterface *ie, const Ipv4Address &group)
 
virtual RouterGroupDatagetRouterGroupData (NetworkInterface *ie, const Ipv4Address &group)
 
virtual HostGroupDatagetHostGroupData (NetworkInterface *ie, const Ipv4Address &group)
 
virtual void deleteRouterGroupData (NetworkInterface *ie, const Ipv4Address &group)
 
virtual void deleteHostGroupData (NetworkInterface *ie, const Ipv4Address &group)
 
virtual RouterInterfaceDatagetRouterInterfaceData (NetworkInterface *ie)
 
virtual RouterInterfaceDatacreateRouterInterfaceData ()
 
virtual HostInterfaceDatagetHostInterfaceData (NetworkInterface *ie)
 
virtual HostInterfaceDatacreateHostInterfaceData ()
 

Protected Attributes

ModuleRefByPar< IIpv4RoutingTablert
 
ModuleRefByPar< IInterfaceTableift
 
bool enabled
 
bool externalRouter
 
int robustness
 
double queryInterval
 
double queryResponseInterval
 
double groupMembershipInterval
 
double otherQuerierPresentInterval
 
double startupQueryInterval
 
int startupQueryCount
 
double lastMemberQueryInterval
 
int lastMemberQueryCount
 
double unsolicitedReportInterval
 
int numGroups = 0
 
int numHostGroups = 0
 
int numRouterGroups = 0
 
int numQueriesSent = 0
 
int numQueriesRecv = 0
 
int numGeneralQueriesSent = 0
 
int numGeneralQueriesRecv = 0
 
int numGroupSpecificQueriesSent = 0
 
int numGroupSpecificQueriesRecv = 0
 
int numReportsSent = 0
 
int numReportsRecv = 0
 
int numLeavesSent = 0
 
int numLeavesRecv = 0
 
CrcMode crcMode = CRC_MODE_UNDEFINED
 
InterfaceToHostDataMap hostData
 
InterfaceToRouterDataMap routerData
 

Member Typedef Documentation

◆ GroupToHostDataMap

◆ GroupToRouterDataMap

◆ InterfaceToHostDataMap

typedef std::map<int, HostInterfaceData *> inet::Igmpv2::InterfaceToHostDataMap
protected

◆ InterfaceToRouterDataMap

typedef std::map<int, RouterInterfaceData *> inet::Igmpv2::InterfaceToRouterDataMap
protected

Member Enumeration Documentation

◆ HostGroupState

Enumerator
IGMP_HGS_NON_MEMBER 
IGMP_HGS_DELAYING_MEMBER 
IGMP_HGS_IDLE_MEMBER 

◆ IgmpTimerKind

Enumerator
IGMP_QUERY_TIMER 
IGMP_HOSTGROUP_TIMER 
IGMP_LEAVE_TIMER 
IGMP_REXMT_TIMER 

◆ RouterGroupState

Enumerator
IGMP_RGS_NO_MEMBERS_PRESENT 
IGMP_RGS_MEMBERS_PRESENT 
IGMP_RGS_V1_MEMBERS_PRESENT 
IGMP_RGS_CHECKING_MEMBERSHIP 

◆ RouterState

enum inet::Igmpv2::RouterState
protected
Enumerator
IGMP_RS_INITIAL 
IGMP_RS_QUERIER 
IGMP_RS_NON_QUERIER 
28  {
32  };

Constructor & Destructor Documentation

◆ ~Igmpv2()

inet::Igmpv2::~Igmpv2 ( )
protectedvirtual
137 {
138  while (!hostData.empty())
139  deleteHostInterfaceData(hostData.begin()->first);
140 
141  while (!routerData.empty())
142  deleteRouterInterfaceData(routerData.begin()->first);
143 }

Member Function Documentation

◆ addWatches()

void inet::Igmpv2::addWatches ( )
protected
202 {
203  WATCH(numGroups);
204  WATCH(numHostGroups);
205  WATCH(numRouterGroups);
206 
207  WATCH(numQueriesSent);
208  WATCH(numQueriesRecv);
209  WATCH(numGeneralQueriesSent);
210  WATCH(numGeneralQueriesRecv);
213  WATCH(numReportsSent);
214  WATCH(numReportsRecv);
215  WATCH(numLeavesSent);
216  WATCH(numLeavesRecv);
217 
218  WATCH_PTRMAP(hostData);
219  WATCH_PTRMAP(routerData);
220 }

Referenced by initialize().

◆ configureInterface()

void inet::Igmpv2::configureInterface ( NetworkInterface ie)
protectedvirtual
292 {
293  if (enabled && rt->isMulticastForwardingEnabled() && !externalRouter) {
294  // start querier on this interface
295  cMessage *timer = new cMessage("Igmpv2 query timer", IGMP_QUERY_TIMER);
296  timer->setContextPointer(ie);
297  RouterInterfaceData *routerData = getRouterInterfaceData(ie);
298  routerData->igmpQueryTimer = timer;
299  routerData->igmpRouterState = IGMP_RS_QUERIER;
300  sendQuery(ie, Ipv4Address(), queryResponseInterval); // general query
302  }
303 }

Referenced by initialize(), and receiveSignal().

◆ createHostGroupData()

Igmpv2::HostGroupData * inet::Igmpv2::createHostGroupData ( NetworkInterface ie,
const Ipv4Address group 
)
protectedvirtual
752 {
753  HostInterfaceData *interfaceData = getHostInterfaceData(ie);
754  ASSERT(!containsKey(interfaceData->groups, group));
755  HostGroupData *data = new HostGroupData(this, group);
756  interfaceData->groups[group] = data;
757  return data;
758 }

Referenced by multicastGroupJoined().

◆ createHostInterfaceData()

Igmpv2::HostInterfaceData * inet::Igmpv2::createHostInterfaceData ( )
protectedvirtual
830 {
831  return new HostInterfaceData(this);
832 }

Referenced by getHostInterfaceData().

◆ createRouterGroupData()

Igmpv2::RouterGroupData * inet::Igmpv2::createRouterGroupData ( NetworkInterface ie,
const Ipv4Address group 
)
protectedvirtual
743 {
744  RouterInterfaceData *interfaceData = getRouterInterfaceData(ie);
745  ASSERT(!containsKey(interfaceData->groups, group));
746  RouterGroupData *data = new RouterGroupData(this, group);
747  interfaceData->groups[group] = data;
748  return data;
749 }

Referenced by processV2Report().

◆ createRouterInterfaceData()

Igmpv2::RouterInterfaceData * inet::Igmpv2::createRouterInterfaceData ( )
protectedvirtual
812 {
813  return new RouterInterfaceData(this);
814 }

Referenced by getRouterInterfaceData().

◆ deleteHostGroupData()

void inet::Igmpv2::deleteHostGroupData ( NetworkInterface ie,
const Ipv4Address group 
)
protectedvirtual
786 {
787  HostInterfaceData *interfaceData = getHostInterfaceData(ie);
788  auto it = interfaceData->groups.find(group);
789  if (it != interfaceData->groups.end()) {
790  HostGroupData *data = it->second;
791  interfaceData->groups.erase(it);
792  delete data;
793  }
794 }

Referenced by multicastGroupLeft().

◆ deleteHostInterfaceData()

void inet::Igmpv2::deleteHostInterfaceData ( int  interfaceId)
protectedvirtual
306 {
307  auto interfaceIt = hostData.find(interfaceId);
308  if (interfaceIt != hostData.end()) {
309  HostInterfaceData *interface = interfaceIt->second;
310  hostData.erase(interfaceIt);
311  delete interface;
312  }
313 }

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

◆ deleteRouterGroupData()

void inet::Igmpv2::deleteRouterGroupData ( NetworkInterface ie,
const Ipv4Address group 
)
protectedvirtual
775 {
776  RouterInterfaceData *interfaceData = getRouterInterfaceData(ie);
777  auto it = interfaceData->groups.find(group);
778  if (it != interfaceData->groups.end()) {
779  RouterGroupData *data = it->second;
780  interfaceData->groups.erase(it);
781  delete data;
782  }
783 }

Referenced by processLeaveTimer().

◆ deleteRouterInterfaceData()

void inet::Igmpv2::deleteRouterInterfaceData ( int  interfaceId)
protectedvirtual
316 {
317  auto interfaceIt = routerData.find(interfaceId);
318  if (interfaceIt != routerData.end()) {
319  RouterInterfaceData *interface = interfaceIt->second;
320  routerData.erase(interfaceIt);
321  delete interface;
322  }
323 }

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

◆ getHostGroupData()

Igmpv2::HostGroupData * inet::Igmpv2::getHostGroupData ( NetworkInterface ie,
const Ipv4Address group 
)
protectedvirtual
768 {
769  HostInterfaceData *interfaceData = getHostInterfaceData(ie);
770  auto it = interfaceData->groups.find(group);
771  return it != interfaceData->groups.end() ? it->second : nullptr;
772 }

Referenced by multicastGroupLeft(), and processV2Report().

◆ getHostGroupStateString()

const std::string inet::Igmpv2::getHostGroupStateString ( Igmpv2::HostGroupState  hgs)
static
948 {
949  if (hgs == IGMP_HGS_NON_MEMBER)
950  return "NON_MEMBER";
951  else if (hgs == IGMP_HGS_DELAYING_MEMBER)
952  return "DELAYING_MEMBER";
953  else if (hgs == IGMP_HGS_IDLE_MEMBER)
954  return "IDLE_MEMBER";
955 
956  return "UNKNOWN";
957 }

◆ getHostInterfaceData()

Igmpv2::HostInterfaceData * inet::Igmpv2::getHostInterfaceData ( NetworkInterface ie)
protectedvirtual
817 {
818  int interfaceId = ie->getInterfaceId();
819  auto it = hostData.find(interfaceId);
820  if (it != hostData.end())
821  return it->second;
822 
823  // create one
824  HostInterfaceData *data = createHostInterfaceData();
825  hostData[interfaceId] = data;
826  return data;
827 }

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

◆ getRouterGroupData()

Igmpv2::RouterGroupData * inet::Igmpv2::getRouterGroupData ( NetworkInterface ie,
const Ipv4Address group 
)
protectedvirtual
761 {
762  RouterInterfaceData *interfaceData = getRouterInterfaceData(ie);
763  auto it = interfaceData->groups.find(group);
764  return it != interfaceData->groups.end() ? it->second : nullptr;
765 }

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

◆ getRouterGroupStateString()

const std::string inet::Igmpv2::getRouterGroupStateString ( Igmpv2::RouterGroupState  rgs)
static
934 {
935  if (rgs == IGMP_RGS_NO_MEMBERS_PRESENT)
936  return "NO_MEMBERS_PRESENT";
937  else if (rgs == IGMP_RGS_MEMBERS_PRESENT)
938  return "MEMBERS_PRESENT";
939  else if (rgs == IGMP_RGS_V1_MEMBERS_PRESENT)
940  return "V1_MEMBERS_PRESENT";
941  else if (rgs == IGMP_RGS_CHECKING_MEMBERSHIP)
942  return "CHECKING_MEMBERSHIP";
943 
944  return "UNKNOWN";
945 }

◆ getRouterInterfaceData()

Igmpv2::RouterInterfaceData * inet::Igmpv2::getRouterInterfaceData ( NetworkInterface ie)
protectedvirtual
799 {
800  int interfaceId = ie->getInterfaceId();
801  auto it = routerData.find(interfaceId);
802  if (it != routerData.end())
803  return it->second;
804 
805  // create one
806  RouterInterfaceData *data = createRouterInterfaceData();
807  routerData[interfaceId] = data;
808  return data;
809 }

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

◆ getRouterStateString()

const std::string inet::Igmpv2::getRouterStateString ( Igmpv2::RouterState  rs)
static
922 {
923  if (rs == IGMP_RS_INITIAL)
924  return "INITIAL";
925  else if (rs == IGMP_RS_QUERIER)
926  return "QUERIER";
927  else if (rs == IGMP_RS_NON_QUERIER)
928  return "NON_QUERIER";
929 
930  return "UNKNOWN";
931 }

◆ handleMessage()

void inet::Igmpv2::handleMessage ( cMessage *  msg)
overrideprotectedvirtual
326 {
327  if (!enabled) {
328  if (!msg->isSelfMessage()) {
329  EV_ERROR << "Igmpv2 disabled, dropping packet.\n";
330  delete msg;
331  }
332  return;
333  }
334 
335  if (msg->isSelfMessage()) {
336  switch (msg->getKind()) {
337  case IGMP_QUERY_TIMER:
338  processQueryTimer(msg);
339  break;
340 
343  break;
344 
345  case IGMP_LEAVE_TIMER:
346  processLeaveTimer(msg);
347  break;
348 
349  case IGMP_REXMT_TIMER:
350  processRexmtTimer(msg);
351  break;
352 
353  default:
354  ASSERT(false);
355  break;
356  }
357  }
358  else if (!strcmp(msg->getArrivalGate()->getName(), "routerIn"))
359  send(msg, "ipOut");
360  else {
361  auto packet = check_and_cast<Packet *>(msg);
362  processIgmpMessage(packet);
363  }
364 }

◆ handleRegisterProtocol()

void inet::Igmpv2::handleRegisterProtocol ( const Protocol protocol,
cGate *  gate,
ServicePrimitive  servicePrimitive 
)
overrideprotectedvirtual

Reimplemented from inet::DefaultProtocolRegistrationListener.

374 {
375  Enter_Method("handleRegisterProtocol");
376 }

◆ handleRegisterService()

void inet::Igmpv2::handleRegisterService ( const Protocol protocol,
cGate *  gate,
ServicePrimitive  servicePrimitive 
)
overrideprotectedvirtual

Reimplemented from inet::DefaultProtocolRegistrationListener.

367 {
368  Enter_Method("handleRegisterService");
369  if (protocol == Protocol::igmp && servicePrimitive == SP_INDICATION)
370  externalRouter = true;
371 }

◆ initialize()

void inet::Igmpv2::initialize ( int  stage)
overrideprotectedvirtual
146 {
147  cSimpleModule::initialize(stage);
148 
149  if (stage == INITSTAGE_LOCAL) {
150  ift.reference(this, "interfaceTableModule", true);
151  rt.reference(this, "routingTableModule", true);
152 
153  externalRouter = false;
154  enabled = par("enabled");
155  robustness = par("robustnessVariable");
156  queryInterval = par("queryInterval");
157  queryResponseInterval = par("queryResponseInterval");
158  groupMembershipInterval = par("groupMembershipInterval");
159  otherQuerierPresentInterval = par("otherQuerierPresentInterval");
160  startupQueryInterval = par("startupQueryInterval");
161  startupQueryCount = par("startupQueryCount");
162  lastMemberQueryInterval = par("lastMemberQueryInterval");
163  lastMemberQueryCount = par("lastMemberQueryCount");
164  unsolicitedReportInterval = par("unsolicitedReportInterval");
165 // version1RouterPresentInterval = par("version1RouterPresentInterval");
166  const char *crcModeString = par("crcMode");
167  crcMode = parseCrcMode(crcModeString, false);
168 
169  addWatches();
170  }
171  // TODO INITSTAGE
172  else if (stage == INITSTAGE_NETWORK_LAYER_PROTOCOLS) {
173  cModule *host = getContainingNode(this);
174  registerProtocol(Protocol::igmp, gate("ipOut"), gate("ipIn"));
175  for (int i = 0; i < ift->getNumInterfaces(); ++i) {
176  NetworkInterface *ie = ift->getInterface(i);
177  if (ie->isMulticast()) {
178  if (auto ipv4interfaceData = ie->findProtocolData<Ipv4InterfaceData>()) {
179  int n = ipv4interfaceData->getNumOfJoinedMulticastGroups();
180  for (int j = 0; j < n; j++) {
181  auto groupAddress = ipv4interfaceData->getJoinedMulticastGroup(j);
182  multicastGroupJoined(ie, groupAddress);
183  }
184  }
185  }
186  }
187 
188  for (int i = 0; i < ift->getNumInterfaces(); ++i) {
189  NetworkInterface *ie = ift->getInterface(i);
190  if (ie->isMulticast())
191  configureInterface(ie);
192  }
193 
194  host->subscribe(interfaceCreatedSignal, this);
195  host->subscribe(interfaceDeletedSignal, this);
196  host->subscribe(ipv4MulticastGroupJoinedSignal, this);
197  host->subscribe(ipv4MulticastGroupLeftSignal, this);
198  }
199 }

◆ insertCrc() [1/2]

void inet::Igmpv2::insertCrc ( const Ptr< IgmpMessage > &  igmpMsg,
Packet payload 
)
inline
240 { insertCrc(crcMode, igmpMsg, payload); }

Referenced by insertCrc().

◆ insertCrc() [2/2]

void inet::Igmpv2::insertCrc ( CrcMode  crcMode,
const Ptr< IgmpMessage > &  igmpMsg,
Packet payload 
)
static
960 {
961  igmpMsg->setCrcMode(crcMode);
962  switch (crcMode) {
964  // if the CRC mode is declared to be correct, then set the CRC to an easily recognizable value
965  igmpMsg->setCrc(0xC00D);
966  break;
968  // if the CRC mode is declared to be incorrect, then set the CRC to an easily recognizable value
969  igmpMsg->setCrc(0xBAAD);
970  break;
971  case CRC_COMPUTED: {
972  // if the CRC mode is computed, then compute the CRC and set it
973  igmpMsg->setCrc(0x0000); // make sure that the CRC is 0 in the header before computing the CRC
974  MemoryOutputStream igmpStream;
975  Chunk::serialize(igmpStream, igmpMsg);
976  Chunk::serialize(igmpStream, packet->peekData(Chunk::PF_ALLOW_EMPTY));
977  uint16_t crc = TcpIpChecksum::checksum(igmpStream.getData());
978  igmpMsg->setCrc(crc);
979  break;
980  }
981  default:
982  throw cRuntimeError("Unknown CRC mode");
983  }
984 }

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

◆ multicastGroupJoined()

void inet::Igmpv2::multicastGroupJoined ( NetworkInterface ie,
const Ipv4Address groupAddr 
)
protectedvirtual
254 {
255  ASSERT(ie && ie->isMulticast());
256  ASSERT(groupAddr.isMulticast());
257 
258  if (enabled && !groupAddr.isLinkLocalMulticast()) {
259  HostGroupData *groupData = createHostGroupData(ie, groupAddr);
260  numGroups++;
261  numHostGroups++;
262 
263  sendReport(ie, groupData);
264  groupData->flag = true;
266  groupData->state = IGMP_HGS_DELAYING_MEMBER;
267  }
268 }

Referenced by initialize(), and receiveSignal().

◆ multicastGroupLeft()

void inet::Igmpv2::multicastGroupLeft ( NetworkInterface ie,
const Ipv4Address groupAddr 
)
protectedvirtual
271 {
272  ASSERT(ie && ie->isMulticast());
273  ASSERT(groupAddr.isMulticast());
274 
275  if (enabled && !groupAddr.isLinkLocalMulticast()) {
276  HostGroupData *groupData = getHostGroupData(ie, groupAddr);
277  if (groupData) {
278  if (groupData->state == IGMP_HGS_DELAYING_MEMBER)
279  cancelEvent(groupData->timer);
280 
281  if (groupData->flag)
282  sendLeave(ie, groupData);
283  }
284 
285  deleteHostGroupData(ie, groupAddr);
286  numHostGroups--;
287  numGroups--;
288  }
289 }

Referenced by receiveSignal().

◆ numInitStages()

virtual int inet::Igmpv2::numInitStages ( ) const
inlineoverrideprotectedvirtual
188 { return NUM_INIT_STAGES; }

◆ processGroupQuery()

void inet::Igmpv2::processGroupQuery ( NetworkInterface ie,
HostGroupData group,
simtime_t  maxRespTime 
)
protectedvirtual
548 {
549  double maxRespTimeSecs = maxRespTime.dbl(); // FIXME use simtime_t !!!
550 
551  if (group->state == IGMP_HGS_DELAYING_MEMBER) {
552  cMessage *timer = group->timer;
553  simtime_t maxAbsoluteRespTime = simTime() + maxRespTimeSecs;
554  if (timer->isScheduled() && maxAbsoluteRespTime < timer->getArrivalTime())
555  startHostTimer(ie, group, maxRespTimeSecs);
556  }
557  else if (group->state == IGMP_HGS_IDLE_MEMBER) {
558  startHostTimer(ie, group, maxRespTimeSecs);
559  group->state = IGMP_HGS_DELAYING_MEMBER;
560  }
561  else {
562  // ignored
563  }
564 }

Referenced by processQuery().

◆ processHostGroupTimer()

void inet::Igmpv2::processHostGroupTimer ( cMessage *  msg)
protectedvirtual
395 {
396  IgmpHostTimerContext *ctx = (IgmpHostTimerContext *)msg->getContextPointer();
397  EV_DEBUG << "Igmpv2: Host Timer expired for group=" << ctx->hostGroup->groupAddr << " iface=" << ctx->ie->getInterfaceName() << "\n";
398  sendReport(ctx->ie, ctx->hostGroup);
399  ctx->hostGroup->flag = true;
400  ctx->hostGroup->state = IGMP_HGS_IDLE_MEMBER;
401 }

Referenced by handleMessage().

◆ processIgmpMessage()

void inet::Igmpv2::processIgmpMessage ( Packet packet)
protectedvirtual
450 {
451  if (!verifyCrc(packet)) {
452  EV_WARN << "incoming IGMP packet has wrong CRC, dropped\n";
453  // drop packet
454  PacketDropDetails details;
455  details.setReason(INCORRECTLY_RECEIVED);
456  emit(packetDroppedSignal, packet, &details);
457  delete packet;
458  return;
459  }
460 
461  const auto& igmp = packet->peekAtFront<IgmpMessage>();
462  NetworkInterface *ie = ift->getInterfaceById(packet->getTag<InterfaceInd>()->getInterfaceId());
463  switch (igmp->getType()) {
465  processQuery(ie, packet);
466  break;
467 
468  //case IGMPV1_MEMBERSHIP_REPORT:
469 // processV1Report(ie, msg);
470 // delete msg;
471 // break;
473  processV2Report(ie, packet);
474  break;
475 
476  case IGMPV2_LEAVE_GROUP:
477  processLeave(ie, packet);
478  break;
479 
480  default:
481  if (externalRouter)
482  send(packet, "routerOut");
483  else {
484 // delete msg;
485  throw cRuntimeError("Igmpv2: Unhandled message type (%d) in packet %s", igmp->getType(), packet->getName());
486  }
487  break;
488  }
489 }

Referenced by handleMessage().

◆ processLeave()

void inet::Igmpv2::processLeave ( NetworkInterface ie,
Packet packet 
)
protectedvirtual
626 {
627  ASSERT(ie->isMulticast());
628 
629  const auto& msg = packet->peekAtFront<Igmpv2Leave>();
630 
631  EV_INFO << "Igmpv2: received Leave Group for group=" << msg->getGroupAddress() << " iface=" << ie->getInterfaceName() << "\n";
632 
633  numLeavesRecv++;
634 
635  if (rt->isMulticastForwardingEnabled()) {
636  if (externalRouter) {
637  send(packet, "routerOut");
638  return;
639  }
640 
641  Ipv4Address groupAddr = msg->getGroupAddress();
642  RouterInterfaceData *interfaceData = getRouterInterfaceData(ie);
643  RouterGroupData *groupData = getRouterGroupData(ie, groupAddr);
644  if (groupData) {
645  if (groupData->state == IGMP_RGS_MEMBERS_PRESENT && interfaceData->igmpRouterState == IGMP_RS_QUERIER) {
647  startTimer(groupData->rexmtTimer, lastMemberQueryInterval);
648  sendQuery(ie, groupAddr, lastMemberQueryInterval);
649  groupData->state = IGMP_RGS_CHECKING_MEMBERSHIP;
650  }
651  }
652  }
653 
654  delete packet;
655 }

Referenced by processIgmpMessage().

◆ processLeaveTimer()

void inet::Igmpv2::processLeaveTimer ( cMessage *  msg)
protectedvirtual
404 {
405  IgmpRouterTimerContext *ctx = (IgmpRouterTimerContext *)msg->getContextPointer();
406  EV_DEBUG << "Igmpv2: Leave Timer expired, deleting " << ctx->routerGroup->groupAddr << " from listener list of '" << ctx->ie->getInterfaceName() << "'\n";
407 
408  // notify Ipv4InterfaceData to update its listener list
409  ctx->ie->getProtocolDataForUpdate<Ipv4InterfaceData>()->removeMulticastListener(ctx->routerGroup->groupAddr);
410  numRouterGroups--;
411 
412  if (ctx->routerGroup->state == IGMP_RGS_CHECKING_MEMBERSHIP)
413  cancelEvent(ctx->routerGroup->rexmtTimer);
414 
415  ctx->routerGroup->state = IGMP_RGS_NO_MEMBERS_PRESENT;
416  deleteRouterGroupData(ctx->ie, ctx->routerGroup->groupAddr);
417  numGroups--;
418 }

Referenced by handleMessage().

◆ processQuery()

void inet::Igmpv2::processQuery ( NetworkInterface ie,
Packet packet 
)
protectedvirtual
492 {
493  ASSERT(ie->isMulticast());
494 
495  Ipv4Address sender = packet->getTag<L3AddressInd>()->getSrcAddress().toIpv4();
496  HostInterfaceData *interfaceData = getHostInterfaceData(ie);
497  const auto& igmpQry = packet->peekAtFront<IgmpQuery>(b(packet->getBitLength())); // peek entire igmp packet
498 
499  numQueriesRecv++;
500 
501  Ipv4Address groupAddr = igmpQry->getGroupAddress();
502  const Ptr<const Igmpv2Query>& v2Query = dynamicPtrCast<const Igmpv2Query>(igmpQry);
503  simtime_t maxRespTime = SimTime(v2Query ? v2Query->getMaxRespTimeCode() : 100, (SimTimeUnit) - 1);
504 
505  if (groupAddr.isUnspecified()) {
506  // general query
507  EV_INFO << "Igmpv2: received General Membership Query on iface=" << ie->getInterfaceName() << "\n";
509  for (auto& elem : interfaceData->groups)
510  processGroupQuery(ie, elem.second, maxRespTime);
511  }
512  else {
513  // group-specific query
514  EV_INFO << "Igmpv2: received Membership Query for group=" << groupAddr << " iface=" << ie->getInterfaceName() << "\n";
516  auto it = interfaceData->groups.find(groupAddr);
517  if (it != interfaceData->groups.end())
518  processGroupQuery(ie, it->second, maxRespTime);
519  }
520 
521  if (rt->isMulticastForwardingEnabled()) {
522  if (externalRouter) {
523  send(packet, "routerOut");
524  return;
525  }
526 
527  RouterInterfaceData *routerInterfaceData = getRouterInterfaceData(ie);
528  if (sender < ie->getProtocolData<Ipv4InterfaceData>()->getIPAddress()) {
529  startTimer(routerInterfaceData->igmpQueryTimer, otherQuerierPresentInterval);
530  routerInterfaceData->igmpRouterState = IGMP_RS_NON_QUERIER;
531  }
532 
533  if (!groupAddr.isUnspecified() && routerInterfaceData->igmpRouterState == IGMP_RS_NON_QUERIER) { // group specific query
534  RouterGroupData *groupData = getRouterGroupData(ie, groupAddr);
535  if (groupData->state == IGMP_RGS_MEMBERS_PRESENT) {
536  startTimer(groupData->timer, maxRespTime.dbl() * lastMemberQueryCount);
537  groupData->state = IGMP_RGS_CHECKING_MEMBERSHIP;
538  }
539  }
540  }
541  else
542  EV_INFO << "Igmpv2: multicast forwarding is not enabled on this node. \n";
543 
544  delete packet;
545 }

Referenced by processIgmpMessage().

◆ processQueryTimer()

void inet::Igmpv2::processQueryTimer ( cMessage *  msg)
protectedvirtual
381 {
382  NetworkInterface *ie = (NetworkInterface *)msg->getContextPointer();
383  ASSERT(ie);
384  EV_DEBUG << "Igmpv2: General Query timer expired, iface=" << ie->getInterfaceName() << "\n";
385  RouterInterfaceData *interfaceData = getRouterInterfaceData(ie);
386  RouterState state = interfaceData->igmpRouterState;
387  if (state == IGMP_RS_QUERIER || state == IGMP_RS_NON_QUERIER) {
388  interfaceData->igmpRouterState = IGMP_RS_QUERIER;
389  sendQuery(ie, Ipv4Address(), queryResponseInterval); // general query
391  }
392 }

Referenced by handleMessage().

◆ processRexmtTimer()

void inet::Igmpv2::processRexmtTimer ( cMessage *  msg)
protectedvirtual
421 {
422  IgmpRouterTimerContext *ctx = (IgmpRouterTimerContext *)msg->getContextPointer();
423  EV_DEBUG << "Igmpv2: Rexmt Timer expired for group=" << ctx->routerGroup->groupAddr << " iface=" << ctx->ie->getInterfaceName() << "\n";
424  sendQuery(ctx->ie, ctx->routerGroup->groupAddr, lastMemberQueryInterval);
425  startTimer(ctx->routerGroup->rexmtTimer, lastMemberQueryInterval);
426  ctx->routerGroup->state = IGMP_RGS_CHECKING_MEMBERSHIP;
427 }

Referenced by handleMessage().

◆ processV2Report()

void inet::Igmpv2::processV2Report ( NetworkInterface ie,
Packet packet 
)
protectedvirtual
567 {
568  ASSERT(ie->isMulticast());
569 
570  const auto& msg = packet->peekAtFront<Igmpv2Report>();
571 
572  Ipv4Address groupAddr = msg->getGroupAddress();
573 
574  EV_INFO << "Igmpv2: received V2 Membership Report for group=" << groupAddr << " iface=" << ie->getInterfaceName() << "\n";
575 
576  numReportsRecv++;
577 
578  HostGroupData *hostGroupData = getHostGroupData(ie, groupAddr);
579  if (hostGroupData) {
580  if (hostGroupData && hostGroupData->state == IGMP_HGS_DELAYING_MEMBER) {
581  cancelEvent(hostGroupData->timer);
582  hostGroupData->flag = false;
583  hostGroupData->state = IGMP_HGS_IDLE_MEMBER;
584  }
585  }
586 
587  if (rt->isMulticastForwardingEnabled()) {
588  if (externalRouter) {
589  send(packet, "routerOut");
590  return;
591  }
592 
593  RouterGroupData *routerGroupData = getRouterGroupData(ie, groupAddr);
594  if (!routerGroupData) {
595  routerGroupData = createRouterGroupData(ie, groupAddr);
596  numGroups++;
597  }
598 
599  if (!routerGroupData->timer) {
600  routerGroupData->timer = new cMessage("Igmpv2 leave timer", IGMP_LEAVE_TIMER);
601  routerGroupData->timer->setContextPointer(new IgmpRouterTimerContext(ie, routerGroupData));
602  }
603  if (!routerGroupData->rexmtTimer) {
604  routerGroupData->rexmtTimer = new cMessage("Igmpv2 rexmt timer", IGMP_REXMT_TIMER);
605  routerGroupData->rexmtTimer->setContextPointer(new IgmpRouterTimerContext(ie, routerGroupData));
606  }
607 
608  if (routerGroupData->state == IGMP_RGS_NO_MEMBERS_PRESENT) {
609  // notify Ipv4InterfaceData to update its listener list
610  ie->getProtocolDataForUpdate<Ipv4InterfaceData>()->addMulticastListener(groupAddr);
611  numRouterGroups++;
612  }
613  else if (routerGroupData->state == IGMP_RGS_CHECKING_MEMBERSHIP)
614  cancelEvent(routerGroupData->rexmtTimer);
615 
616  startTimer(routerGroupData->timer, groupMembershipInterval);
617  routerGroupData->state = IGMP_RGS_MEMBERS_PRESENT;
618  }
619  else
620  EV_INFO << "Igmpv2: multicast forwarding is not enabled on this node. \n";
621 
622  delete packet;
623 }

Referenced by processIgmpMessage().

◆ receiveSignal()

void inet::Igmpv2::receiveSignal ( cComponent *  source,
simsignal_t  signalID,
cObject *  obj,
cObject *  details 
)
overrideprotectedvirtual
223 {
224  Enter_Method("%s", cComponent::getSignalName(signalID));
225 
226  NetworkInterface *ie;
227  int interfaceId;
228  const Ipv4MulticastGroupInfo *info;
229 
230  if (signalID == ipv4MulticastGroupJoinedSignal) {
231  info = check_and_cast<const Ipv4MulticastGroupInfo *>(obj);
232  multicastGroupJoined(info->ie, info->groupAddress);
233  }
234  else if (signalID == ipv4MulticastGroupLeftSignal) {
235  info = check_and_cast<const Ipv4MulticastGroupInfo *>(obj);
236  multicastGroupLeft(info->ie, info->groupAddress);
237  }
238  else if (signalID == interfaceCreatedSignal) {
239  ie = check_and_cast<NetworkInterface *>(obj);
240  if (ie->isMulticast())
241  configureInterface(ie);
242  }
243  else if (signalID == interfaceDeletedSignal) {
244  ie = check_and_cast<NetworkInterface *>(obj);
245  if (ie->isMulticast()) {
246  interfaceId = ie->getInterfaceId();
247  deleteHostInterfaceData(interfaceId);
248  deleteRouterInterfaceData(interfaceId);
249  }
250  }
251 }

◆ sendLeave()

void inet::Igmpv2::sendLeave ( NetworkInterface ie,
HostGroupData group 
)
protectedvirtual
708 {
709  ASSERT(group->groupAddr.isMulticast() && !group->groupAddr.isLinkLocalMulticast());
710 
711  EV_INFO << "Igmpv2: sending Leave Group for group=" << group->groupAddr << " on iface=" << ie->getInterfaceName() << "\n";
712  Packet *packet = new Packet("Igmpv2 leave");
713  const auto& msg = makeShared<Igmpv2Leave>();
714  msg->setGroupAddress(group->groupAddr);
715  msg->setChunkLength(B(8));
716  insertCrc(msg, packet);
717  packet->insertAtFront(msg);
718  // TODO fill Router Alert option
719  auto raOption = new Ipv4OptionRouterAlert();
720  packet->addTag<Ipv4OptionsReq>()->appendOption(raOption);
722  numLeavesSent++;
723 }

Referenced by multicastGroupLeft().

◆ sendQuery()

void inet::Igmpv2::sendQuery ( NetworkInterface ie,
const Ipv4Address groupAddr,
double  maxRespTime 
)
protectedvirtual
660 {
661  ASSERT(groupAddr.isUnspecified() || (groupAddr.isMulticast() && !groupAddr.isLinkLocalMulticast()));
662 
663  RouterInterfaceData *interfaceData = getRouterInterfaceData(ie);
664 
665  if (interfaceData->igmpRouterState == IGMP_RS_QUERIER) {
666  if (groupAddr.isUnspecified())
667  EV_INFO << "Igmpv2: sending General Membership Query on iface=" << ie->getInterfaceName() << "\n";
668  else
669  EV_INFO << "Igmpv2: sending Membership Query for group=" << groupAddr << " on iface=" << ie->getInterfaceName() << "\n";
670 
671  Packet *packet = new Packet("Igmpv2 query");
672  const auto& msg = makeShared<Igmpv2Query>();
673  msg->setType(IGMP_MEMBERSHIP_QUERY);
674  msg->setGroupAddress(groupAddr);
675  msg->setMaxRespTimeCode(SimTime(maxRespTime).inUnit((SimTimeUnit) - 1));
676  msg->setChunkLength(B(8));
677  insertCrc(msg, packet);
678  packet->insertAtFront(msg);
679  sendToIP(packet, ie, groupAddr.isUnspecified() ? Ipv4Address::ALL_HOSTS_MCAST : groupAddr);
680 
681  numQueriesSent++;
682  if (groupAddr.isUnspecified())
684  else
686  }
687 }

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

◆ sendReport()

void inet::Igmpv2::sendReport ( NetworkInterface ie,
HostGroupData group 
)
protectedvirtual
690 {
691  ASSERT(group->groupAddr.isMulticast() && !group->groupAddr.isLinkLocalMulticast());
692 
693  EV_INFO << "Igmpv2: sending Membership Report for group=" << group->groupAddr << " on iface=" << ie->getInterfaceName() << "\n";
694  Packet *packet = new Packet("Igmpv2 report");
695  const auto& msg = makeShared<Igmpv2Report>();
696  msg->setGroupAddress(group->groupAddr);
697  msg->setChunkLength(B(8));
698  insertCrc(msg, packet);
699  packet->insertAtFront(msg);
700  // TODO fill Router Alert option
701  auto raOption = new Ipv4OptionRouterAlert();
702  packet->addTag<Ipv4OptionsReq>()->appendOption(raOption);
703  sendToIP(packet, ie, group->groupAddr);
704  numReportsSent++;
705 }

Referenced by multicastGroupJoined(), and processHostGroupTimer().

◆ sendToIP()

void inet::Igmpv2::sendToIP ( Packet msg,
NetworkInterface ie,
const Ipv4Address dest 
)
protectedvirtual
727 {
728  ASSERT(ie->isMulticast());
729 
730  msg->addTagIfAbsent<PacketProtocolTag>()->setProtocol(&Protocol::igmp);
731  msg->addTagIfAbsent<DispatchProtocolInd>()->setProtocol(&Protocol::igmp);
732  msg->addTagIfAbsent<DispatchProtocolReq>()->setProtocol(&Protocol::ipv4);
733  msg->addTagIfAbsent<InterfaceReq>()->setInterfaceId(ie->getInterfaceId());
734  msg->addTagIfAbsent<L3AddressReq>()->setDestAddress(dest);
735  msg->addTagIfAbsent<HopLimitReq>()->setHopLimit(1);
736 
737  send(msg, "ipOut");
738 }

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

◆ startHostTimer()

void inet::Igmpv2::startHostTimer ( NetworkInterface ie,
HostGroupData group,
double  maxRespTime 
)
protectedvirtual
436 {
437  if (!group->timer) {
438  group->timer = new cMessage("Igmpv2 group timer", IGMP_HOSTGROUP_TIMER);
439  group->timer->setContextPointer(new IgmpHostTimerContext(ie, group));
440  }
441 
442  double delay = uniform(0.0, maxRespTime);
443  EV_DEBUG << "setting host timer for " << ie->getInterfaceName() << " and group " << group->groupAddr.str() << " to " << delay << "\n";
444  startTimer(group->timer, delay);
445 }

Referenced by multicastGroupJoined(), and processGroupQuery().

◆ startTimer()

void inet::Igmpv2::startTimer ( cMessage *  timer,
double  interval 
)
protectedvirtual
430 {
431  ASSERT(timer);
432  rescheduleAfter(interval, timer);
433 }

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

◆ verifyCrc()

bool inet::Igmpv2::verifyCrc ( const Packet packet)
987 {
988  const auto& igmpMsg = packet->peekAtFront<IgmpMessage>(b(-1), Chunk::PF_ALLOW_INCORRECT);
989  switch (igmpMsg->getCrcMode()) {
991  // if the CRC mode is declared to be correct, then the check passes if and only if the chunks are correct
992  return igmpMsg->isCorrect();
994  // if the CRC mode is declared to be incorrect, then the check fails
995  return false;
996  case CRC_COMPUTED: {
997  // otherwise compute the CRC, the check passes if the result is 0xFFFF (includes the received CRC)
998  auto dataBytes = packet->peekDataAsBytes(Chunk::PF_ALLOW_INCORRECT);
999  uint16_t crc = TcpIpChecksum::checksum(dataBytes->getBytes());
1000  // TODO delete these isCorrect calls, rely on CRC only
1001  return crc == 0 && igmpMsg->isCorrect();
1002  }
1003  default:
1004  throw cRuntimeError("Unknown CRC mode");
1005  }
1006 }

Referenced by processIgmpMessage().

Member Data Documentation

◆ crcMode

CrcMode inet::Igmpv2::crcMode = CRC_MODE_UNDEFINED
protected

Referenced by initialize(), and insertCrc().

◆ enabled

bool inet::Igmpv2::enabled
protected

◆ externalRouter

◆ groupMembershipInterval

double inet::Igmpv2::groupMembershipInterval
protected

Referenced by initialize(), and processV2Report().

◆ hostData

InterfaceToHostDataMap inet::Igmpv2::hostData
protected

◆ ift

ModuleRefByPar<IInterfaceTable> inet::Igmpv2::ift
protected

Referenced by initialize(), and processIgmpMessage().

◆ lastMemberQueryCount

int inet::Igmpv2::lastMemberQueryCount
protected

◆ lastMemberQueryInterval

double inet::Igmpv2::lastMemberQueryInterval
protected

◆ numGeneralQueriesRecv

int inet::Igmpv2::numGeneralQueriesRecv = 0
protected

Referenced by addWatches(), and processQuery().

◆ numGeneralQueriesSent

int inet::Igmpv2::numGeneralQueriesSent = 0
protected

Referenced by addWatches(), and sendQuery().

◆ numGroups

int inet::Igmpv2::numGroups = 0
protected

◆ numGroupSpecificQueriesRecv

int inet::Igmpv2::numGroupSpecificQueriesRecv = 0
protected

Referenced by addWatches(), and processQuery().

◆ numGroupSpecificQueriesSent

int inet::Igmpv2::numGroupSpecificQueriesSent = 0
protected

Referenced by addWatches(), and sendQuery().

◆ numHostGroups

int inet::Igmpv2::numHostGroups = 0
protected

◆ numLeavesRecv

int inet::Igmpv2::numLeavesRecv = 0
protected

Referenced by addWatches(), and processLeave().

◆ numLeavesSent

int inet::Igmpv2::numLeavesSent = 0
protected

Referenced by addWatches(), and sendLeave().

◆ numQueriesRecv

int inet::Igmpv2::numQueriesRecv = 0
protected

Referenced by addWatches(), and processQuery().

◆ numQueriesSent

int inet::Igmpv2::numQueriesSent = 0
protected

Referenced by addWatches(), and sendQuery().

◆ numReportsRecv

int inet::Igmpv2::numReportsRecv = 0
protected

Referenced by addWatches(), and processV2Report().

◆ numReportsSent

int inet::Igmpv2::numReportsSent = 0
protected

Referenced by addWatches(), and sendReport().

◆ numRouterGroups

int inet::Igmpv2::numRouterGroups = 0
protected

◆ otherQuerierPresentInterval

double inet::Igmpv2::otherQuerierPresentInterval
protected

Referenced by initialize(), and processQuery().

◆ queryInterval

double inet::Igmpv2::queryInterval
protected

Referenced by initialize(), and processQueryTimer().

◆ queryResponseInterval

double inet::Igmpv2::queryResponseInterval
protected

◆ robustness

int inet::Igmpv2::robustness
protected

Referenced by initialize().

◆ routerData

◆ rt

◆ startupQueryCount

int inet::Igmpv2::startupQueryCount
protected

Referenced by initialize().

◆ startupQueryInterval

double inet::Igmpv2::startupQueryInterval
protected

Referenced by configureInterface(), and initialize().

◆ unsolicitedReportInterval

double inet::Igmpv2::unsolicitedReportInterval
protected

Referenced by initialize(), and multicastGroupJoined().


The documentation for this class was generated from the following files:
inet::Igmpv2::configureInterface
virtual void configureInterface(NetworkInterface *ie)
Definition: Igmpv2.cc:291
inet::Igmpv2::processRexmtTimer
virtual void processRexmtTimer(cMessage *msg)
Definition: Igmpv2.cc:420
inet::Igmpv2::deleteRouterGroupData
virtual void deleteRouterGroupData(NetworkInterface *ie, const Ipv4Address &group)
Definition: Igmpv2.cc:774
inet::Igmpv2::startupQueryCount
int startupQueryCount
Definition: Igmpv2.h:149
inet::Igmpv2::numGeneralQueriesSent
int numGeneralQueriesSent
Definition: Igmpv2.h:163
inet::Igmpv2::routerData
InterfaceToRouterDataMap routerData
Definition: Igmpv2.h:180
inet::Igmpv2::IGMP_RS_NON_QUERIER
@ IGMP_RS_NON_QUERIER
Definition: Igmpv2.h:31
inet::Igmpv2::lastMemberQueryCount
int lastMemberQueryCount
Definition: Igmpv2.h:151
inet::ipv4MulticastGroupLeftSignal
simsignal_t ipv4MulticastGroupLeftSignal
Definition: Simsignals.cc:50
protocol
removed DscpReq Ipv4ControlInfo Ipv6ControlInfo up L3AddressInd DispatchProtocolReq L4PortInd Ipv4ControlInfo Ipv6ControlInfo down protocol
Definition: IUdp-gates.txt:25
inet::Igmpv2::queryInterval
double queryInterval
Definition: Igmpv2.h:144
inet::Igmpv2::multicastGroupLeft
virtual void multicastGroupLeft(NetworkInterface *ie, const Ipv4Address &groupAddr)
Definition: Igmpv2.cc:270
inet::Igmpv2::deleteRouterInterfaceData
virtual void deleteRouterInterfaceData(int interfaceId)
Definition: Igmpv2.cc:315
inet::Igmpv2::numGeneralQueriesRecv
int numGeneralQueriesRecv
Definition: Igmpv2.h:164
inet::INCORRECTLY_RECEIVED
@ INCORRECTLY_RECEIVED
Definition: Simsignals_m.h:71
inet::Protocol::ipv4
static const Protocol ipv4
Definition: Protocol.h:93
inet::Igmpv2::IGMP_RGS_NO_MEMBERS_PRESENT
@ IGMP_RGS_NO_MEMBERS_PRESENT
Definition: Igmpv2.h:35
inet::Igmpv2::numLeavesRecv
int numLeavesRecv
Definition: Igmpv2.h:170
inet::Igmpv2::otherQuerierPresentInterval
double otherQuerierPresentInterval
Definition: Igmpv2.h:147
inet::Igmpv2::getRouterInterfaceData
virtual RouterInterfaceData * getRouterInterfaceData(NetworkInterface *ie)
Definition: Igmpv2.cc:798
inet::Igmpv2::numQueriesSent
int numQueriesSent
Definition: Igmpv2.h:161
inet::Igmpv2::numQueriesRecv
int numQueriesRecv
Definition: Igmpv2.h:162
inet::getContainingNode
cModule * getContainingNode(const cModule *from)
Find the node containing the given module.
Definition: ModuleAccess.cc:40
inet::CRC_COMPUTED
@ CRC_COMPUTED
Definition: CrcMode_m.h:59
inet::IGMPV2_LEAVE_GROUP
@ IGMPV2_LEAVE_GROUP
Definition: IgmpMessage_m.h:74
inet::Igmpv2::deleteHostInterfaceData
virtual void deleteHostInterfaceData(int interfaceId)
Definition: Igmpv2.cc:305
inet::Igmpv2::processHostGroupTimer
virtual void processHostGroupTimer(cMessage *msg)
Definition: Igmpv2.cc:394
inet::Igmpv2::processGroupQuery
virtual void processGroupQuery(NetworkInterface *ie, HostGroupData *group, simtime_t maxRespTime)
Definition: Igmpv2.cc:547
InterfaceReq
removed InterfaceReq
Definition: IUdp-gates.txt:11
inet::Chunk::serialize
static void serialize(MemoryOutputStream &stream, const Ptr< const Chunk > &chunk, b offset=b(0), b length=b(-1))
Serializes a chunk into the given stream.
Definition: Chunk.cc:175
DispatchProtocolReq
removed DscpReq Ipv4ControlInfo Ipv6ControlInfo up L3AddressInd DispatchProtocolReq L4PortInd Ipv4ControlInfo Ipv6ControlInfo down DispatchProtocolReq
Definition: IUdp-gates.txt:25
inet::ipv4MulticastGroupJoinedSignal
simsignal_t ipv4MulticastGroupJoinedSignal
Definition: Simsignals.cc:49
L3AddressInd
removed DscpReq Ipv4ControlInfo Ipv6ControlInfo up L3AddressInd L3AddressInd
Definition: IUdp-gates.txt:20
inet::Igmpv2::enabled
bool enabled
Definition: Igmpv2.h:141
inet::IGMP_MEMBERSHIP_QUERY
@ IGMP_MEMBERSHIP_QUERY
Definition: IgmpMessage_m.h:71
inet::Igmpv2::sendReport
virtual void sendReport(NetworkInterface *ie, HostGroupData *group)
Definition: Igmpv2.cc:689
inet::parseCrcMode
CrcMode parseCrcMode(const char *crcModeString, bool allowDisable)
Definition: CrcMode.cc:14
inet::Igmpv2::IGMP_LEAVE_TIMER
@ IGMP_LEAVE_TIMER
Definition: Igmpv2.h:50
inet::Igmpv2::numGroupSpecificQueriesSent
int numGroupSpecificQueriesSent
Definition: Igmpv2.h:165
inet::Igmpv2::createHostInterfaceData
virtual HostInterfaceData * createHostInterfaceData()
Definition: Igmpv2.cc:829
inet::Igmpv2::numReportsSent
int numReportsSent
Definition: Igmpv2.h:167
inet::Igmpv2::verifyCrc
bool verifyCrc(const Packet *packet)
Definition: Igmpv2.cc:986
inet::packetDroppedSignal
simsignal_t packetDroppedSignal
Definition: Simsignals.cc:85
inet::Igmpv2::IGMP_HGS_DELAYING_MEMBER
@ IGMP_HGS_DELAYING_MEMBER
Definition: Igmpv2.h:43
PacketProtocolTag
removed DscpReq Ipv4ControlInfo Ipv6ControlInfo up L3AddressInd DispatchProtocolReq L4PortInd Ipv4ControlInfo Ipv6ControlInfo down PacketProtocolTag
Definition: IUdp-gates.txt:25
inet::Igmpv2::processLeaveTimer
virtual void processLeaveTimer(cMessage *msg)
Definition: Igmpv2.cc:403
inet::Igmpv2::sendQuery
virtual void sendQuery(NetworkInterface *ie, const Ipv4Address &groupAddr, double maxRespTime)
Definition: Igmpv2.cc:659
inet::interfaceDeletedSignal
simsignal_t interfaceDeletedSignal
Definition: Simsignals.cc:31
inet::Igmpv2::IGMP_REXMT_TIMER
@ IGMP_REXMT_TIMER
Definition: Igmpv2.h:51
inet::Igmpv2::createHostGroupData
virtual HostGroupData * createHostGroupData(NetworkInterface *ie, const Ipv4Address &group)
Definition: Igmpv2.cc:751
inet::Igmpv2::startHostTimer
virtual void startHostTimer(NetworkInterface *ie, HostGroupData *group, double maxRespTime)
Definition: Igmpv2.cc:435
inet::units::units::B
intscale< b, 1, 8 > B
Definition: Units.h:1168
inet::Igmpv2::processQueryTimer
virtual void processQueryTimer(cMessage *msg)
Definition: Igmpv2.cc:380
inet::Igmpv2::lastMemberQueryInterval
double lastMemberQueryInterval
Definition: Igmpv2.h:150
inet::Ipv4Address::ALL_ROUTERS_MCAST
static const Ipv4Address ALL_ROUTERS_MCAST
224.0.0.2 All routers on a subnet
Definition: Ipv4Address.h:97
inet::Igmpv2::insertCrc
static void insertCrc(CrcMode crcMode, const Ptr< IgmpMessage > &igmpMsg, Packet *payload)
Definition: Igmpv2.cc:959
inet::Igmpv2::IGMP_RS_QUERIER
@ IGMP_RS_QUERIER
Definition: Igmpv2.h:30
inet::Igmpv2::numHostGroups
int numHostGroups
Definition: Igmpv2.h:157
inet::Igmpv2::IGMP_HGS_NON_MEMBER
@ IGMP_HGS_NON_MEMBER
Definition: Igmpv2.h:42
inet::Igmpv2::IGMP_HGS_IDLE_MEMBER
@ IGMP_HGS_IDLE_MEMBER
Definition: Igmpv2.h:44
inet::Chunk::PF_ALLOW_EMPTY
@ PF_ALLOW_EMPTY
Definition: Chunk.h:279
inet::Igmpv2::queryResponseInterval
double queryResponseInterval
Definition: Igmpv2.h:145
HopLimitReq
removed HopLimitReq
Definition: IUdp-gates.txt:11
inet::Igmpv2::numReportsRecv
int numReportsRecv
Definition: Igmpv2.h:168
inet::Igmpv2::createRouterInterfaceData
virtual RouterInterfaceData * createRouterInterfaceData()
Definition: Igmpv2.cc:811
inet::Igmpv2::startupQueryInterval
double startupQueryInterval
Definition: Igmpv2.h:148
inet::IGMPV2_MEMBERSHIP_REPORT
@ IGMPV2_MEMBERSHIP_REPORT
Definition: IgmpMessage_m.h:73
inet::INITSTAGE_LOCAL
INET_API InitStage INITSTAGE_LOCAL
Initialization of local state that don't use or affect other modules includes:
inet::Igmpv2::IGMP_RGS_V1_MEMBERS_PRESENT
@ IGMP_RGS_V1_MEMBERS_PRESENT
Definition: Igmpv2.h:37
inet::Igmpv2::IGMP_HOSTGROUP_TIMER
@ IGMP_HOSTGROUP_TIMER
Definition: Igmpv2.h:49
inet::Igmpv2::sendToIP
virtual void sendToIP(Packet *msg, NetworkInterface *ie, const Ipv4Address &dest)
Definition: Igmpv2.cc:726
inet::units::values::b
value< int64_t, units::b > b
Definition: Units.h:1241
NUM_INIT_STAGES
#define NUM_INIT_STAGES
Definition: InitStageRegistry.h:73
inet::Chunk::PF_ALLOW_INCORRECT
@ PF_ALLOW_INCORRECT
Definition: Chunk.h:281
inet::Igmpv2::IGMP_QUERY_TIMER
@ IGMP_QUERY_TIMER
Definition: Igmpv2.h:48
inet::SP_INDICATION
@ SP_INDICATION
Definition: ProtocolTag_m.h:175
inet::Protocol::igmp
static const Protocol igmp
Definition: Protocol.h:91
inet::TcpIpChecksum::checksum
static uint16_t checksum(const void *addr, unsigned int count)
Definition: TcpIpChecksum.h:33
inet::Igmpv2::createRouterGroupData
virtual RouterGroupData * createRouterGroupData(NetworkInterface *ie, const Ipv4Address &group)
Definition: Igmpv2.cc:742
inet::CRC_DECLARED_CORRECT
@ CRC_DECLARED_CORRECT
Definition: CrcMode_m.h:57
inet::Igmpv2::addWatches
void addWatches()
Definition: Igmpv2.cc:201
inet::Igmpv2::sendLeave
virtual void sendLeave(NetworkInterface *ie, HostGroupData *group)
Definition: Igmpv2.cc:707
inet::Igmpv2::processIgmpMessage
virtual void processIgmpMessage(Packet *packet)
Definition: Igmpv2.cc:449
inet::Igmpv2::groupMembershipInterval
double groupMembershipInterval
Definition: Igmpv2.h:146
inet::CRC_DECLARED_INCORRECT
@ CRC_DECLARED_INCORRECT
Definition: CrcMode_m.h:58
inet::Igmpv2::rt
ModuleRefByPar< IIpv4RoutingTable > rt
Definition: Igmpv2.h:138
inet::Igmpv2::unsolicitedReportInterval
double unsolicitedReportInterval
Definition: Igmpv2.h:152
inet::Igmpv2::getRouterGroupData
virtual RouterGroupData * getRouterGroupData(NetworkInterface *ie, const Ipv4Address &group)
Definition: Igmpv2.cc:760
Enter_Method
#define Enter_Method(...)
Definition: SelfDoc.h:71
inet::Igmpv2::hostData
InterfaceToHostDataMap hostData
Definition: Igmpv2.h:179
inet::Igmpv2::numLeavesSent
int numLeavesSent
Definition: Igmpv2.h:169
inet::Igmpv2::getHostInterfaceData
virtual HostInterfaceData * getHostInterfaceData(NetworkInterface *ie)
Definition: Igmpv2.cc:816
inet::Igmpv2::IGMP_RS_INITIAL
@ IGMP_RS_INITIAL
Definition: Igmpv2.h:29
inet::Igmpv2::ift
ModuleRefByPar< IInterfaceTable > ift
Definition: Igmpv2.h:139
inet::Igmpv2::processV2Report
virtual void processV2Report(NetworkInterface *ie, Packet *packet)
Definition: Igmpv2.cc:566
inet::Igmpv2::IGMP_RGS_CHECKING_MEMBERSHIP
@ IGMP_RGS_CHECKING_MEMBERSHIP
Definition: Igmpv2.h:38
inet::Ipv4Address::ALL_HOSTS_MCAST
static const Ipv4Address ALL_HOSTS_MCAST
224.0.0.1 All hosts on a subnet
Definition: Ipv4Address.h:96
inet::Igmpv2::IGMP_RGS_MEMBERS_PRESENT
@ IGMP_RGS_MEMBERS_PRESENT
Definition: Igmpv2.h:36
inet::Igmpv2::processQuery
virtual void processQuery(NetworkInterface *ie, Packet *packet)
Definition: Igmpv2.cc:491
inet::Igmpv2::getHostGroupData
virtual HostGroupData * getHostGroupData(NetworkInterface *ie, const Ipv4Address &group)
Definition: Igmpv2.cc:767
inet::Igmpv2::crcMode
CrcMode crcMode
Definition: Igmpv2.h:173
inet::interfaceCreatedSignal
simsignal_t interfaceCreatedSignal
Definition: Simsignals.cc:30
inet::Igmpv2::RouterState
RouterState
Definition: Igmpv2.h:28
inet::Igmpv2::externalRouter
bool externalRouter
Definition: Igmpv2.h:142
inet::Igmpv2::numRouterGroups
int numRouterGroups
Definition: Igmpv2.h:158
inet::Igmpv2::processLeave
virtual void processLeave(NetworkInterface *ie, Packet *packet)
Definition: Igmpv2.cc:625
inet::registerProtocol
void registerProtocol(const Protocol &protocol, cGate *gate, ServicePrimitive servicePrimitive)
Registers a protocol primitive (PDU processing) at the given gate.
Definition: IProtocolRegistrationListener.cc:83
inet::Igmpv2::multicastGroupJoined
virtual void multicastGroupJoined(NetworkInterface *ie, const Ipv4Address &groupAddr)
Definition: Igmpv2.cc:253
inet::Igmpv2::deleteHostGroupData
virtual void deleteHostGroupData(NetworkInterface *ie, const Ipv4Address &group)
Definition: Igmpv2.cc:785
inet::Igmpv2::numGroups
int numGroups
Definition: Igmpv2.h:156
inet::Igmpv2::robustness
int robustness
Definition: Igmpv2.h:143
inet::Igmpv2::numGroupSpecificQueriesRecv
int numGroupSpecificQueriesRecv
Definition: Igmpv2.h:166
inet::INITSTAGE_NETWORK_LAYER_PROTOCOLS
INET_API InitStage INITSTAGE_NETWORK_LAYER_PROTOCOLS
Initialization of network layer protocols over IP.
inet::Igmpv2::startTimer
virtual void startTimer(cMessage *timer, double interval)
Definition: Igmpv2.cc:429
inet::containsKey
bool containsKey(const std::map< K, V, _C > &m, const Tk &a)
Definition: stlutils.h:80