management: Making LocalControlHeader encoding independent of Interest/Data wire
Boost.Asio support multi-buffer send operation, which is enabled in this
commit for prepending (potentially different) LocalControlHeader's to
Interest/Data wire.
Change-Id: I39b979f89f196d3e47d6466fb71f6d440bce74d4
refs: #1265
diff --git a/src/interest.hpp b/src/interest.hpp
index a0d99d8..a22578f 100644
--- a/src/interest.hpp
+++ b/src/interest.hpp
@@ -157,7 +157,7 @@
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
- // Gettest/setters
+ // Getters/setters
const Name&
getName() const
@@ -267,6 +267,25 @@
setIncomingFaceId(uint64_t incomingFaceId)
{
getLocalControlHeader().setIncomingFaceId(incomingFaceId);
+ // ! do not reset Interest's wire !
+ return *this;
+ }
+
+ //
+
+ // NextHopFaceId helpers make sense only for Interests
+
+ uint64_t
+ getNextHopFaceId() const
+ {
+ return getLocalControlHeader().getNextHopFaceId();
+ }
+
+ Interest&
+ setNextHopFaceId(uint64_t nextHopFaceId)
+ {
+ getLocalControlHeader().setNextHopFaceId(nextHopFaceId);
+ // ! do not reset Interest's wire !
return *this;
}
@@ -447,7 +466,7 @@
EncodingEstimator estimator;
size_t estimatedSize = wireEncode(estimator);
- EncodingBuffer buffer(estimatedSize + nfd::ESTIMATED_LOCAL_HEADER_RESERVE, 0);
+ EncodingBuffer buffer(estimatedSize, 0);
wireEncode(buffer);
m_wire = buffer.block();