nlsr::Lsa Class Referenceabstract

Represents a Link State Announcement (LSA). More...

#include <lsa.hpp>

+ Inheritance diagram for nlsr::Lsa:
+ Collaboration diagram for nlsr::Lsa:

Classes

class  Error
 

Public Types

enum class  Type {
  ADJACENCY ,
  COORDINATE ,
  NAME ,
  BASE
}
 

Public Member Functions

virtual ~Lsa ()=default
 
const ndn::time::system_clock::time_point & getExpirationTimePoint () const
 
const ndn::Name & getOriginRouter () const
 
uint64_t getSeqNo () const
 
virtual Type getType () const =0
 
void setExpirationTimePoint (const ndn::time::system_clock::time_point &lt)
 
void setExpiringEventId (ndn::scheduler::EventId eid)
 
void setSeqNo (uint64_t seqNo)
 
virtual std::tuple< bool, std::list< ndn::Name >, std::list< ndn::Name > > update (const std::shared_ptr< Lsa > &lsa)=0
 
virtual const ndn::Block & wireEncode () const =0
 

Protected Member Functions

 Lsa ()=default
 
 Lsa (const Lsa &lsa)
 
 Lsa (const ndn::Name &originRouter, uint64_t seqNo, ndn::time::system_clock::time_point expirationTimePoint)
 
void wireDecode (const ndn::Block &wire)
 
template<ndn::encoding::Tag TAG>
size_t wireEncode (ndn::EncodingImpl< TAG > &block) const
 

Protected Attributes

ndn::time::system_clock::time_point m_expirationTimePoint
 
ndn::scheduler::ScopedEventId m_expiringEventId
 
ndn::Name m_originRouter
 
uint64_t m_seqNo = 0
 
ndn::Block m_wire
 

Friends

std::ostream & operator<< (std::ostream &os, const Lsa &lsa)
 

Detailed Description

Represents a Link State Announcement (LSA).

The base level LSA is encoded as:

Lsa = LSA-TYPE TLV-LENGTH
Name ; origin router
SequenceNumber
ExpirationTime

Definition at line 45 of file lsa.hpp.

Member Enumeration Documentation

◆ Type

enum nlsr::Lsa::Type
strong
Enumerator
ADJACENCY 
COORDINATE 
NAME 
BASE 

Definition at line 54 of file lsa.hpp.

Constructor & Destructor Documentation

◆ Lsa() [1/3]

nlsr::Lsa::Lsa ( )
protecteddefault

◆ Lsa() [2/3]

nlsr::Lsa::Lsa ( const ndn::Name &  originRouter,
uint64_t  seqNo,
ndn::time::system_clock::time_point  expirationTimePoint 
)
protected

Definition at line 27 of file lsa.cpp.

◆ Lsa() [3/3]

nlsr::Lsa::Lsa ( const Lsa lsa)
explicitprotected

Definition at line 35 of file lsa.cpp.

◆ ~Lsa()

virtual nlsr::Lsa::~Lsa ( )
virtualdefault

Member Function Documentation

◆ getExpirationTimePoint()

const ndn::time::system_clock::time_point& nlsr::Lsa::getExpirationTimePoint ( ) const
inline

Definition at line 97 of file lsa.hpp.

◆ getOriginRouter()

const ndn::Name& nlsr::Lsa::getOriginRouter ( ) const
inline

Definition at line 91 of file lsa.hpp.

◆ getSeqNo()

uint64_t nlsr::Lsa::getSeqNo ( ) const
inline

Definition at line 85 of file lsa.hpp.

◆ getType()

virtual Type nlsr::Lsa::getType ( ) const
pure virtual

◆ setExpirationTimePoint()

void nlsr::Lsa::setExpirationTimePoint ( const ndn::time::system_clock::time_point &  lt)
inline

Definition at line 103 of file lsa.hpp.

◆ setExpiringEventId()

void nlsr::Lsa::setExpiringEventId ( ndn::scheduler::EventId  eid)
inline

Definition at line 110 of file lsa.hpp.

◆ setSeqNo()

void nlsr::Lsa::setSeqNo ( uint64_t  seqNo)
inline

Definition at line 78 of file lsa.hpp.

◆ update()

virtual std::tuple<bool, std::list<ndn::Name>, std::list<ndn::Name> > nlsr::Lsa::update ( const std::shared_ptr< Lsa > &  lsa)
pure virtual

◆ wireDecode()

void nlsr::Lsa::wireDecode ( const ndn::Block &  wire)
protected

Definition at line 65 of file lsa.cpp.

◆ wireEncode() [1/2]

virtual const ndn::Block& nlsr::Lsa::wireEncode ( ) const
pure virtual

◆ wireEncode() [2/2]

template<ndn::encoding::Tag TAG>
size_t nlsr::Lsa::wireEncode ( ndn::EncodingImpl< TAG > &  block) const
protected

Definition at line 44 of file lsa.cpp.

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  os,
const Lsa lsa 
)
friend

Definition at line 100 of file lsa.cpp.

Member Data Documentation

◆ m_expirationTimePoint

ndn::time::system_clock::time_point nlsr::Lsa::m_expirationTimePoint
protected

Definition at line 139 of file lsa.hpp.

◆ m_expiringEventId

ndn::scheduler::ScopedEventId nlsr::Lsa::m_expiringEventId
protected

Definition at line 140 of file lsa.hpp.

◆ m_originRouter

ndn::Name nlsr::Lsa::m_originRouter
protected

Definition at line 137 of file lsa.hpp.

◆ m_seqNo

uint64_t nlsr::Lsa::m_seqNo = 0
protected

Definition at line 138 of file lsa.hpp.

◆ m_wire

ndn::Block nlsr::Lsa::m_wire
mutableprotected

Definition at line 142 of file lsa.hpp.