<div dir="ltr">Just an update:<div>I was able to create a new field in the NDNLP packet.<div><br></div><div>I changed the following files:</div><div>"ndn-cxx/src/lp/fields.hpp"</div><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div>    typedef detail::FieldDecl<field_location_tags::Header,</div><div>                                            uint64_t,</div><div>                                            tlv::CustomTag> CustomTagField;</div><div>    BOOST_CONCEPT_ASSERT((Field<CustomTagField>));</div><div>    </div><div><div>    CustomTagField</div></div><div><div>     > FieldSet;</div></div></blockquote><div><br></div><div>"ndn-cxx/src/lp/tags.hpp"<br></div><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div>typedef SimpleTag<uint64_t, 0x60000001> CustomTag;</div></blockquote><div><br></div><div>"ndn-cxx/src/lp/tlv.hpp"<br></div><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div>CustomTag= 901</div><div><br></div></blockquote><div>compiled with ./waf</div><div><br></div>"NFD/daemon/face/generic-link-service.cpp"<br><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div><div>void</div></div><div><div>GenericLinkService::encodeLocalFields(const ndn::TagHost& netPkt, lp::Packet& lpPacket)</div></div><div><div>{</div></div><div><div>  shared_ptr<lp::IncomingFaceIdTag> incomingFaceIdTag = netPkt.getTag<lp::IncomingFaceIdTag>();</div></div><div><div>  if (incomingFaceIdTag != nullptr) {</div></div><div><div>    lpPacket.add<lp::IncomingFaceIdField>(*incomingFaceIdTag);</div></div><div><div>  }</div></div><div><div><br></div></div><div><div>  shared_ptr<lp::CustomTag> customTag = netPkt.getTag<lp::CustomTag>();</div></div><div><div>  if (customTag != nullptr) {</div></div><div><div>    lpPacket.add<lp::CustomTagField>(*customTag);</div></div><div><div>  }</div></div><div><div>}</div></div></blockquote><div><br></div><div>compiled with ./waf<br></div><div><br></div><div>"ndn-cxx/examples/consumer.cpp"</div><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div><div>    // Insert Packet Tag</div></div><div><div>    interest.setTag(std::make_shared<lp::CustomTag>(54321));</div></div><div><div>    std::cout << "Tag value: " << interest.getTag<lp::CustomTag>() << std::endl;</div></div><div><div><br></div></div><div><div>    m_face.expressInterest(interest,</div></div><div><div>                           bind(&Consumer::onData, this,  _1, _2),</div></div><div><div>                           bind(&Consumer::onTimeout, this, _1));</div></div></blockquote><div><br></div><div>and finally, on the producer app</div><div>"ndn-cxx/examples/producer.cpp"<br></div><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div><div>onInterest(const InterestFilter& filter, const Interest& interest)</div></div><div><div>  {</div></div><div><div>    std::cout << "<< I: " << interest << std::endl;</div></div><div><br></div><div><div>    // Read Packet Tag</div></div><div><div>    std::shared_ptr<lp::CustomTag> tag = interest.getTag<lp::CustomTag>();</div></div><div><div>    std::cerr << "Tag from Consumer: " << tag << std::endl;</div></div></blockquote><div><br></div></div><div>compiled with ./waf<br></div><div>and ran the applications, but the tag doesn't arrive at the producer:</div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><div><< I: /example/testApp/randomData?ndn.MustBeFresh=1&ndn.InterestLifetime=1000&ndn.Nonce=1547038398</div></div><div><div>Tag from Consumer: 0</div></div></blockquote><div><br></div><div><br></div><div>Is there anything missing?</div><div><br></div><div><br></div><div>Thank you</div><div><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jul 20, 2017 at 10:54 PM, Adhy Satya <span dir="ltr"><<a href="mailto:adhysatya820@gmail.com" target="_blank">adhysatya820@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi,<div><br></div><div>Following the idea of exchanging information between the consumer and the producer, what's the difference between creating a ndn::lp::Packet or a ndn::TagHost? Which method should I use?</div><div><br></div><div><br></div><div>I saw older posts (<a href="http://www.lists.cs.ucla.edu/pipermail/nfd-dev/2017-February/002260.html" target="_blank">this</a>, and <a href="http://www.lists.cs.ucla.edu/pipermail/nfd-dev/2016-February/001536.html" target="_blank">this</a>), but this methods are for CachePolicy and NextHopFaceIdTag. I want to send a string "Hello" (type Name actually).</div><div><br></div><div>In line with what Ashlesh did, I added the following lines at Consumer (<a href="https://github.com/named-data/ndn-cxx/blob/master/examples/consumer.cpp#L42" target="_blank">https://github.com/named-<wbr>data/ndn-cxx/blob/master/<wbr>examples/consumer.cpp#L42</a>), but need help with the commented lines.</div><div><br></div><div>    ndn::lp::Packet lpPacket;<br></div><div>    // add string ("Hello") to lpPacket</div><div>    // send lpPacket</div><div><br></div><div>And then I'll need to read that packet in the producer.</div><div><br></div><div><br></div><div>Thanks again for your help.</div><div><br></div><div><br></div></div>
</blockquote></div><br></div></div>