[Ndn-lib] writing a code to create an Interest packet

Zeinab Zali zeinabzali at gmail.com
Mon Aug 1 04:46:29 PDT 2016


Thank you very much. That was a big help :)




On Mon, Aug 1, 2016 at 2:13 PM, Thompson, Jeff <jefft0 at remap.ucla.edu>
wrote:

> Hello Zeinab,
>
> The TlvEncoder is an internal utility. It is not meant to be called
> directly by applications. You can encode an Interest using the wireEncode
> method as shown on the API page:
>
> http://named-data.net/doc/ndn-ccl-api/interest.html#interest-wireencode-method
>
> Here is an example program to encode an Interest:
>
> https://github.com/named-data/jndn/blob/master/examples/src/net/named_data/jndn/tests/TestEncodeDecodeInterest.java#L234
>
> If you need to add an ImplicitSha256DigestComponent to the name, see:
>
> http://named-data.net/doc/ndn-ccl-api/name.html#name-appendimplicitsha256digest-method
>
> Thank you,
> - Jeff T
>
> From: Ndn-lib <ndn-lib-bounces at lists.cs.ucla.edu> on behalf of Zeinab
> Zali <zeinabzali at gmail.com>
> Date: Monday, August 1, 2016 at 1:47:00
> To: NDN Lib <ndn-lib at lists.cs.ucla.edu>
> Subject: [Ndn-lib] writing a code to create an Interest packet
>
>
> Hi all,
>
> I am confused with TlvEncoder and Bytebuffers. I want to write a simple
> java code to create a UDP packet that contained an Interest. I tried to use
> writeBlobTlv of class TlvEncoder in jndn package. But I don't understand if
> I should create the outer Tlv or the inner one. For example to create a
> name Tlv, should I create a TlvEncoder object for nameComponent and then
> another one for ImplicitSha256DigestComponent, and then a Name component?
> Would you please give me a simple example to create a Tlv with its sub Tlvs?
>
> Thanks a lot.
>
> Zeinab.
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.lists.cs.ucla.edu/pipermail/ndn-lib/attachments/20160801/4767e45f/attachment.html>


More information about the Ndn-lib mailing list