[ndnSIM] Addtional metadata in Interest and data packet
Spyridon (Spyros) Mastorakis
mastorakis at CS.UCLA.EDU
Mon Oct 10 09:22:06 PDT 2016
Hi,
you will have to create methods to encode and decode the additional fields.
You can take a look here:
https://github.com/named-data/ndn-cxx/blob/master/src/data.cpp#L50-L167 <https://github.com/named-data/ndn-cxx/blob/master/src/data.cpp#L50-L167>
https://github.com/named-data/ndn-cxx/blob/master/src/interest.cpp#L215-L361 <https://github.com/named-data/ndn-cxx/blob/master/src/interest.cpp#L215-L361>
Hope that this helps.
Spyridon (Spyros) Mastorakis
Personal Website: http://cs.ucla.edu/~mastorakis/ <http://cs.ucla.edu/~mastorakis/>
Internet Research Laboratory
Computer Science Department
UCLA
> On Oct 10, 2016, at 3:11 AM, 황인찬 <neogeoss at ajou.ac.kr> wrote:
>
> Dear NDN Sim users,
>
>
> I have been trying to add an additional property to an Interest packet.
>
> In NDN-cxx, there is Interest.cpp file that defines Interest encoding in Interest::wireEncode(EncodingImpl<TAG>& encoder)
>
>
> // Interest ::= INTEREST-TYPE TLV-LENGTH
>
> // Name
>
> // Selectors?
>
> // Nonce
>
> // InterestLifetime?
>
> // Link?
>
> // SelectedDelegation?
>
>
> // ProducerUid? à ....................... I added it.
>
>
> // (reverse encoding)
>
>
> There is also a decoding scheme for it, Interest::wireDecode(const Block& wire) in the file.
>
>
> Although I added additional variables and its getter and setters to the Interest packet,
>
> There is an error "Requested decoding of ControlResponse, but Block is of different type"
>
> when I run it with after I add //totalLength += getProducerUid().wireEncode(encoder); for wireEncode
>
> //m_ProducerUid.wireDecode(m_wire.get(tlv::Name)); for wireDecode.
>
>
> I am now trying to match block types equal, But I am stuck. Does anyone of you know about adding a new property to the Interest and data packet?
>
> Any comment will help
>
>
>
> Here is the current code I have been working on is in "https://github.com/NDNUtils/NDNSIM <https://github.com/NDNUtils/NDNSIM>"
>
>
> Best wishes,
>
>
> Inchan Hwang
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.lists.cs.ucla.edu/pipermail/ndnsim/attachments/20161010/d2fc8762/attachment.html>
More information about the ndnSIM
mailing list