INET Framework for OMNeT++/OMNEST
inet::PimDm::DownstreamInterface Struct Reference
Inheritance diagram for inet::PimDm::DownstreamInterface:

Public Types

enum  Flags { HAS_CONNECTED_RECEIVERS = 0x01 }
 
enum  PruneState { NO_INFO, PRUNE_PENDING, PRUNED }
 

Public Member Functions

 DownstreamInterface (Route *owner, NetworkInterface *ie)
 
 ~DownstreamInterface ()
 
Routeroute () const
 
PimDmpimdm () const
 
PruneState getPruneState ()
 
cMessage * getPruneTimer () const
 
cMessage * getPrunePendingTimer () const
 
bool hasConnectedReceivers () const
 
void setHasConnectedReceivers (bool value)
 
bool isInOlist () const
 
void startPruneTimer (double holdTime)
 The method is used to create PIMPrune timer. More...
 
void stopPruneTimer ()
 
void startPrunePendingTimer (double overrideInterval)
 
void stopPrunePendingTimer ()
 

Public Attributes

PruneState pruneState
 
cMessage * pruneTimer
 
cMessage * prunePendingTimer
 

Member Enumeration Documentation

◆ Flags

Enumerator
HAS_CONNECTED_RECEIVERS 
91  {
93  };

◆ PruneState

Enumerator
NO_INFO 
PRUNE_PENDING 
PRUNED 
95  {
96  NO_INFO, // no prune info, neither pruneTimer or prunePendingTimer is running
97  PRUNE_PENDING, // received a prune from a downstream neighbor, waiting for an override
98  PRUNED // received a prune from a downstream neighbor and it was not overridden
99  };

Constructor & Destructor Documentation

◆ DownstreamInterface()

inet::PimDm::DownstreamInterface::DownstreamInterface ( Route owner,
NetworkInterface ie 
)
inline
107  : Interface(owner, ie),
108  pruneState(NO_INFO), pruneTimer(nullptr), prunePendingTimer(nullptr)
109  { ASSERT(owner), ASSERT(ie); }

◆ ~DownstreamInterface()

inet::PimDm::DownstreamInterface::~DownstreamInterface ( )
1849 {
1850  owner->owner->cancelAndDelete(pruneTimer);
1851  owner->owner->cancelAndDelete(prunePendingTimer);
1852 }

Member Function Documentation

◆ getPrunePendingTimer()

cMessage* inet::PimDm::DownstreamInterface::getPrunePendingTimer ( ) const
inline
115 { return prunePendingTimer; }

◆ getPruneState()

PruneState inet::PimDm::DownstreamInterface::getPruneState ( )
inline
113 { return pruneState; }

◆ getPruneTimer()

cMessage* inet::PimDm::DownstreamInterface::getPruneTimer ( ) const
inline
114 { return pruneTimer; }

◆ hasConnectedReceivers()

bool inet::PimDm::DownstreamInterface::hasConnectedReceivers ( ) const
inline
116 { return isFlagSet(HAS_CONNECTED_RECEIVERS); }

◆ isInOlist()

bool inet::PimDm::DownstreamInterface::isInOlist ( ) const
1922 {
1923  // TODO check boundary
1924  bool hasNeighbors = pimdm()->pimNbt->getNumNeighbors(ie->getInterfaceId()) > 0;
1925  return ((hasNeighbors && pruneState != PRUNED) || hasConnectedReceivers()) && assertState != I_LOST_ASSERT;
1926 }

Referenced by inet::PimDm::PimDmOutInterface::isEnabled(), inet::PimDm::multicastReceiverAdded(), inet::PimDm::multicastReceiverRemoved(), and inet::PimDm::processGraft().

◆ pimdm()

PimDm* inet::PimDm::DownstreamInterface::pimdm ( ) const
inline
112 { return check_and_cast<PimDm *>(owner->owner); }

◆ route()

Route* inet::PimDm::DownstreamInterface::route ( ) const
inline
111 { return check_and_cast<Route *>(owner); }

Referenced by inet::PimDm::processPrunePendingTimer(), and inet::PimDm::processPruneTimer().

◆ setHasConnectedReceivers()

void inet::PimDm::DownstreamInterface::setHasConnectedReceivers ( bool  value)
inline

◆ startPrunePendingTimer()

void inet::PimDm::DownstreamInterface::startPrunePendingTimer ( double  overrideInterval)
1878 {
1879  ASSERT(!prunePendingTimer);
1880  cMessage *timer = new cMessage("PimPrunePendingTimer", PrunePendingTimer);
1881  timer->setContextPointer(this);
1882  owner->owner->scheduleAfter(overrideInterval, timer);
1883  prunePendingTimer = timer;
1884 }

Referenced by inet::PimDm::processPrune().

◆ startPruneTimer()

void inet::PimDm::DownstreamInterface::startPruneTimer ( double  holdTime)

The method is used to create PIMPrune timer.

The timer is set when outgoing interface goes to pruned state. After expiration (usually 3min) interface goes back to forwarding state. It is set to (S,G,I).

1860 {
1861  cMessage *timer = new cMessage("PimPruneTimer", PruneTimer);
1862  timer->setContextPointer(this);
1863  owner->owner->scheduleAfter(holdTime, timer);
1864  pruneTimer = timer;
1865 }

Referenced by inet::PimDm::multicastPacketArrivedOnNonRpfInterface(), and inet::PimDm::processPrunePendingTimer().

◆ stopPrunePendingTimer()

void inet::PimDm::DownstreamInterface::stopPrunePendingTimer ( )
1887 {
1888  if (prunePendingTimer) {
1889  if (prunePendingTimer->isScheduled())
1890  owner->owner->cancelEvent(prunePendingTimer);
1891  delete prunePendingTimer;
1892  prunePendingTimer = nullptr;
1893  }
1894 }

Referenced by inet::PimDm::processGraft(), and inet::PimDm::processJoin().

◆ stopPruneTimer()

void inet::PimDm::DownstreamInterface::stopPruneTimer ( )
1868 {
1869  if (pruneTimer) {
1870  if (pruneTimer->isScheduled())
1871  owner->owner->cancelEvent(pruneTimer);
1872  delete pruneTimer;
1873  pruneTimer = nullptr;
1874  }
1875 }

Referenced by inet::PimDm::processGraft(), inet::PimDm::processJoin(), and inet::PimDm::processPruneTimer().

Member Data Documentation

◆ prunePendingTimer

cMessage* inet::PimDm::DownstreamInterface::prunePendingTimer

◆ pruneState

◆ pruneTimer


The documentation for this struct was generated from the following files:
inet::PimDm::DownstreamInterface::pruneTimer
cMessage * pruneTimer
Definition: PimDm.h:103
inet::PimDm::DownstreamInterface::NO_INFO
@ NO_INFO
Definition: PimDm.h:96
inet::PimBase::PrunePendingTimer
@ PrunePendingTimer
Definition: PimBase.h:127
inet::PimBase::PruneTimer
@ PruneTimer
Definition: PimBase.h:126
inet::PimDm::DownstreamInterface::PRUNE_PENDING
@ PRUNE_PENDING
Definition: PimDm.h:97
inet::PimDm::DownstreamInterface::prunePendingTimer
cMessage * prunePendingTimer
Definition: PimDm.h:104
inet::PimDm::DownstreamInterface::pimdm
PimDm * pimdm() const
Definition: PimDm.h:112
inet::PimBase::holdTime
double holdTime
Definition: PimBase.h:158
inet::PimDm::DownstreamInterface::PRUNED
@ PRUNED
Definition: PimDm.h:98
inet::PimDm::DownstreamInterface::HAS_CONNECTED_RECEIVERS
@ HAS_CONNECTED_RECEIVERS
Definition: PimDm.h:92
inet::PimBase::pimNbt
ModuleRefByPar< PimNeighborTable > pimNbt
Definition: PimBase.h:149
inet::PimDm::DownstreamInterface::pruneState
PruneState pruneState
Definition: PimDm.h:102
inet::PimDm::overrideInterval
double overrideInterval
Definition: PimDm.h:156
inet::PimDm::DownstreamInterface::hasConnectedReceivers
bool hasConnectedReceivers() const
Definition: PimDm.h:116