22 #ifndef NLSR_TLV_LSA_INFO_HPP 23 #define NLSR_TLV_LSA_INFO_HPP 27 #include <ndn-cxx/util/time.hpp> 28 #include <ndn-cxx/encoding/block.hpp> 29 #include <ndn-cxx/encoding/encoding-buffer.hpp> 30 #include <ndn-cxx/encoding/tlv.hpp> 31 #include <ndn-cxx/name.hpp> 32 #include <boost/throw_exception.hpp> 63 LsaInfo(
const ndn::Block& block);
68 return m_originRouter;
74 m_originRouter = name;
82 return m_sequenceNumber;
88 m_sequenceNumber = sequenceNumber;
95 const ndn::time::milliseconds&
98 return m_expirationPeriod;
104 m_expirationPeriod = expirationPeriod;
115 return m_hasInfiniteExpirationPeriod;
127 template<ndn::encoding::Tag TAG>
129 wireEncode(ndn::EncodingImpl<TAG>& block)
const;
149 ndn::Name m_originRouter;
150 uint64_t m_sequenceNumber;
151 ndn::time::milliseconds m_expirationPeriod;
152 bool m_hasInfiniteExpirationPeriod;
154 mutable ndn::Block m_wire;
160 std::shared_ptr<LsaInfo>
166 #endif // NLSR_TLV_LSA_INFO_HPP
Copyright (c) 2014-2017, The University of Memphis, Regents of the University of California, Arizona Board of Regents.
LsaInfo & setSequenceNumber(uint64_t sequenceNumber)
LsaInfo & setExpirationPeriod(const ndn::time::milliseconds &expirationPeriod)
const ndn::time::milliseconds & getExpirationPeriod() const
std::shared_ptr< LsaInfo > makeLsaInfo(const Lsa &lsa)
const ndn::Block & wireEncode() const
Create a TLV encoding of this object.
const ndn::Name & getOriginRouter() const
Data abstraction for LsaInfo.
uint64_t getSequenceNumber() const
Copyright (c) 2014-2017, The University of Memphis, Regents of the University of California, Arizona Board of Regents.
LsaInfo & setOriginRouter(const ndn::Name &name)
bool hasInfiniteExpirationPeriod() const
std::ostream & operator<<(std::ostream &os, const AdjacencyLsa &adjacencyLsa)
static const ndn::time::milliseconds INFINITE_EXPIRATION_PERIOD
Error(const std::string &what)
void wireDecode(const ndn::Block &wire)
Populate this object by decoding the one contained in the given block.