|
INET Framework for OMNeT++/OMNEST
|
Base class of PimSm and PimDm modules.
More...
#include <PimBase.h>
|
| enum | PimTimerKind {
HelloTimer = 1,
TriggeredHelloDelay,
AssertTimer,
PruneTimer,
PrunePendingTimer,
GraftRetryTimer,
UpstreamOverrideTimer,
PruneLimitTimer,
SourceActiveTimer,
StateRefreshTimer,
KeepAliveTimer,
RegisterStopTimer,
ExpiryTimer,
JoinTimer
} |
| |
| enum | State |
| |
Base class of PimSm and PimDm modules.
◆ PimTimerKind
| Enumerator |
|---|
| HelloTimer | |
| TriggeredHelloDelay | |
| AssertTimer | |
| PruneTimer | |
| PrunePendingTimer | |
| GraftRetryTimer | |
| UpstreamOverrideTimer | |
| PruneLimitTimer | |
| SourceActiveTimer | |
| StateRefreshTimer | |
| KeepAliveTimer | |
| RegisterStopTimer | |
| ExpiryTimer | |
| JoinTimer | |
◆ PimBase()
◆ ~PimBase()
| inet::PimBase::~PimBase |
( |
| ) |
|
|
virtual |
◆ handleCrashOperation()
◆ handleStartOperation()
◆ handleStopOperation()
◆ initialize()
| void inet::PimBase::initialize |
( |
int |
stage | ) |
|
|
overrideprotectedvirtual |
Reimplemented from inet::OperationalMixin< cSimpleModule >.
Reimplemented in inet::PimDm, and inet::PimSm.
42 ift.reference(
this,
"interfaceTableModule",
true);
43 rt.reference(
this,
"routingTableModule",
true);
44 pimIft.reference(
this,
"pimInterfaceTableModule",
true);
45 pimNbt.reference(
this,
"pimNeighborTableModule",
true);
49 throw cRuntimeError(
"PimBase: containing node not found.");
56 pimModule = check_and_cast<Pim *>(getParentModule());
Referenced by inet::PimSm::initialize(), and inet::PimDm::initialize().
◆ numInitStages()
| virtual int inet::PimBase::numInitStages |
( |
| ) |
const |
|
inlineoverrideprotectedvirtual |
◆ processHelloPacket()
| void inet::PimBase::processHelloPacket |
( |
Packet * |
pk | ) |
|
|
protected |
155 int interfaceId = packet->getTag<InterfaceInd>()->getInterfaceId();
157 Ipv4Address address = packet->getTag<
L3AddressInd>()->getSrcAddress().toIpv4();
158 const auto& pimPacket = packet->peekAtFront<PimHello>();
159 int version = pimPacket->getVersion();
165 long drPriority = -1L;
166 unsigned int generationId = 0;
167 for (
unsigned int i = 0; i < pimPacket->getOptionsArraySize(); i++) {
168 const HelloOption *option = pimPacket->getOptions(i);
169 switch (option->getType()) {
171 holdTime = check_and_cast<const HoldtimeOption *>(option)->getHoldTime();
174 drPriority = check_and_cast<const DrPriorityOption *>(option)->getPriority();
177 generationId = check_and_cast<const GenerationIdOption *>(option)->getGenerationID();
184 NetworkInterface *ie =
ift->getInterfaceById(interfaceId);
186 EV_INFO <<
"Received PIM Hello from neighbor: interface=" << ie->getInterfaceName() <<
" address=" << address <<
"\n";
188 PimNeighbor *neighbor =
pimNbt->findNeighbor(interfaceId, address);
192 neighbor =
new PimNeighbor(ie, address, version);
200 neighbor->setGenerationId(generationId);
201 neighbor->setDRPriority(drPriority);
Referenced by inet::PimSm::handleMessageWhenUp(), and inet::PimDm::handleMessageWhenUp().
◆ processHelloTimer()
| void inet::PimBase::processHelloTimer |
( |
cMessage * |
timer | ) |
|
|
protected |
◆ sendHelloPacket()
| void inet::PimBase::sendHelloPacket |
( |
PimInterface * |
pimInterface | ) |
|
|
protected |
114 EV_INFO <<
"Sending Hello packet on interface '" << pimInterface->getInterfacePtr()->getInterfaceName() <<
"'\n";
116 Packet *pk =
new Packet(
"PimHello");
117 const auto& msg = makeShared<PimHello>();
122 HoldtimeOption *holdtimeOption =
new HoldtimeOption();
123 holdtimeOption->setHoldTime(
holdTime < 0 ? (uint16_t)0xffff : (uint16_t)
holdTime);
124 msg->setOptions(0, holdtimeOption);
126 GenerationIdOption *genIdOption =
new GenerationIdOption();
128 msg->setOptions(1, genIdOption);
131 DrPriorityOption *drPriorityOption =
new DrPriorityOption();
133 msg->setOptions(2, drPriorityOption);
137 msg->setChunkLength(byteLength);
138 msg->setCrcMode(
pimModule->getCrcMode());
140 pk->insertAtFront(msg);
142 pk->addTag<
InterfaceReq>()->setInterfaceId(pimInterface->getInterfaceId());
143 pk->addTag<DispatchProtocolInd>()->setProtocol(&
Protocol::pim);
Referenced by sendHelloPackets().
◆ sendHelloPackets()
| void inet::PimBase::sendHelloPackets |
( |
| ) |
|
|
protected |
105 for (
int i = 0; i <
pimIft->getNumInterfaces(); i++) {
106 PimInterface *pimInterface =
pimIft->getInterface(i);
107 if (pimInterface->getMode() ==
mode)
Referenced by processHelloTimer().
◆ operator<<
| std::ostream& operator<< |
( |
std::ostream & |
out, |
|
|
const SourceAndGroup & |
sourceGroup |
|
) |
| |
|
friend |
235 out <<
"(source: " << (sourceGroup.source.isUnspecified() ?
"*" : sourceGroup.source.str()) <<
", "
236 <<
"group: " << (sourceGroup.group.isUnspecified() ?
"*" : sourceGroup.group.str()) <<
")";
◆ ALL_PIM_ROUTERS_MCAST
◆ designatedRouterPriority
| int inet::PimBase::designatedRouterPriority = 0 |
|
protected |
◆ generationID
| uint32_t inet::PimBase::generationID = 0 |
|
protected |
◆ helloPeriod
| double inet::PimBase::helloPeriod = 0 |
|
protected |
◆ helloTimer
| cMessage* inet::PimBase::helloTimer = nullptr |
|
protected |
◆ holdTime
| double inet::PimBase::holdTime = 0 |
|
protected |
Referenced by initialize(), processHelloPacket(), inet::PimSm::processJoinG(), inet::PimSm::processJoinPrunePacket(), inet::PimSm::processJoinSG(), inet::PimDm::processPrune(), inet::PimDm::processPrunePendingTimer(), inet::PimSm::restartExpiryTimer(), sendHelloPacket(), inet::PimDm::sendPrunePacket(), inet::PimSm::PimsmInterface::startExpiryTimer(), and inet::PimDm::DownstreamInterface::startPruneTimer().
◆ hostname
| const char* inet::PimBase::hostname = nullptr |
|
protected |
◆ ift
◆ isEnabled
| bool inet::PimBase::isEnabled = false |
|
protected |
◆ isUp
| bool inet::PimBase::isUp = false |
|
protected |
◆ mode
◆ pimIft
Referenced by inet::PimSm::addNewRouteG(), inet::PimSm::addNewRouteSG(), inet::PimDm::getIncomingInterface(), inet::PimSm::getIncomingInterface(), handleStartOperation(), inet::PimSm::IamDR(), initialize(), inet::PimDm::multicastPacketArrivedOnRpfInterface(), inet::PimDm::receiveSignal(), inet::PimSm::receiveSignal(), sendHelloPackets(), inet::PimDm::unroutableMulticastPacketArrived(), inet::PimSm::unroutableMulticastPacketArrived(), and inet::PimSm::updateDesignatedRouterAddress().
◆ pimModule
| opp_component_ptr<Pim> inet::PimBase::pimModule |
|
protected |
Referenced by initialize(), inet::PimDm::sendAssertPacket(), inet::PimDm::sendGraftAckPacket(), inet::PimDm::sendGraftPacket(), sendHelloPacket(), inet::PimDm::sendJoinPacket(), inet::PimSm::sendPIMAssert(), inet::PimSm::sendPIMJoin(), inet::PimSm::sendPIMPrune(), inet::PimSm::sendPIMRegister(), inet::PimSm::sendPIMRegisterNull(), inet::PimSm::sendPIMRegisterStop(), inet::PimDm::sendPrunePacket(), and inet::PimDm::sendStateRefreshPacket().
◆ pimNbt
Referenced by inet::PimSm::addNewRouteG(), inet::PimSm::addNewRouteSG(), initialize(), inet::PimDm::multicastPacketArrivedOnNonRpfInterface(), processHelloPacket(), inet::PimDm::processJoinPrunePacket(), inet::PimSm::processPruneG(), inet::PimSm::processPrunePendingTimer(), inet::PimSm::processPruneSG(), inet::PimDm::rpfInterfaceHasChanged(), inet::PimDm::unroutableMulticastPacketArrived(), and inet::PimSm::updateDesignatedRouterAddress().
◆ rcvdHelloPkSignal
| simsignal_t inet::PimBase::rcvdHelloPkSignal = registerSignal("rcvdHelloPk") |
|
staticprotected |
◆ rt
Referenced by inet::PimSm::addNewRouteG(), inet::PimSm::addNewRouteSG(), inet::PimDm::clearRoutes(), inet::PimSm::clearRoutes(), inet::PimSm::deleteMulticastRoute(), inet::PimDm::findIpv4MulticastRoute(), inet::PimSm::findIpv4Route(), initialize(), inet::PimSm::multicastPacketForwarded(), inet::PimDm::multicastReceiverAdded(), inet::PimDm::multicastReceiverRemoved(), inet::PimDm::processSourceActiveTimer(), inet::PimDm::receiveSignal(), inet::PimSm::sendPIMJoin(), inet::PimSm::sendPIMPrune(), inet::PimSm::sendPIMRegisterNull(), inet::PimSm::sendPIMRegisterStop(), inet::PimDm::unroutableMulticastPacketArrived(), and inet::PimSm::unroutableMulticastPacketArrived().
◆ sentHelloPkSignal
| simsignal_t inet::PimBase::sentHelloPkSignal = registerSignal("sentHelloPk") |
|
staticprotected |
The documentation for this class was generated from the following files:
cModule * findContainingNode(const cModule *from)
Find the node containing the given module.
Definition: ModuleAccess.cc:31
@ GenerationID
Definition: PimPacket_m.h:126
PimInterface::PimMode mode
Definition: PimBase.h:161
@ JoinTimer
Definition: PimBase.h:140
const B PIM_HEADER_LENGTH
Definition: PimPacket_m.h:68
ModuleRefByPar< IInterfaceTable > ift
Definition: PimBase.h:147
@ SourceActiveTimer
Definition: PimBase.h:133
@ KeepAliveTimer
Definition: PimBase.h:137
static const Protocol ipv4
Definition: Protocol.h:93
@ DRPriority
Definition: PimPacket_m.h:125
virtual void initialize(int stage) override
Definition: OperationalMixinImpl.h:26
bool isEnabled
Definition: PimBase.h:153
removed InterfaceReq
Definition: IUdp-gates.txt:11
removed DscpReq Ipv4ControlInfo Ipv6ControlInfo up L3AddressInd DispatchProtocolReq L4PortInd Ipv4ControlInfo Ipv6ControlInfo down DispatchProtocolReq
Definition: IUdp-gates.txt:25
removed DscpReq Ipv4ControlInfo Ipv6ControlInfo up L3AddressInd L3AddressInd
Definition: IUdp-gates.txt:20
opp_component_ptr< Pim > pimModule
Definition: PimBase.h:150
@ UpstreamOverrideTimer
Definition: PimBase.h:131
void sendHelloPacket(PimInterface *pimInterface)
Definition: PimBase.cc:112
static void insertCrc(const Ptr< PimPacket > &pimPacket)
Definition: Pim.cc:103
@ PrunePendingTimer
Definition: PimBase.h:127
static const Ipv4Address ALL_PIM_ROUTERS_MCAST
Definition: PimBase.h:143
@ ExpiryTimer
Definition: PimBase.h:139
removed DscpReq Ipv4ControlInfo Ipv6ControlInfo up L3AddressInd DispatchProtocolReq L4PortInd Ipv4ControlInfo Ipv6ControlInfo down PacketProtocolTag
Definition: IUdp-gates.txt:25
@ PruneLimitTimer
Definition: PimBase.h:132
static const Protocol pim
Definition: Protocol.h:103
@ StateRefreshTimer
Definition: PimBase.h:134
intscale< b, 1, 8 > B
Definition: Units.h:1168
@ PruneTimer
Definition: PimBase.h:126
removed HopLimitReq
Definition: IUdp-gates.txt:11
ModuleRefByPar< PimInterfaceTable > pimIft
Definition: PimBase.h:148
double helloPeriod
Definition: PimBase.h:157
INET_API InitStage INITSTAGE_LOCAL
Initialization of local state that don't use or affect other modules includes:
static simsignal_t rcvdHelloPkSignal
Definition: PimBase.h:167
#define NUM_INIT_STAGES
Definition: InitStageRegistry.h:73
double holdTime
Definition: PimBase.h:158
void sendHelloPackets()
Definition: PimBase.cc:103
ModuleRefByPar< PimNeighborTable > pimNbt
Definition: PimBase.h:149
int designatedRouterPriority
Definition: PimBase.h:159
@ SparseMode
Definition: PimInterfaceTable.h:26
uint32_t generationID
Definition: PimBase.h:162
@ RegisterStopTimer
Definition: PimBase.h:138
@ TriggeredHelloDelay
Definition: PimBase.h:122
@ AssertTimer
Definition: PimBase.h:125
static simsignal_t sentHelloPkSignal
Definition: PimBase.h:166
@ GraftRetryTimer
Definition: PimBase.h:130
cMessage * helloTimer
Definition: PimBase.h:163
@ Holdtime
Definition: PimPacket_m.h:123
@ HelloTimer
Definition: PimBase.h:121
const char * hostname
Definition: PimBase.h:154
ModuleRefByPar< IIpv4RoutingTable > rt
Definition: PimBase.h:146