[ndnSIM] List all Installed Prefix on a Node from App

Hitesh Wadekar wadekahn at clarkson.edu
Wed Feb 25 17:39:49 PST 2015


Thank you Alex.

It worked, however, I will prefer to use aggregation object on node for
prefix through AppHelper. It will help to track and get the application
based configured prefix as we can configure many applications on same node.

Cheer,
Hitesh



On Wed, Feb 25, 2015 at 2:53 PM, Alex Afanasyev <
alexander.afanasyev at ucla.edu> wrote:

> Hi Hitesh,
>
> You actually have several ways to do it.  The “right” way is to request so
> called FIB status dataset from NFD (
> http://redmine.named-data.net/projects/nfd/wiki/FibMgmt#FIB-Dataset).
> However, given that ndnSIM is a simulator, you can do it directly:
>
> Ptr<Node> node = ...
> Ptr<ndn::L3Protocol> l3 = node->GetObject<ndn::L3Protocol>();
> shared_ptr<nfd::Forwarder> fw = l3->getForwarder();
> nfd::Fib& fib = fw->getFib();
>
> for (const auto&& fibEntry : fib) {
>   std::cout << " - “ << fibEntry.getPrefix() << std::endl;
>   for (const auto&& nh : fibEntry.getNextHops()) {
>     std::cout << "    - " << nh.getFace() << “, “ << nh.getFace().getId()
> << “, “ << nh.getCost() << std::endl;
>   }
> }
>
> (I haven’t checked this code, so it may have some minor issues).
>
>> Alex
>
> On Feb 25, 2015, at 9:28 AM, Hitesh Wadekar <wadekahn at clarkson.edu> wrote:
>
> Hey Guys,
>
> How can I get all the installed prefix information on a node from
> application? For instance, I have a node object and I want to iterate all
> the prefix configured for the installed application on that node.
>
> Thanks
>
> Cheer,
> Hitesh
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.lists.cs.ucla.edu/pipermail/ndnsim/attachments/20150225/86c64275/attachment.html>


More information about the ndnSIM mailing list