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 (NetworkInterface *ie, Ipv4Address address, int version)
 
virtual ~PimNeighbor ()
 
virtual std::string str () const override
 
int getInterfaceId () const
 
NetworkInterfacegetInterfacePtr () 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
 
NetworkInterfaceie
 
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

◆ PimNeighbor()

inet::PimNeighbor::PimNeighbor ( NetworkInterface ie,
Ipv4Address  address,
int  version 
)
20  : nt(nullptr), ie(ie), address(address), version(version), generationId(0), drPriority(-1L)
21 {
22  ASSERT(ie);
23 
24  livenessTimer = new cMessage("NeighborLivenessTimer", PimNeighborTable::NeighborLivenessTimer);
25  livenessTimer->setContextPointer(this);
26 }

◆ ~PimNeighbor()

inet::PimNeighbor::~PimNeighbor ( )
virtual
29 {
30  delete livenessTimer;
31 }

Member Function Documentation

◆ changed()

void inet::PimNeighbor::changed ( )
protected
53 {
54  if (nt)
55  nt->emit(pimNeighborChangedSignal, this);
56 }

◆ getAddress()

◆ getDRPriority()

long inet::PimNeighbor::getDRPriority ( ) const
inline

◆ getGenerationId()

unsigned int inet::PimNeighbor::getGenerationId ( ) const
inline
49 { return generationId; }

◆ getInterfaceId()

int inet::PimNeighbor::getInterfaceId ( ) const
inline

◆ getInterfacePtr()

NetworkInterface* inet::PimNeighbor::getInterfacePtr ( ) const
inline
46 { return ie; }

Referenced by inet::PimSm::receiveSignal().

◆ getLivenessTimer()

cMessage* inet::PimNeighbor::getLivenessTimer ( ) const
inline

◆ getVersion()

int inet::PimNeighbor::getVersion ( ) const
inline
48 { return version; }

◆ setDRPriority()

void inet::PimNeighbor::setDRPriority ( long  priority)
inline
54 { if (drPriority != priority) { drPriority = priority; changed(); } }

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

◆ setGenerationId()

void inet::PimNeighbor::setGenerationId ( unsigned int  genId)
inline
53 { if (generationId != genId) { generationId = genId; changed(); } }

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

◆ str()

std::string inet::PimNeighbor::str ( ) const
overridevirtual
46 {
47  std::stringstream out;
48  out << "PimNeighbor addr=" << address << ", iface=" << ie->getInterfaceName() << ", v=" << version << ", priority=" << this->drPriority << "}";
49  return out.str();
50 }

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

Friends And Related Function Documentation

◆ PimNeighborTable

friend class PimNeighborTable
friend

Member Data Documentation

◆ address

Ipv4Address inet::PimNeighbor::address
protected

Referenced by str().

◆ drPriority

long inet::PimNeighbor::drPriority
protected

Referenced by str().

◆ generationId

unsigned int inet::PimNeighbor::generationId
protected

◆ ie

NetworkInterface* inet::PimNeighbor::ie
protected

Referenced by PimNeighbor(), and str().

◆ livenessTimer

cMessage* inet::PimNeighbor::livenessTimer
protected

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

◆ nt

◆ version

int inet::PimNeighbor::version
protected

Referenced by str().


The documentation for this class was generated from the following files:
inet::PimNeighbor::livenessTimer
cMessage * livenessTimer
Definition: PimNeighborTable.h:38
inet::PimNeighbor::nt
PimNeighborTable * nt
Definition: PimNeighborTable.h:32
inet::PimNeighbor::drPriority
long drPriority
Definition: PimNeighborTable.h:37
inet::pimNeighborChangedSignal
simsignal_t pimNeighborChangedSignal
Definition: Simsignals.cc:62
inet::NetworkInterface::getInterfaceName
const char * getInterfaceName() const
Definition: NetworkInterface.h:233
inet::PimNeighbor::ie
NetworkInterface * ie
Definition: PimNeighborTable.h:33
inet::PimNeighborTable::NeighborLivenessTimer
@ NeighborLivenessTimer
Definition: PimNeighborTable.h:70
inet::PimNeighbor::generationId
unsigned int generationId
Definition: PimNeighborTable.h:36
inet::NetworkInterface::getInterfaceId
int getInterfaceId() const
Definition: NetworkInterface.h:232
inet::PimNeighbor::changed
void changed()
Definition: PimNeighborTable.cc:52
inet::PimNeighbor::address
Ipv4Address address
Definition: PimNeighborTable.h:34
inet::PimNeighbor::version
int version
Definition: PimNeighborTable.h:35