[ndnSIM] face: Update code to work with updated LocalControlHeader implementation
Change-Id: Iafd62348ee1f09f256d54152ce7274cf24d5b9f9
Refs: #2183
diff --git a/daemon/face/local-face.hpp b/daemon/face/local-face.hpp
index e1c34c3..5f2eb0d 100644
--- a/daemon/face/local-face.hpp
+++ b/daemon/face/local-face.hpp
@@ -151,9 +151,11 @@
i->wireDecode(payload);
if (&payload != &element)
{
- i->getLocalControlHeader().wireDecode(element,
- false,
- this->isLocalControlHeaderEnabled(LOCAL_CONTROL_FEATURE_NEXT_HOP_FACE_ID));
+ uint8_t mask = 0;
+ if (this->isLocalControlHeaderEnabled(LOCAL_CONTROL_FEATURE_NEXT_HOP_FACE_ID)) {
+ mask |= ndn::nfd::LocalControlHeader::ENCODE_NEXT_HOP;
+ }
+ i->getLocalControlHeader().wireDecode(element, mask);
}
this->onReceiveInterest(*i);
@@ -192,17 +194,22 @@
if (!this->isLocalControlHeaderEnabled())
return true;
- return header.empty(this->isLocalControlHeaderEnabled(LOCAL_CONTROL_FEATURE_INCOMING_FACE_ID),
- false);
+ uint8_t mask = 0;
+ if (this->isLocalControlHeaderEnabled(LOCAL_CONTROL_FEATURE_INCOMING_FACE_ID)) {
+ mask |= ndn::nfd::LocalControlHeader::ENCODE_INCOMING_FACE_ID;
+ }
+ return header.empty(mask);
}
template<class Packet>
inline Block
LocalFace::filterAndEncodeLocalControlHeader(const Packet& packet)
{
- return packet.getLocalControlHeader().wireEncode(packet,
- this->isLocalControlHeaderEnabled(LOCAL_CONTROL_FEATURE_INCOMING_FACE_ID),
- false);
+ uint8_t mask = 0;
+ if (this->isLocalControlHeaderEnabled(LOCAL_CONTROL_FEATURE_INCOMING_FACE_ID)) {
+ mask |= ndn::nfd::LocalControlHeader::ENCODE_INCOMING_FACE_ID;
+ }
+ return packet.getLocalControlHeader().wireEncode(packet, mask);
}
} // namespace nfd