NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.5: NDN, CCN, CCNx, content centric networks
API Documentation
ndn::nfd::ControlParameters Class Reference

represents parameters in a ControlCommand request or response More...

#include <control-parameters.hpp>

Inheritance diagram for ndn::nfd::ControlParameters:
Collaboration diagram for ndn::nfd::ControlParameters:

Classes

class  Error
 

Public Member Functions

 ControlParameters ()
 
 ControlParameters (const Block &block)
 
template<encoding::Tag TAG>
size_t wireEncode (EncodingImpl< TAG > &encoder) const
 
Block wireEncode () const final
 
void wireDecode (const Block &wire) final
 
bool hasName () const
 
const NamegetName () const
 
ControlParameterssetName (const Name &name)
 
ControlParametersunsetName ()
 
bool hasFaceId () const
 
uint64_t getFaceId () const
 
ControlParameterssetFaceId (uint64_t faceId)
 
ControlParametersunsetFaceId ()
 
bool hasUri () const
 
const std::string & getUri () const
 
ControlParameterssetUri (const std::string &uri)
 
ControlParametersunsetUri ()
 
bool hasLocalUri () const
 
const std::string & getLocalUri () const
 
ControlParameterssetLocalUri (const std::string &localUri)
 
ControlParametersunsetLocalUri ()
 
bool hasOrigin () const
 
RouteOrigin getOrigin () const
 
ControlParameterssetOrigin (RouteOrigin origin)
 
ControlParametersunsetOrigin ()
 
bool hasCost () const
 
uint64_t getCost () const
 
ControlParameterssetCost (uint64_t cost)
 
ControlParametersunsetCost ()
 
bool hasCapacity () const
 
uint64_t getCapacity () const
 
ControlParameterssetCapacity (uint64_t capacity)
 
ControlParametersunsetCapacity ()
 
bool hasCount () const
 
uint64_t getCount () const
 
ControlParameterssetCount (uint64_t count)
 
ControlParametersunsetCount ()
 
bool hasFlags () const
 
uint64_t getFlags () const
 
ControlParameterssetFlags (uint64_t flags)
 
ControlParametersunsetFlags ()
 
bool hasMask () const
 
uint64_t getMask () const
 
ControlParameterssetMask (uint64_t mask)
 
ControlParametersunsetMask ()
 
bool hasStrategy () const
 
const NamegetStrategy () const
 
ControlParameterssetStrategy (const Name &strategy)
 
ControlParametersunsetStrategy ()
 
bool hasExpirationPeriod () const
 
const time::milliseconds & getExpirationPeriod () const
 
ControlParameterssetExpirationPeriod (const time::milliseconds &expirationPeriod)
 
ControlParametersunsetExpirationPeriod ()
 
bool hasFacePersistency () const
 
FacePersistency getFacePersistency () const
 
ControlParameterssetFacePersistency (FacePersistency persistency)
 
ControlParametersunsetFacePersistency ()
 
bool hasBaseCongestionMarkingInterval () const
 
time::nanoseconds getBaseCongestionMarkingInterval () const
 
ControlParameterssetBaseCongestionMarkingInterval (time::nanoseconds interval)
 
ControlParametersunsetBaseCongestionMarkingInterval ()
 
bool hasDefaultCongestionThreshold () const
 
uint64_t getDefaultCongestionThreshold () const
 get default congestion threshold (measured in bytes) More...
 
ControlParameterssetDefaultCongestionThreshold (uint64_t threshold)
 set default congestion threshold (measured in bytes) More...
 
ControlParametersunsetDefaultCongestionThreshold ()
 
const std::vector< bool > & getPresentFields () const
 
bool hasFlagBit (size_t bit) const
 
bool getFlagBit (size_t bit) const
 
ControlParameterssetFlagBit (size_t bit, bool value, bool wantMask=true)
 set a bit in Flags More...
 
ControlParametersunsetFlagBit (size_t bit)
 disable a bit in Mask More...
 
- Public Member Functions inherited from ndn::mgmt::ControlParameters
virtual ~ControlParameters ()=default
 

Detailed Description

represents parameters in a ControlCommand request or response

See also
https://redmine.named-data.net/projects/nfd/wiki/ControlCommand#ControlParameters

This type is copyable because it's an abstraction of a TLV type.

Definition at line 79 of file control-parameters.hpp.

Constructor & Destructor Documentation

◆ ControlParameters() [1/2]

ndn::nfd::ControlParameters::ControlParameters ( )

Definition at line 37 of file control-parameters.cpp.

◆ ControlParameters() [2/2]

ndn::nfd::ControlParameters::ControlParameters ( const Block block)
explicit

Definition at line 42 of file control-parameters.cpp.

References wireDecode().

Member Function Documentation

◆ wireEncode() [1/2]

◆ wireEncode() [2/2]

Block ndn::nfd::ControlParameters::wireEncode ( ) const
finalvirtual

Implements ndn::mgmt::ControlParameters.

Definition at line 111 of file control-parameters.cpp.

References ndn::Block::hasWire().

◆ wireDecode()

void ndn::nfd::ControlParameters::wireDecode ( const Block wire)
finalvirtual

Implements ndn::mgmt::ControlParameters.

Definition at line 127 of file control-parameters.cpp.

References ndn::tlv::nfd::BaseCongestionMarkingInterval, ndn::tlv::nfd::Capacity, ndn::nfd::CONTROL_PARAMETER_BASE_CONGESTION_MARKING_INTERVAL, ndn::nfd::CONTROL_PARAMETER_CAPACITY, ndn::nfd::CONTROL_PARAMETER_COST, ndn::nfd::CONTROL_PARAMETER_COUNT, ndn::nfd::CONTROL_PARAMETER_DEFAULT_CONGESTION_THRESHOLD, ndn::nfd::CONTROL_PARAMETER_EXPIRATION_PERIOD, ndn::nfd::CONTROL_PARAMETER_FACE_ID, ndn::nfd::CONTROL_PARAMETER_FACE_PERSISTENCY, ndn::nfd::CONTROL_PARAMETER_FLAGS, ndn::nfd::CONTROL_PARAMETER_LOCAL_URI, ndn::nfd::CONTROL_PARAMETER_MASK, ndn::nfd::CONTROL_PARAMETER_NAME, ndn::nfd::CONTROL_PARAMETER_ORIGIN, ndn::nfd::CONTROL_PARAMETER_STRATEGY, ndn::nfd::CONTROL_PARAMETER_URI, ndn::tlv::nfd::ControlParameters, ndn::tlv::nfd::Cost, ndn::tlv::nfd::Count, ndn::tlv::nfd::DefaultCongestionThreshold, ndn::Block::elements_end(), ndn::tlv::nfd::ExpirationPeriod, ndn::tlv::nfd::FaceId, ndn::tlv::nfd::FacePersistency, ndn::Block::find(), ndn::tlv::nfd::Flags, hasBaseCongestionMarkingInterval(), hasCapacity(), hasCost(), hasCount(), hasDefaultCongestionThreshold(), hasExpirationPeriod(), hasFaceId(), hasFacePersistency(), hasFlags(), hasLocalUri(), hasMask(), hasName(), hasOrigin(), hasStrategy(), hasUri(), ndn::tlv::nfd::LocalUri, ndn::tlv::nfd::Mask, ndn::tlv::Name, ndn::tlv::nfd::Origin, ndn::Block::parse(), ndn::encoding::readNonNegativeInteger(), ndn::encoding::readString(), ndn::tlv::nfd::Strategy, ndn::Block::type(), ndn::tlv::nfd::Uri, and ndn::Name::wireDecode().

Referenced by ControlParameters().

◆ hasName()

bool ndn::nfd::ControlParameters::hasName ( ) const
inline

◆ getName()

const Name& ndn::nfd::ControlParameters::getName ( ) const
inline

◆ setName()

ControlParameters& ndn::nfd::ControlParameters::setName ( const Name name)
inline

◆ unsetName()

ControlParameters& ndn::nfd::ControlParameters::unsetName ( )
inline

◆ hasFaceId()

◆ getFaceId()

◆ setFaceId()

◆ unsetFaceId()

ControlParameters& ndn::nfd::ControlParameters::unsetFaceId ( )
inline

◆ hasUri()

bool ndn::nfd::ControlParameters::hasUri ( ) const
inline

◆ getUri()

const std::string& ndn::nfd::ControlParameters::getUri ( ) const
inline

Definition at line 175 of file control-parameters.hpp.

References hasUri().

Referenced by ndn::nfd::operator<<().

◆ setUri()

ControlParameters& ndn::nfd::ControlParameters::setUri ( const std::string &  uri)
inline

Definition at line 182 of file control-parameters.hpp.

References ndn::nfd::CONTROL_PARAMETER_URI, and ndn::Block::reset().

◆ unsetUri()

ControlParameters& ndn::nfd::ControlParameters::unsetUri ( )
inline

Definition at line 191 of file control-parameters.hpp.

References ndn::nfd::CONTROL_PARAMETER_URI, and ndn::Block::reset().

◆ hasLocalUri()

bool ndn::nfd::ControlParameters::hasLocalUri ( ) const
inline

◆ getLocalUri()

const std::string& ndn::nfd::ControlParameters::getLocalUri ( ) const
inline

Definition at line 205 of file control-parameters.hpp.

References hasLocalUri().

Referenced by ndn::nfd::operator<<().

◆ setLocalUri()

ControlParameters& ndn::nfd::ControlParameters::setLocalUri ( const std::string &  localUri)
inline

◆ unsetLocalUri()

ControlParameters& ndn::nfd::ControlParameters::unsetLocalUri ( )
inline

◆ hasOrigin()

◆ getOrigin()

RouteOrigin ndn::nfd::ControlParameters::getOrigin ( ) const
inline

Definition at line 235 of file control-parameters.hpp.

References hasOrigin().

Referenced by ndn::nfd::operator<<().

◆ setOrigin()

◆ unsetOrigin()

ControlParameters& ndn::nfd::ControlParameters::unsetOrigin ( )
inline

◆ hasCost()

◆ getCost()

uint64_t ndn::nfd::ControlParameters::getCost ( ) const
inline

Definition at line 265 of file control-parameters.hpp.

References hasCost().

Referenced by ndn::nfd::operator<<().

◆ setCost()

◆ unsetCost()

ControlParameters& ndn::nfd::ControlParameters::unsetCost ( )
inline

◆ hasCapacity()

bool ndn::nfd::ControlParameters::hasCapacity ( ) const
inline

◆ getCapacity()

uint64_t ndn::nfd::ControlParameters::getCapacity ( ) const
inline

◆ setCapacity()

ControlParameters& ndn::nfd::ControlParameters::setCapacity ( uint64_t  capacity)
inline

◆ unsetCapacity()

ControlParameters& ndn::nfd::ControlParameters::unsetCapacity ( )
inline

◆ hasCount()

bool ndn::nfd::ControlParameters::hasCount ( ) const
inline

◆ getCount()

uint64_t ndn::nfd::ControlParameters::getCount ( ) const
inline

◆ setCount()

ControlParameters& ndn::nfd::ControlParameters::setCount ( uint64_t  count)
inline

◆ unsetCount()

ControlParameters& ndn::nfd::ControlParameters::unsetCount ( )
inline

◆ hasFlags()

◆ getFlags()

uint64_t ndn::nfd::ControlParameters::getFlags ( ) const
inline

Definition at line 355 of file control-parameters.hpp.

References hasFlags().

Referenced by getFlagBit(), ndn::nfd::operator<<(), and setFlagBit().

◆ setFlags()

ControlParameters& ndn::nfd::ControlParameters::setFlags ( uint64_t  flags)
inline

◆ unsetFlags()

ControlParameters& ndn::nfd::ControlParameters::unsetFlags ( )
inline

Definition at line 371 of file control-parameters.hpp.

References ndn::nfd::CONTROL_PARAMETER_FLAGS, and ndn::Block::reset().

Referenced by unsetFlagBit().

◆ hasMask()

bool ndn::nfd::ControlParameters::hasMask ( ) const
inline

◆ getMask()

uint64_t ndn::nfd::ControlParameters::getMask ( ) const
inline

Definition at line 385 of file control-parameters.hpp.

References hasMask().

Referenced by hasFlagBit(), ndn::nfd::operator<<(), setFlagBit(), and unsetFlagBit().

◆ setMask()

ControlParameters& ndn::nfd::ControlParameters::setMask ( uint64_t  mask)
inline

Definition at line 392 of file control-parameters.hpp.

References ndn::nfd::CONTROL_PARAMETER_MASK, and ndn::Block::reset().

Referenced by setFlagBit(), and unsetFlagBit().

◆ unsetMask()

ControlParameters& ndn::nfd::ControlParameters::unsetMask ( )
inline

Definition at line 401 of file control-parameters.hpp.

References ndn::nfd::CONTROL_PARAMETER_MASK, and ndn::Block::reset().

Referenced by unsetFlagBit().

◆ hasStrategy()

bool ndn::nfd::ControlParameters::hasStrategy ( ) const
inline

◆ getStrategy()

const Name& ndn::nfd::ControlParameters::getStrategy ( ) const
inline

Definition at line 415 of file control-parameters.hpp.

References hasStrategy().

Referenced by ndn::nfd::operator<<().

◆ setStrategy()

ControlParameters& ndn::nfd::ControlParameters::setStrategy ( const Name strategy)
inline

◆ unsetStrategy()

ControlParameters& ndn::nfd::ControlParameters::unsetStrategy ( )
inline

◆ hasExpirationPeriod()

bool ndn::nfd::ControlParameters::hasExpirationPeriod ( ) const
inline

◆ getExpirationPeriod()

const time::milliseconds& ndn::nfd::ControlParameters::getExpirationPeriod ( ) const
inline

Definition at line 445 of file control-parameters.hpp.

References hasExpirationPeriod().

Referenced by ndn::nfd::operator<<().

◆ setExpirationPeriod()

ControlParameters& ndn::nfd::ControlParameters::setExpirationPeriod ( const time::milliseconds &  expirationPeriod)
inline

◆ unsetExpirationPeriod()

ControlParameters& ndn::nfd::ControlParameters::unsetExpirationPeriod ( )
inline

◆ hasFacePersistency()

bool ndn::nfd::ControlParameters::hasFacePersistency ( ) const
inline

◆ getFacePersistency()

FacePersistency ndn::nfd::ControlParameters::getFacePersistency ( ) const
inline

Definition at line 475 of file control-parameters.hpp.

References hasFacePersistency().

Referenced by ndn::nfd::operator<<().

◆ setFacePersistency()

ControlParameters& ndn::nfd::ControlParameters::setFacePersistency ( FacePersistency  persistency)
inline

◆ unsetFacePersistency()

ControlParameters& ndn::nfd::ControlParameters::unsetFacePersistency ( )
inline

◆ hasBaseCongestionMarkingInterval()

bool ndn::nfd::ControlParameters::hasBaseCongestionMarkingInterval ( ) const
inline

◆ getBaseCongestionMarkingInterval()

time::nanoseconds ndn::nfd::ControlParameters::getBaseCongestionMarkingInterval ( ) const
inline

Definition at line 505 of file control-parameters.hpp.

References hasBaseCongestionMarkingInterval().

Referenced by ndn::nfd::operator<<().

◆ setBaseCongestionMarkingInterval()

ControlParameters& ndn::nfd::ControlParameters::setBaseCongestionMarkingInterval ( time::nanoseconds  interval)
inline

◆ unsetBaseCongestionMarkingInterval()

ControlParameters& ndn::nfd::ControlParameters::unsetBaseCongestionMarkingInterval ( )
inline

◆ hasDefaultCongestionThreshold()

bool ndn::nfd::ControlParameters::hasDefaultCongestionThreshold ( ) const
inline

◆ getDefaultCongestionThreshold()

uint64_t ndn::nfd::ControlParameters::getDefaultCongestionThreshold ( ) const
inline

get default congestion threshold (measured in bytes)

Definition at line 537 of file control-parameters.hpp.

References hasDefaultCongestionThreshold().

Referenced by ndn::nfd::operator<<().

◆ setDefaultCongestionThreshold()

ControlParameters& ndn::nfd::ControlParameters::setDefaultCongestionThreshold ( uint64_t  threshold)
inline

set default congestion threshold (measured in bytes)

Definition at line 546 of file control-parameters.hpp.

References ndn::nfd::CONTROL_PARAMETER_DEFAULT_CONGESTION_THRESHOLD, and ndn::Block::reset().

◆ unsetDefaultCongestionThreshold()

ControlParameters& ndn::nfd::ControlParameters::unsetDefaultCongestionThreshold ( )
inline

◆ getPresentFields()

const std::vector<bool>& ndn::nfd::ControlParameters::getPresentFields ( ) const
inline

◆ hasFlagBit()

bool ndn::nfd::ControlParameters::hasFlagBit ( size_t  bit) const
Returns
whether bit is enabled in Mask
Parameters
bitbit position within range [0, 64) (least significant bit is 0)

Definition at line 234 of file control-parameters.cpp.

References getMask(), and hasMask().

◆ getFlagBit()

bool ndn::nfd::ControlParameters::getFlagBit ( size_t  bit) const
Returns
bit at a position in Flags
Parameters
bitbit position within range [0, 64) (least significant bit is 0)

Definition at line 248 of file control-parameters.cpp.

References getFlags(), and hasFlags().

◆ setFlagBit()

ControlParameters & ndn::nfd::ControlParameters::setFlagBit ( size_t  bit,
bool  value,
bool  wantMask = true 
)

set a bit in Flags

Parameters
bitbit position within range [0, 64) (least significant bit is 0)
valuenew value in Flags
wantMaskif true, enable the bit in Mask

Definition at line 262 of file control-parameters.cpp.

References getFlags(), getMask(), hasFlags(), hasMask(), setFlags(), and setMask().

◆ unsetFlagBit()

ControlParameters & ndn::nfd::ControlParameters::unsetFlagBit ( size_t  bit)

disable a bit in Mask

Parameters
bitbit position within range [0, 64) (least significant bit is 0)
Postcondition
If all bits are disabled, Flags and Mask fields are deleted.

Definition at line 287 of file control-parameters.cpp.

References getMask(), hasMask(), setMask(), unsetFlags(), and unsetMask().


The documentation for this class was generated from the following files: