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

bigcatlei at gmail.com bigcatlei at gmail.com
Tue Feb 9 17:36:10 PST 2016


Hi Alex, 

Thanks! 

We also put it in daemon/fw. Maybe something is wrong in our side. We will double check carefully. 

Thanks, 
Best regards, 

Lei


> On Feb 9, 2016,5:30 PM,Alex Afanasyev <aa at cs.ucla.edu> wrote:
> 
> 
>> 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, )
> 
> <add-tmp-strategy.patch>
> 
> 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> wrote:
>>> 
>>> 
>>>> On Feb 9, 2016, at 2:31 PM, Lei Liu <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/f8aca37a/attachment.html>


More information about the Nfd-dev mailing list