[Nfd-dev] How to enable a new forwarding strategy

Alex Afanasyev aa at CS.UCLA.EDU
Tue Feb 9 17:30:14 PST 2016


> On Feb 9, 2016, at 4:51 PM, bigcatlei at gmail.com wrote:
> 
> Hi Alex,
> 
> Thanks for your reply. We did add the following into our cpp program
> 
>> const Name YourStrategyClass::STRATEGY_NAME("ndn:/localhost/nfd/strategy/you-strategy-name/%FD%00");
>> NFD_REGISTER_STRATEGY(YourStrategyClass);
> 
> But it doesn't work. The nfdc cannot use the new strategy with the error code 504.
> 
> Is there any other particular things that we need to note in order to install a new forwarding strategy?

Hmm. It should work.  I just tried to create a dummy strategy.  I just added tmp.hpp and tmp.cpp files into daemon/fw folder and had invocation of NFD_REGISTER_STRATEGY macro.  After I run the compiled NFD, I'm able to use nfdc to set strategy:

    # nfdc set-strategy /hello /localhost/nfd/strategy/tmp/%FD%00
    Successfully set strategy choice: ControlParameters(Name: /hello, Strategy: /localhost/nfd/strategy/tmp/%FD%00, )



Did you added your strategy files in some other location?

---
Alex

> 
> Thanks,
> Best regards,
> 
> Lei
> 
> 
> On Feb 9, 2016,3:58 PM,Alex Afanasyev <aa at cs.ucla.edu <mailto:aa at cs.ucla.edu>> wrote:
> 
>> 
>>> On Feb 9, 2016, at 2:31 PM, Lei Liu <bigcatlei at gmail.com <mailto:bigcatlei at gmail.com>> wrote:
>>> 
>>> Hi,
>>> 
>>> We developed a new forwarding strategy, but how to actually use it in NFD? nfdc command-line tool does not recognize this new forwarding strategy.
>>> 
>>> NFD developer guide mentioned to modify daemon/fw/available-strategies.cpp and install the new strategy to the list of existing built-in strategies. But this file "daemon/fw/available-strategies.cpp" is no longer available in the latest NFD.
>>> 
>>> Thanks,
>>> Best regards,
>>> 
>>> Lei
>> 
>> In .cpp file of your strategy just add
>> 
>> const Name YourStrategyClass::STRATEGY_NAME("ndn:/localhost/nfd/strategy/you-strategy-name/%FD%00");
>> NFD_REGISTER_STRATEGY(YourStrategyClass);
>> 
>> After that you should be able to use ndn:/localhost/nfd/strategy/you-strategy-name in nfdc.
>> 
>> ---
>> Alex
>> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.lists.cs.ucla.edu/pipermail/nfd-dev/attachments/20160209/56567c3b/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: add-tmp-strategy.patch
Type: application/octet-stream
Size: 4283 bytes
Desc: not available
URL: <http://www.lists.cs.ucla.edu/pipermail/nfd-dev/attachments/20160209/56567c3b/attachment.obj>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.lists.cs.ucla.edu/pipermail/nfd-dev/attachments/20160209/56567c3b/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 841 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://www.lists.cs.ucla.edu/pipermail/nfd-dev/attachments/20160209/56567c3b/attachment.bin>


More information about the Nfd-dev mailing list