nlsr::AdjLsa Class Reference

Represents an LSA of adjacencies of the origin router in link-state mode. More...

#include <adj-lsa.hpp>

+ Inheritance diagram for nlsr::AdjLsa:
+ Collaboration diagram for nlsr::AdjLsa:

Public Types

using const_iterator = AdjacencyList::const_iterator
 
enum class  Type {
  ADJACENCY ,
  COORDINATE ,
  NAME ,
  BASE
}
 

Public Member Functions

 AdjLsa ()=default
 
 AdjLsa (const ndn::Block &block)
 
 AdjLsa (const ndn::Name &originR, uint64_t seqNo, const ndn::time::system_clock::time_point &timepoint, AdjacencyList &adl)
 
void addAdjacent (const Adjacent &adj)
 
const_iterator begin () const
 
const_iterator end () const
 
const AdjacencyListgetAdl () const
 
const ndn::time::system_clock::time_point & getExpirationTimePoint () const
 
const ndn::Name & getOriginRouter () const
 
uint64_t getSeqNo () const
 
Lsa::Type getType () const override
 
void resetAdl ()
 
void setExpirationTimePoint (const ndn::time::system_clock::time_point &lt)
 
void setExpiringEventId (ndn::scheduler::EventId eid)
 
void setSeqNo (uint64_t seqNo)
 
std::tuple< bool, std::list< ndn::Name >, std::list< ndn::Name > > update (const std::shared_ptr< Lsa > &lsa) override
 
void wireDecode (const ndn::Block &wire)
 
const ndn::Block & wireEncode () const override
 
template<ndn::encoding::Tag TAG>
size_t wireEncode (ndn::EncodingImpl< TAG > &block) const
 

Static Public Member Functions

static constexpr Lsa::Type type ()
 

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

bool operator== (const AdjLsa &lhs, const AdjLsa &rhs)
 

Detailed Description

Represents an LSA of adjacencies of the origin router in link-state mode.

AdjLsa is encoded as:

AdjLsa = ADJACENCY-LSA-TYPE TLV-LENGTH
Lsa
*Adjacency

Definition at line 43 of file adj-lsa.hpp.

Member Typedef Documentation

◆ const_iterator

Member Enumeration Documentation

◆ Type

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

Definition at line 54 of file lsa.hpp.

Constructor & Destructor Documentation

◆ AdjLsa() [1/3]

nlsr::AdjLsa::AdjLsa ( )
default

◆ AdjLsa() [2/3]

nlsr::AdjLsa::AdjLsa ( const ndn::Name &  originR,
uint64_t  seqNo,
const ndn::time::system_clock::time_point &  timepoint,
AdjacencyList adl 
)

Definition at line 27 of file adj-lsa.cpp.

◆ AdjLsa() [3/3]

nlsr::AdjLsa::AdjLsa ( const ndn::Block &  block)
explicit

Definition at line 38 of file adj-lsa.cpp.

Member Function Documentation

◆ addAdjacent()

void nlsr::AdjLsa::addAdjacent ( const Adjacent adj)
inline

Definition at line 82 of file adj-lsa.hpp.

◆ begin()

const_iterator nlsr::AdjLsa::begin ( ) const
inline

Definition at line 89 of file adj-lsa.hpp.

◆ end()

const_iterator nlsr::AdjLsa::end ( ) const
inline

Definition at line 95 of file adj-lsa.hpp.

◆ getAdl()

const AdjacencyList& nlsr::AdjLsa::getAdl ( ) const
inline

Definition at line 69 of file adj-lsa.hpp.

◆ getExpirationTimePoint()

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

Definition at line 97 of file lsa.hpp.

◆ getOriginRouter()

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

Definition at line 91 of file lsa.hpp.

◆ getSeqNo()

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

Definition at line 85 of file lsa.hpp.

◆ getType()

Lsa::Type nlsr::AdjLsa::getType ( ) const
inlineoverridevirtual

Implements nlsr::Lsa.

Definition at line 57 of file adj-lsa.hpp.

◆ resetAdl()

void nlsr::AdjLsa::resetAdl ( )
inline

Definition at line 75 of file adj-lsa.hpp.

◆ setExpirationTimePoint()

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

Definition at line 103 of file lsa.hpp.

◆ setExpiringEventId()

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

Definition at line 110 of file lsa.hpp.

◆ setSeqNo()

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

Definition at line 78 of file lsa.hpp.

◆ type()

static constexpr Lsa::Type nlsr::AdjLsa::type ( )
inlinestaticconstexpr

Definition at line 63 of file adj-lsa.hpp.

◆ update()

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

Implements nlsr::Lsa.

Definition at line 130 of file adj-lsa.cpp.

◆ wireDecode()

void nlsr::AdjLsa::wireDecode ( const ndn::Block &  wire)

Definition at line 83 of file adj-lsa.cpp.

◆ wireEncode() [1/2]

const ndn::Block & nlsr::AdjLsa::wireEncode ( ) const
overridevirtual

Implements nlsr::Lsa.

Definition at line 65 of file adj-lsa.cpp.

◆ wireEncode() [2/2]

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

Definition at line 45 of file adj-lsa.cpp.

Friends And Related Function Documentation

◆ operator==

bool operator== ( const AdjLsa lhs,
const AdjLsa rhs 
)
friend

Definition at line 123 of file adj-lsa.hpp.

Member Data Documentation

◆ m_expirationTimePoint

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

Definition at line 139 of file lsa.hpp.

◆ m_expiringEventId

ndn::scheduler::ScopedEventId nlsr::Lsa::m_expiringEventId
protectedinherited

Definition at line 140 of file lsa.hpp.

◆ m_originRouter

ndn::Name nlsr::Lsa::m_originRouter
protectedinherited

Definition at line 137 of file lsa.hpp.

◆ m_seqNo

uint64_t nlsr::Lsa::m_seqNo = 0
protectedinherited

Definition at line 138 of file lsa.hpp.

◆ m_wire

ndn::Block nlsr::Lsa::m_wire
mutableprotectedinherited

Definition at line 142 of file lsa.hpp.