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

Class holding information about a neighboring PIM router. More...

#include <PIMNeighborTable.h>

Inheritance diagram for inet::PIMNeighbor:

Public Member Functions

 PIMNeighbor (InterfaceEntry *ie, IPv4Address address, int version)
 
virtual ~PIMNeighbor ()
 
virtual std::string info () const override
 
int getInterfaceId () const
 
InterfaceEntrygetInterfacePtr () const
 
IPv4Address getAddress () const
 
int getVersion () const
 
unsigned int getGenerationId () const
 
long getDRPriority () const
 
cMessage * getLivenessTimer () const
 
void setGenerationId (unsigned int genId)
 
void setDRPriority (long priority)
 

Protected Member Functions

void changed ()
 

Protected Attributes

PIMNeighborTablent
 
InterfaceEntryie
 
IPv4Address address
 
int version
 
unsigned int generationId
 
long drPriority
 
cMessage * livenessTimer
 

Friends

class PIMNeighborTable
 

Detailed Description

Class holding information about a neighboring PIM router.

Routers are identified by the link to which they are connected and their address.

Currently only the version of the routers are stored. TODO add fields for options received in Hello Messages (RFC 3973 4.7.5, RFC 4601 4.9.2).

Constructor & Destructor Documentation

inet::PIMNeighbor::PIMNeighbor ( InterfaceEntry ie,
IPv4Address  address,
int  version 
)
31  : nt(nullptr), ie(ie), address(address), version(version), generationId(0), drPriority(-1L)
32 {
33  ASSERT(ie);
34 
35  livenessTimer = new cMessage("NeighborLivenessTimer", PIMNeighborTable::NeighborLivenessTimer);
36  livenessTimer->setContextPointer(this);
37 }
unsigned int generationId
Definition: PIMNeighborTable.h:47
IPv4Address address
Definition: PIMNeighborTable.h:45
int version
Definition: PIMNeighborTable.h:46
cMessage * livenessTimer
Definition: PIMNeighborTable.h:49
long drPriority
Definition: PIMNeighborTable.h:48
Definition: PIMNeighborTable.h:81
PIMNeighborTable * nt
Definition: PIMNeighborTable.h:43
InterfaceEntry * ie
Definition: PIMNeighborTable.h:44
inet::PIMNeighbor::~PIMNeighbor ( )
virtual
40 {
41  ASSERT(!livenessTimer->isScheduled());
42  delete livenessTimer;
43 }
cMessage * livenessTimer
Definition: PIMNeighborTable.h:49

Member Function Documentation

void inet::PIMNeighbor::changed ( )
protected
65 {
66  if (nt)
67  nt->emit(NF_PIM_NEIGHBOR_CHANGED, this);
68 }
simsignal_t NF_PIM_NEIGHBOR_CHANGED
Definition: NotifierConsts.cc:83
PIMNeighborTable * nt
Definition: PIMNeighborTable.h:43
long inet::PIMNeighbor::getDRPriority ( ) const
inline

Referenced by inet::operator<<(), and inet::PIMSM::updateDesignatedRouterAddress().

61 { return drPriority; }
long drPriority
Definition: PIMNeighborTable.h:48
unsigned int inet::PIMNeighbor::getGenerationId ( ) const
inline

Referenced by inet::operator<<().

60 { return generationId; }
unsigned int generationId
Definition: PIMNeighborTable.h:47
int inet::PIMNeighbor::getInterfaceId ( ) const
inline

Referenced by inet::PIMNeighborTable::addNeighbor(), inet::PIMNeighborTable::deleteNeighbor(), and inet::PIMNeighborTable::findNeighbor().

56 { return ie->getInterfaceId(); }
int getInterfaceId() const
Definition: InterfaceEntry.h:185
InterfaceEntry * ie
Definition: PIMNeighborTable.h:44
InterfaceEntry* inet::PIMNeighbor::getInterfacePtr ( ) const
inline

Referenced by inet::operator<<(), and inet::PIMSM::receiveSignal().

57 { return ie; }
InterfaceEntry * ie
Definition: PIMNeighborTable.h:44
cMessage* inet::PIMNeighbor::getLivenessTimer ( ) const
inline
int inet::PIMNeighbor::getVersion ( ) const
inline

Referenced by inet::operator<<().

59 { return version; }
int version
Definition: PIMNeighborTable.h:46
std::string inet::PIMNeighbor::info ( ) const
overridevirtual

Referenced by inet::PIMNeighborTable::addNeighbor().

58 {
59  std::stringstream out;
60  out << "PIMNeighbor addr=" << address << ", iface=" << ie->getName() << ", v=" << version << ", priority=" << this->drPriority << "}";
61  return out.str();
62 }
IPv4Address address
Definition: PIMNeighborTable.h:45
int version
Definition: PIMNeighborTable.h:46
long drPriority
Definition: PIMNeighborTable.h:48
InterfaceEntry * ie
Definition: PIMNeighborTable.h:44
void inet::PIMNeighbor::setDRPriority ( long  priority)
inline

Referenced by inet::PIMBase::processHelloPacket().

65 { if (drPriority != priority) { drPriority = priority; changed(); } }
long drPriority
Definition: PIMNeighborTable.h:48
void changed()
Definition: PIMNeighborTable.cc:64
void inet::PIMNeighbor::setGenerationId ( unsigned int  genId)
inline

Referenced by inet::PIMBase::processHelloPacket().

64 { if (generationId != genId) { generationId = genId; changed(); } }
unsigned int generationId
Definition: PIMNeighborTable.h:47
void changed()
Definition: PIMNeighborTable.cc:64

Friends And Related Function Documentation

friend class PIMNeighborTable
friend

Member Data Documentation

IPv4Address inet::PIMNeighbor::address
protected

Referenced by info().

long inet::PIMNeighbor::drPriority
protected

Referenced by info().

unsigned int inet::PIMNeighbor::generationId
protected
InterfaceEntry* inet::PIMNeighbor::ie
protected

Referenced by info().

cMessage* inet::PIMNeighbor::livenessTimer
protected

Referenced by PIMNeighbor(), and ~PIMNeighbor().

int inet::PIMNeighbor::version
protected

Referenced by info().


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