[Nfd-dev] [Ndn-lib] Preview of NFD-iOS and SwiftNDN library

Wentao Shang wentaoshang at gmail.com
Thu Mar 19 08:12:48 PDT 2015


Hi Junxiao,

I'm glad that you liked it :) The TLV encoding/decoding is where I spent a
lot of effort. I've tried different approaches and eventually settled on
the current one.

Two things that I found most helpful in the current design:
1/ a generic decoder function that can parse a byte array into an array of
TLV blocks. The compound TLV classes can call this function recursively to
build the TLV parse tree.
2/ two generic TLV base classes for those whose value is a single
non-negative integer and those whose value is a UTF-8 string. New TLV
classes can inherit from those base classes and simply specify the desired
TLV type code. The base class will handle all the encoding/decoding work.
This comes very handy when you have to write a lot of TLV classes
containing non-negative integers for NFD management protocol .

Best,
Wentao


On Thu, Mar 19, 2015 at 6:20 AM Junxiao Shi <shijunxiao at email.arizona.edu>
wrote:

> Hi Wentao
>
> I looked at the code, and liked the simplicity of TLV decoding procedures.
> It appears to be much easier to add a new TLV type in SwiftNDN than in
> ndn-cxx or NDN-JS.
>
> I probably won't use this app because I don't have iOS devices.
>
> Yours, Junxiao
> On Mar 18, 2015 5:09 PM, "Wentao Shang" <wentaoshang at gmail.com> wrote:
>
>> Hi team,
>>
>> I write this message to inform you that there has been major progress on
>> porting NFD to iOS platform. As for now, I'm able to compile and run NFD as
>> an iOS App on the iPhone simulator. I cannot test it on real device because
>> it requires signing the package with Apple-certified developer's key which
>> I don't have. So there might be unexpected bugs when the App runs on real
>> iPhones :P Unfortunately the code is not available on Github yet because
>> I'm still trying to reorganize the dependencies in order to simplify the
>> build process. After that I'll publish the code.
>>
>> Before I started the porting work, I was already working on a new NDN
>> client library written in (almost) pure Swift, which is designed for Apple
>> platforms exclusively (Mac, iPhone, iPad, etc.) It is not polished right
>> now but you can take a look at the code at
>> https://github.com/wentaoshang/SwiftNDN
>>
>> The motivation of using Swift as a development language is because it is
>> one of the best languages for building OSX and iOS apps, especially when
>> you need a GUI interface using Cocoa or Cocoa Touch. (The other choice is
>> Objective C but I don't quite like that language. Also, Apple is promoting
>> the new language very hard to hopefully replace the old one.)
>>
>> Attached are some screenshots of the NFD app running on iPhone simulator.
>> It is built with Cocoa Touch and SwiftNDN and has the basic functionality
>> of reporting forwarder status such as faces, fib and rib information. All
>> my testing are done primarily using this demo app and some basic
>> consumer/producer apps built with the same libraries.
>>
>> Best,
>> Wentao
>>
>>
>> _______________________________________________
>> Ndn-lib mailing list
>> Ndn-lib at lists.cs.ucla.edu
>> http://www.lists.cs.ucla.edu/mailman/listinfo/ndn-lib
>>
>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.lists.cs.ucla.edu/pipermail/nfd-dev/attachments/20150319/e6f2c698/attachment.html>


More information about the Nfd-dev mailing list