<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<p>I believe the 832 TLV-TYPE you used below overlaps with the
existing CongestionMark TLV-TYPE (also 832). What release of
ndn-cxx and NFD are you modifying? If it's 0.5.1 or later, this
field should be present.<br>
</p>
<p>Eric<br>
</p>
<br>
<div class="moz-cite-prefix">On 01/04/2018 07:13 PM, 小杰许 wrote:<br>
</div>
<blockquote type="cite"
cite="mid:CAGx6dK1ctiqPBSk+-4iCkAWGVvx7RODWRw57MZHogwF6sTVP8A@mail.gmail.com">
<div dir="ltr">Thanks for your reply!
<div> </div>
<div>Actually, I have done this steps before, but it didn't work
and I still meet the problem.</div>
<div><br>
</div>
<div>I modified these files. </div>
<div><br>
</div>
<div>A、in ndn-cxx/src/lp</div>
<div>1、fields.hpp</div>
<div>
<div>typedef FieldDecl<field_location_tags::Header,</div>
<div> uint64_t,</div>
<div> tlv::CustomMark> CustomMarkField;</div>
<div>BOOST_CONCEPT_ASSERT((Field<CustomMarkField>));</div>
</div>
<div><br>
</div>
<div>
<div><br>
</div>
<div> CustomMarkField,</div>
<div><br>
</div>
<div> > FieldSet;</div>
</div>
<div><br>
</div>
<div>2、tags.hpp</div>
<div>typedef SimpleTag<uint64_t, 0x60000002>
CustomMarkTag;<br>
</div>
<div><br>
</div>
<div>3、tlv.hpp</div>
<div> CustomMark = 832,<br>
</div>
<div><br>
</div>
<div>B、in ndn-cxx/src</div>
<div>face.cpp</div>
<div>
<div>extractLpLocalFields(NetPkt& netPacket, const
lp::Packet& lpPacket)</div>
<div>{</div>
<div> .......</div>
<div> addTagFromField<lp::CustomMarkTag,
lp::CustomMarkField>(netPacket, lpPacket);</div>
<div>}</div>
</div>
<div> C、ndn-cxx/src/detail</div>
<div>face-impl.hpp</div>
<div><br>
</div>
<div>
<div>void</div>
<div> asyncPutData(const Data& data)</div>
<div> {</div>
<div> .........</div>
<div> addFieldFromTag<lp::CongestionMarkField,
lp::CongestionMarkTag>(lpPacket, data);</div>
<div> addFieldFromTag<lp::CustomMarkField,
lp::CustomMarkTag>(lpPacket, data);</div>
<div><br>
</div>
<div> .........</div>
<div> }</div>
</div>
<div><br>
</div>
<div>D、NFD/daemon/face</div>
<div>generic-link-service.cpp</div>
<div><br>
</div>
<div>encodeLpFields</div>
<div><br>
</div>
<div>
<div>void</div>
<div>GenericLinkService::encodeLpFields(const
ndn::PacketBase& netPkt, lp::Packet& lpPacket)</div>
<div>{</div>
<div> ......</div>
<div> shared_ptr<lp::CustomMarkTag> customMarkTag =
netPkt.getTag<lp::CustomMarkTag>();</div>
<div> if (customMarkTag != nullptr) {</div>
<div>
lpPacket.add<lp::customMarkField>(*customMarkTag);</div>
<div> }</div>
<div>.....</div>
<div>}</div>
</div>
<div><br>
</div>
<div>decodeData</div>
<div><br>
</div>
<div>
<div>void</div>
<div>GenericLinkService::decodeData(const Block& netPkt,
const lp::Packet& firstPkt)</div>
<div>{</div>
<div> ......</div>
<div><br>
</div>
<div> if (firstPkt.has<lp::CustomMarkField>()) {</div>
<div>
data->setTag(make_shared<lp::CustomMarkTag>(firstPkt.get<lp::CustomMarkField>()));</div>
<div> }</div>
<div><br>
</div>
<div> ......</div>
<div>}</div>
</div>
<div><br>
</div>
<div>That's all I have done. But I still get the error when I
compile NFD. Here is beginning of the error:</div>
<div><br>
</div>
<div><br>
</div>
<div><br>
</div>
<div>
<div>Waf: Entering directory `/home/icpclient1/NFD/build'</div>
<div>[ 73/157] Compiling daemon/face/generic-link-service.cpp</div>
<div>In file included from
/usr/local/include/ndn-cxx/lp/packet.hpp:25:0,</div>
<div> from
../daemon/face/lp-fragmenter.hpp:31,</div>
<div> from
../daemon/face/generic-link-service.hpp:30,</div>
<div> from
../daemon/face/generic-link-service.cpp:26:</div>
<div>/usr/local/include/ndn-cxx/lp/fields.hpp:78:19: error:
‘CustomMark’ is not a member of ‘ndn::lp::tlv’</div>
<div> tlv::CustomMark> CustomMarkField;</div>
<div> ^</div>
<div>/usr/local/include/ndn-cxx/lp/fields.hpp:78:19: error:
‘CustomMark’ is not a member of ‘ndn::lp::tlv’</div>
<div>/usr/local/include/ndn-cxx/lp/fields.hpp:78:33: error:
template argument 3 is invalid</div>
<div> tlv::CustomMark> CustomMarkField;</div>
</div>
<div><br>
</div>
<div>Do I miss some steps? Can you give me some suggestions?
Thanks.</div>
<div><br>
</div>
<div>Yours,</div>
<div>Junjie Xu</div>
<div><br>
</div>
<div><br>
</div>
</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">2018-01-05 3:00 GMT+08:00 Eric Newberry
<span dir="ltr"><<a
href="mailto:enewberry@email.arizona.edu" target="_blank"
moz-do-not-send="true">enewberry@email.arizona.edu</a>></span>:<br>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
<div text="#000000" bgcolor="#FFFFFF">
<p>Junjie,</p>
<p>In order for the tag to be encoded and decoded properly
by the LinkService, you need to assign it a TLV-TYPE in
ndn-cxx's source file lp/tlv.hpp. For example, the
NextHopFaceId tag has a TLV-TYPE of 816.<br>
</p>
<p>Eric<br>
</p>
<div>
<div class="h5"> <br>
<div class="m_-4142178463563934600moz-cite-prefix">On
01/04/2018 02:40 AM, 小杰许 wrote:<br>
</div>
</div>
</div>
<blockquote type="cite">
<div>
<div class="h5">
<div dir="ltr">
<div style="font-size:14px">I meet some problems
when I try to add a new field in data in NFD-dev
by using tags. And I found </div>
<div style="font-size:14px">someone have met the
same problems before.
<div><br>
</div>
<div>here is the website of of the problem<br>
<div><a
href="http://www.lists.cs.ucla.edu/pipermail/nfd-dev/2017-August/002611.html"
target="_blank" moz-do-not-send="true">http://www.lists.cs.ucla.edu/p<wbr>ipermail/nfd-dev/2017-August/0<wbr>02611.html</a><br>
</div>
</div>
<div><span style="color:rgb(0,0,0);white-space:pre-wrap">
</span></div>
<div><span style="color:rgb(0,0,0);white-space:pre-wrap">I follow all the steps above, </span><span style="color:rgb(0,0,0);white-space:pre-wrap">defined </span><span style="color:rgb(0,0,0);white-space:pre-wrap">LpHeaderField. defined Tag, assigned a tag number, but with CacheMarkTag instead. Then I compile ndn-cxx, it works well. </span></div>
<div><span style="color:rgb(0,0,0);white-space:pre-wrap">
</span></div>
<div><span style="color:rgb(0,0,0);white-space:pre-wrap">But when I modify my NFD LinkService to encode and decode the new tag.</span></div>
<div>
<pre style="white-space:pre-wrap;color:rgb(0,0,0)"><span style="font-family:arial,sans-serif">I get the error "error: ‘XXXTag’ is not a member of "ndn::lp::tlv" and other errors. Can you give me some advices?</span></pre>
</div>
<div><span style="color:rgb(0,0,0);white-space:pre-wrap">
</span></div>
<div><span style="color:rgb(0,0,0);white-space:pre-wrap">Looking forward to your reply.</span></div>
</div>
<div style="font-size:14px"><span style="color:rgb(0,0,0);white-space:pre-wrap">
</span></div>
<div style="font-size:14px"><span style="color:rgb(0,0,0);white-space:pre-wrap">
</span></div>
<div style="font-size:14px"><span style="color:rgb(0,0,0);white-space:pre-wrap">Yours,</span></div>
<div style="font-size:14px"><span style="color:rgb(0,0,0);white-space:pre-wrap">Junjie Xu</span></div>
</div>
<br>
<fieldset
class="m_-4142178463563934600mimeAttachmentHeader"></fieldset>
<br>
</div>
</div>
<pre>______________________________<wbr>_________________
Nfd-dev mailing list
<a class="m_-4142178463563934600moz-txt-link-abbreviated" href="mailto:Nfd-dev@lists.cs.ucla.edu" target="_blank" moz-do-not-send="true">Nfd-dev@lists.cs.ucla.edu</a>
<a class="m_-4142178463563934600moz-txt-link-freetext" href="http://www.lists.cs.ucla.edu/mailman/listinfo/nfd-dev" target="_blank" moz-do-not-send="true">http://www.lists.cs.ucla.edu/<wbr>mailman/listinfo/nfd-dev</a>
</pre>
</blockquote>
<br>
</div>
</blockquote>
</div>
<br>
</div>
</blockquote>
<br>
</body>
</html>