INET Framework for OMNeT++/OMNEST
inet::PIMSM::Route Struct Reference
Inheritance diagram for inet::PIMSM::Route:

Public Types

enum  Flags {
  PRUNED = 0x01, REGISTER = 0x02, SPT_BIT = 0x04, JOIN_DESIRED = 0x08,
  SOURCE_DIRECTLY_CONNECTED = 0x10
}
 
enum  RegisterState { RS_NO_INFO, RS_JOIN, RS_PRUNE, RS_JOIN_PENDING }
 

Public Member Functions

 Route (PIMSM *owner, RouteType type, IPv4Address origin, IPv4Address group)
 
virtual ~Route ()
 
PIMSMpimsm () const
 
void addDownstreamInterface (DownstreamInterface *outInterface)
 
void removeDownstreamInterface (unsigned int i)
 
DownstreamInterfacefindDownstreamInterfaceByInterfaceId (int interfaceId)
 
DownstreamInterfacegetDownstreamInterfaceByInterfaceId (int interfaceId)
 
int findDownstreamInterface (InterfaceEntry *ie)
 
bool isImmediateOlistNull ()
 
bool isInheritedOlistNull ()
 
bool joinDesired () const
 
bool isSourceDirectlyConnected () const
 
void startKeepAliveTimer (double keepAlivePeriod)
 
void startRegisterStopTimer (double interval)
 
void startJoinTimer (double joinPrunePeriod)
 

Public Attributes

RouteType type
 
IPv4Address rpAddr
 
RouterpRoute
 
RoutegRoute
 
RoutesgrptRoute
 
unsigned int sequencenumber
 
simtime_t installtime
 
cMessage * keepAliveTimer
 
cMessage * joinTimer
 
RegisterState registerState
 
cMessage * registerStopTimer
 
UpstreamInterfaceupstreamInterface
 
DownstreamInterfaceVector downstreamInterfaces
 Out interfaces (downstream) More...
 

Member Enumeration Documentation

Enumerator
PRUNED 
REGISTER 
SPT_BIT 
JOIN_DESIRED 
SOURCE_DIRECTLY_CONNECTED 
148  {
149  PRUNED = 0x01, // UpstreamJPState
150  REGISTER = 0x02, // Register flag
151  SPT_BIT = 0x04, // used to distinguish whether to forward on (*,*,RP)/(*,G) or on (S,G) state
152  JOIN_DESIRED = 0x08,
154  };
Definition: PIMSM.h:149
Definition: PIMSM.h:151
Definition: PIMSM.h:150
Definition: PIMSM.h:152
Enumerator
RS_NO_INFO 
RS_JOIN 
RS_PRUNE 
RS_JOIN_PENDING 
Definition: PIMSM.h:173
Definition: PIMSM.h:173
Definition: PIMSM.h:173

Constructor & Destructor Documentation

inet::PIMSM::Route::Route ( PIMSM owner,
RouteType  type,
IPv4Address  origin,
IPv4Address  group 
)
1935  : RouteEntry(owner, origin, group), type(type), rpAddr(IPv4Address::UNSPECIFIED_ADDRESS),
1936  rpRoute(nullptr), gRoute(nullptr), sgrptRoute(nullptr),
1938  upstreamInterface(nullptr)
1939 {
1940 }
unsigned int sequencenumber
Definition: PIMSM.h:165
Route * sgrptRoute
Definition: PIMSM.h:162
RegisterState registerState
Definition: PIMSM.h:174
cMessage * joinTimer
Definition: PIMSM.h:170
Route * rpRoute
Definition: PIMSM.h:160
IPv4Address rpAddr
Definition: PIMSM.h:157
Definition: PIMSM.h:173
cMessage * keepAliveTimer
Definition: PIMSM.h:169
UpstreamInterface * upstreamInterface
Definition: PIMSM.h:178
static const IPv4Address UNSPECIFIED_ADDRESS
0.0.0.0
Definition: IPv4Address.h:102
RouteType type
Definition: PIMSM.h:156
cMessage * registerStopTimer
Definition: PIMSM.h:175
Route * gRoute
Definition: PIMSM.h:161
inet::PIMSM::Route::~Route ( )
virtual
1943 {
1944  owner->cancelAndDelete(keepAliveTimer);
1945  owner->cancelAndDelete(registerStopTimer);
1946  owner->cancelAndDelete(joinTimer);
1947  delete upstreamInterface;
1948  for (auto & elem : downstreamInterfaces)
1949  delete elem;
1950 }
cMessage * joinTimer
Definition: PIMSM.h:170
cMessage * keepAliveTimer
Definition: PIMSM.h:169
UpstreamInterface * upstreamInterface
Definition: PIMSM.h:178
cMessage * registerStopTimer
Definition: PIMSM.h:175
DownstreamInterfaceVector downstreamInterfaces
Out interfaces (downstream)
Definition: PIMSM.h:179

Member Function Documentation

void inet::PIMSM::Route::addDownstreamInterface ( DownstreamInterface outInterface)

Referenced by inet::PIMSM::addNewRouteG().

2021 {
2022  ASSERT(outInterface);
2023 
2024  auto it = downstreamInterfaces.begin();
2025  for ( ; it != downstreamInterfaces.end(); ++it) {
2026  if ((*it)->ie == outInterface->ie)
2027  break;
2028  }
2029 
2030  if (it != downstreamInterfaces.end()) {
2031  delete *it;
2032  *it = outInterface;
2033  }
2034  else {
2035  downstreamInterfaces.push_back(outInterface);
2036  }
2037 }
DownstreamInterfaceVector downstreamInterfaces
Out interfaces (downstream)
Definition: PIMSM.h:179
int inet::PIMSM::Route::findDownstreamInterface ( InterfaceEntry ie)
1993 {
1994  for (unsigned int i = 0; i < downstreamInterfaces.size(); i++) {
1995  DownstreamInterface *downstream = downstreamInterfaces[i];
1996  if (downstream->ie == ie)
1997  return i;
1998  }
1999  return -1;
2000 }
DownstreamInterfaceVector downstreamInterfaces
Out interfaces (downstream)
Definition: PIMSM.h:179
PIMSM::DownstreamInterface * inet::PIMSM::Route::findDownstreamInterfaceByInterfaceId ( int  interfaceId)

Referenced by getDownstreamInterfaceByInterfaceId(), inet::PIMSM::DownstreamInterface::isInInheritedOlist(), inet::PIMSM::multicastPacketArrivedOnNonRpfInterface(), inet::PIMSM::processJoinG(), inet::PIMSM::processJoinSG(), inet::PIMSM::processPruneG(), and inet::PIMSM::processPruneSG().

1975 {
1976  for (auto & elem : downstreamInterfaces) {
1977  DownstreamInterface *downstream = elem;
1978  if (downstream->getInterfaceId() == interfaceId)
1979  return downstream;
1980  }
1981  return nullptr;
1982 }
DownstreamInterfaceVector downstreamInterfaces
Out interfaces (downstream)
Definition: PIMSM.h:179
PIMSM::DownstreamInterface * inet::PIMSM::Route::getDownstreamInterfaceByInterfaceId ( int  interfaceId)

Referenced by inet::PIMSM::multicastReceiverAdded(), inet::PIMSM::multicastReceiverRemoved(), and inet::PIMSM::processAssertPacket().

1985 {
1986  DownstreamInterface *downstream = findDownstreamInterfaceByInterfaceId(interfaceId);
1987  if (!downstream)
1988  throw cRuntimeError("getDownstreamInterfaceByInterfaceId(): interface %d not found", interfaceId);
1989  return downstream;
1990 }
DownstreamInterface * findDownstreamInterfaceByInterfaceId(int interfaceId)
Definition: PIMSM.cc:1974
bool inet::PIMSM::Route::isImmediateOlistNull ( )

Referenced by inet::PIMSM::updateJoinDesired().

2003 {
2004  for (auto & elem : downstreamInterfaces)
2005  if (elem->isInImmediateOlist())
2006  return false;
2007 
2008  return true;
2009 }
DownstreamInterfaceVector downstreamInterfaces
Out interfaces (downstream)
Definition: PIMSM.h:179
bool inet::PIMSM::Route::isInheritedOlistNull ( )

Referenced by inet::PIMSM::multicastPacketArrivedOnRpfInterface(), inet::PIMSM::processJoinTimer(), inet::PIMSM::processRegisterPacket(), and inet::PIMSM::updateJoinDesired().

2012 {
2013  for (auto & elem : downstreamInterfaces)
2014  if (elem->isInInheritedOlist())
2015  return false;
2016 
2017  return true;
2018 }
DownstreamInterfaceVector downstreamInterfaces
Out interfaces (downstream)
Definition: PIMSM.h:179
bool inet::PIMSM::Route::isSourceDirectlyConnected ( ) const
inline

Referenced by inet::PIMSM::joinDesiredChanged().

196 { return isFlagSet(SOURCE_DIRECTLY_CONNECTED); }
bool inet::PIMSM::Route::joinDesired ( ) const
inline

Referenced by inet::PIMSM::joinDesiredChanged(), and inet::PIMSM::updateJoinDesired().

195 { return isFlagSet(JOIN_DESIRED); }
Definition: PIMSM.h:152
PIMSM* inet::PIMSM::Route::pimsm ( ) const
inline

Referenced by removeDownstreamInterface().

184 { return check_and_cast<PIMSM *>(owner); }
PIMSM()
Definition: PIMSM.h:232
void inet::PIMSM::Route::removeDownstreamInterface ( unsigned int  i)
2040 {
2041  // remove corresponding out interface from the IPv4 route,
2042  // because it refers to the downstream interface to be deleted
2043  IPv4MulticastRoute *ipv4Route = pimsm()->findIPv4Route(source, group);
2044  ipv4Route->removeOutInterface(i);
2045 
2046  DownstreamInterface *outInterface = downstreamInterfaces[i];
2047  downstreamInterfaces.erase(downstreamInterfaces.begin() + i);
2048  delete outInterface;
2049 }
virtual bool removeOutInterface(const InterfaceEntry *ie) override
Definition: IPv4Route.cc:205
PIMSM * pimsm() const
Definition: PIMSM.h:184
IPv4MulticastRoute * findIPv4Route(IPv4Address source, IPv4Address group)
Definition: PIMSM.cc:1911
DownstreamInterfaceVector downstreamInterfaces
Out interfaces (downstream)
Definition: PIMSM.h:179
void inet::PIMSM::Route::startJoinTimer ( double  joinPrunePeriod)

Referenced by inet::PIMSM::joinDesiredChanged().

1968 {
1969  joinTimer = new cMessage("PIMJoinTimer", JoinTimer);
1970  joinTimer->setContextPointer(this);
1971  owner->scheduleAt(simTime() + joinPrunePeriod, joinTimer);
1972 }
cMessage * joinTimer
Definition: PIMSM.h:170
double joinPrunePeriod
Definition: PIMSM.h:207
Definition: PIMBase.h:152
void inet::PIMSM::Route::startKeepAliveTimer ( double  keepAlivePeriod)

Referenced by inet::PIMSM::multicastPacketArrivedOnRpfInterface(), inet::PIMSM::processJoinSG(), inet::PIMSM::processRegisterPacket(), and inet::PIMSM::unroutableMulticastPacketArrived().

1953 {
1954  ASSERT(this->type == SG);
1955  keepAliveTimer = new cMessage("PIMKeepAliveTimer", KeepAliveTimer);
1956  keepAliveTimer->setContextPointer(this);
1957  owner->scheduleAt(simTime() + keepAlivePeriod, keepAliveTimer);
1958 }
Definition: PIMSM.h:141
cMessage * keepAliveTimer
Definition: PIMSM.h:169
double keepAlivePeriod
Definition: PIMSM.h:210
Definition: PIMBase.h:149
RouteType type
Definition: PIMSM.h:156
void inet::PIMSM::Route::startRegisterStopTimer ( double  interval)

Referenced by inet::PIMSM::processRegisterStopPacket(), and inet::PIMSM::processRegisterStopTimer().

1961 {
1962  registerStopTimer = new cMessage("PIMRegisterStopTimer", RegisterStopTimer);
1963  registerStopTimer->setContextPointer(this);
1964  owner->scheduleAt(simTime() + interval, registerStopTimer);
1965 }
Definition: PIMBase.h:150
cMessage * registerStopTimer
Definition: PIMSM.h:175

Member Data Documentation

simtime_t inet::PIMSM::Route::installtime
cMessage* inet::PIMSM::Route::joinTimer
cMessage* inet::PIMSM::Route::registerStopTimer
Route* inet::PIMSM::Route::rpRoute
unsigned int inet::PIMSM::Route::sequencenumber

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