37 template<encoding::Tag TAG>
41 size_t totalLength = 0;
55 if (m_defaultCongestionThreshold) {
57 *m_defaultCongestionThreshold);
59 if (m_baseCongestionMarkingInterval) {
61 m_baseCongestionMarkingInterval->count());
66 if (m_expirationPeriod) {
68 m_expirationPeriod->count());
74 totalLength += encoder.prependVarNumber(totalLength);
113 NDN_THROW(Error(
"missing required FaceId field"));
121 NDN_THROW(Error(
"missing required Uri field"));
129 NDN_THROW(Error(
"missing required LocalUri field"));
137 m_expirationPeriod = std::nullopt;
141 m_faceScope = readNonNegativeIntegerAs<FaceScope>(*val);
145 NDN_THROW(Error(
"missing required FaceScope field"));
153 NDN_THROW(Error(
"missing required FacePersistency field"));
157 m_linkType = readNonNegativeIntegerAs<LinkType>(*val);
161 NDN_THROW(Error(
"missing required LinkType field"));
169 m_baseCongestionMarkingInterval = std::nullopt;
177 m_defaultCongestionThreshold = std::nullopt;
185 m_mtu = std::nullopt;
193 NDN_THROW(Error(
"missing required NInInterests field"));
201 NDN_THROW(Error(
"missing required NInData field"));
209 NDN_THROW(Error(
"missing required NInNacks field"));
217 NDN_THROW(Error(
"missing required NOutInterests field"));
225 NDN_THROW(Error(
"missing required NOutData field"));
233 NDN_THROW(Error(
"missing required NOutNacks field"));
241 NDN_THROW(Error(
"missing required NInBytes field"));
249 NDN_THROW(Error(
"missing required NOutBytes field"));
257 NDN_THROW(Error(
"missing required Flags field"));
265 m_expirationPeriod = expirationPeriod;
273 m_expirationPeriod = std::nullopt;
281 m_baseCongestionMarkingInterval = interval;
289 m_baseCongestionMarkingInterval = std::nullopt;
297 m_defaultCongestionThreshold = threshold;
305 m_defaultCongestionThreshold = std::nullopt;
321 m_mtu = std::nullopt;
329 m_nInInterests = nInInterests;
345 m_nInNacks = nInNacks;
353 m_nOutInterests = nOutInterests;
361 m_nOutData = nOutData;
369 m_nOutNacks = nOutNacks;
377 m_nInBytes = nInBytes;
385 m_nOutBytes = nOutBytes;
422 os <<
"Face(FaceId: " << status.
getFaceId() <<
",\n"
430 os <<
" ExpirationPeriod: infinite,\n";
446 os <<
" Mtu: " << status.
getMtu() <<
" bytes,\n";
452 <<
" Data: {in: " << status.
getNInData() <<
", "
Helper class to convert a number to hexadecimal format, for use with stream insertion operators.
Represents a TLV element of the NDN packet format.
element_const_iterator elements_begin() const noexcept
Equivalent to elements().begin().
element_const_iterator elements_end() const noexcept
Equivalent to elements().end().
bool hasWire() const noexcept
Check if the Block contains a fully encoded wire representation.
uint32_t type() const noexcept
Return the TLV-TYPE of the Block.
void reset() noexcept
Reset the Block to a default-constructed state.
void parse() const
Parse TLV-VALUE into sub-elements.
Represents an item in NFD Face dataset.
FaceStatus & setNOutInterests(uint64_t nOutInterests)
const Block & wireEncode() const
Encode FaceStatus.
FaceStatus & unsetExpirationPeriod()
FaceStatus & setNOutData(uint64_t nOutData)
FaceStatus & unsetDefaultCongestionThreshold()
FaceStatus & setNOutBytes(uint64_t nOutBytes)
uint64_t getNOutInterests() const
FaceStatus & setNInInterests(uint64_t nInInterests)
FaceStatus & setNOutNacks(uint64_t nOutNacks)
uint64_t getNInData() const
uint64_t getNInBytes() const
void wireDecode(const Block &wire)
Decode FaceStatus.
uint64_t getNOutData() const
FaceStatus & setNInData(uint64_t nInData)
FaceStatus & setExpirationPeriod(time::milliseconds expirationPeriod)
uint64_t getDefaultCongestionThreshold() const
Get default congestion threshold (measured in bytes).
bool hasBaseCongestionMarkingInterval() const
time::nanoseconds getBaseCongestionMarkingInterval() const
uint64_t getNInInterests() const
uint64_t getNInNacks() const
FaceStatus & setNInNacks(uint64_t nInNacks)
FaceStatus & setNInBytes(uint64_t nInBytes)
FaceStatus & setMtu(uint64_t mtu)
Set MTU (measured in bytes).
bool hasExpirationPeriod() const
uint64_t getMtu() const
Get MTU (measured in bytes).
FaceStatus & setDefaultCongestionThreshold(uint64_t threshold)
Set default congestion threshold (measured in bytes).
bool hasDefaultCongestionThreshold() const
FaceStatus & setBaseCongestionMarkingInterval(time::nanoseconds interval)
uint64_t getNOutBytes() const
FaceStatus & unsetBaseCongestionMarkingInterval()
time::milliseconds getExpirationPeriod() const
uint64_t getNOutNacks() const
uint64_t getFlags() const
FacePersistency m_facePersistency
const std::string & getLocalUri() const
const std::string & getRemoteUri() const
FacePersistency getFacePersistency() const
uint64_t getFaceId() const
FaceScope getFaceScope() const
LinkType getLinkType() const
#define NDN_CXX_DEFINE_WIRE_ENCODE_INSTANTIATIONS(ClassName)
EncodingImpl< EstimatorTag > EncodingEstimator
uint64_t readNonNegativeInteger(const Block &block)
Read a non-negative integer from a TLV element.
size_t prependNonNegativeIntegerBlock(EncodingImpl< TAG > &encoder, uint32_t type, uint64_t value)
Prepend a TLV element containing a non-negative integer.
size_t prependStringBlock(EncodingImpl< TAG > &encoder, uint32_t type, std::string_view value)
Prepend a TLV element containing a string.
std::string readString(const Block &block)
Read the TLV-VALUE of a TLV element as a string.
EncodingImpl< EncoderTag > EncodingBuffer
Contains classes and functions related to the NFD Management protocol.
std::ostream & operator<<(std::ostream &os, FaceScope faceScope)
bool operator==(const ChannelStatus &a, const ChannelStatus &b)
::boost::chrono::milliseconds milliseconds
::boost::chrono::nanoseconds nanoseconds
@ BaseCongestionMarkingInterval
@ DefaultCongestionThreshold