26 #ifndef NFD_DAEMON_FACE_LOCAL_FACE_HPP 27 #define NFD_DAEMON_FACE_LOCAL_FACE_HPP 30 #include <ndn-cxx/management/nfd-control-parameters.hpp> 95 template<
class Packet>
100 std::vector<bool> m_localControlHeaderFeatures;
105 :
Face(remoteUri, localUri, true)
119 BOOST_ASSERT(0 < feature &&
120 static_cast<size_t>(feature) < m_localControlHeaderFeatures.size());
121 return m_localControlHeaderFeatures[feature];
127 BOOST_ASSERT(0 < feature &&
128 static_cast<size_t>(feature) < m_localControlHeaderFeatures.size());
130 m_localControlHeaderFeatures[feature] = enabled;
133 std::find(m_localControlHeaderFeatures.begin() + 1,
134 m_localControlHeaderFeatures.end(),
true) <
135 m_localControlHeaderFeatures.end();
151 shared_ptr<Interest> i = make_shared<Interest>();
152 i->wireDecode(payload);
153 if (&payload != &element)
159 i->getLocalControlHeader().wireDecode(element, mask);
166 shared_ptr<Data> d = make_shared<Data>();
167 d->wireDecode(payload);
202 return header.
empty(mask);
205 template<
class Packet>
213 return packet.getLocalControlHeader().wireEncode(packet, mask);
218 #endif // NFD_DAEMON_FACE_LOCAL_FACE_HPP
static const size_t LOCAL_CONTROL_FEATURE_ANY
upper bound of LocalControlFeature enum
represents the underlying protocol and address used by a Face
signal::Signal< Face, Data > onReceiveData
fires when a Data is received
Class representing a wire element of NDN-TLV packet format.
Block filterAndEncodeLocalControlHeader(const Packet &packet)
Create LocalControlHeader, considering enabled features.
bool isLocalControlHeaderEnabled() const
get whether any LocalControlHeader feature is enabled
#define emitSignal(...)
(implementation detail)
bool decodeAndDispatchInput(const Block &element)
any feature
Copyright (c) 2011-2015 Regents of the University of California.
LocalFace(const FaceUri &remoteUri, const FaceUri &localUri)
bool isEmptyFilteredLocalControlHeader(const ndn::nfd::LocalControlHeader &header) const
Check if LocalControlHeader needs to be included, taking into account both set parameters in supplied...
signal::Signal< Face, Interest > onReceiveInterest
fires when an Interest is received
static const size_t LOCAL_CONTROL_FEATURE_MAX
represents an error in TLV encoding or decoding
void setLocalControlHeaderFeature(LocalControlFeature feature, bool enabled=true)
enable or disable a LocalControlHeader feature