<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">The first one has been designed to facilitate the creation of the ndnSIM unit-tests. The second one can add and potentially update a FIB entry (if it already exists). I do not see how you could access the entries this way and get the cost of each next hop.<div class=""><br class=""></div><div class=""><div class="">
<div class=""><div class=""><div class=""><span class="" style="float: none; display: inline !important;">Spyridon (Spyros) Mastorakis</span><br class=""><span class="" style="float: none; display: inline !important;">Personal Website: </span><a href="http://cs.ucla.edu/~mastorakis/" class="">http://cs.ucla.edu/~mastorakis/</a><br class=""><span class="" style="float: none; display: inline !important;">Internet Research Laboratory</span><br class=""><span class="" style="float: none; display: inline !important;">Computer Science Department</span><br class=""><span class="" style="float: none; display: inline !important;">UCLA</span></div></div></div>
</div>
<br class=""><div><blockquote type="cite" class=""><div class="">On May 24, 2016, at 12:27 AM, Muhammad Hosain Abdollahi Sabet <<a href="mailto:mhasabet@gmail.com" class="">mhasabet@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><div class="gmail_default" style="font-family:tahoma,sans-serif">You mean ScenarioHelper::Routeinfo and ScenarioHelper::addRoutes cannot help?</div><div class="gmail_default" style="font-family:tahoma,sans-serif"><br class=""></div><div class="gmail_default" style="font-family:tahoma,sans-serif">Regards,</div><div class="gmail_default" style="font-family:tahoma,sans-serif">Sabet</div></div><div class="gmail_extra"><br clear="all" class=""><div class=""><div class="gmail_signature"><div dir="ltr" class=""><div dir="rtl" class=""><font face="tahoma, sans-serif" class="">خندان باشید</font></div><div dir="rtl" class=""><font face="tahoma, sans-serif" class="">با تشکر</font></div></div></div></div>
<br class=""><div class="gmail_quote">On Tue, May 24, 2016 at 6:23 AM, Spyridon (Spyros) Mastorakis <span dir="ltr" class=""><<a href="mailto:mastorakis@cs.ucla.edu" target="_blank" class="">mastorakis@cs.ucla.edu</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word" class="">Hi Sabet,<div class=""><br class=""></div><div class="">the cost has to do with the overall routing/forwarding administration and policies. I do not think that we have a standardized way to calculated the cost for the next hop of a FIB entry. If you think about it, the adaptive forwarding plane and the forwarding strategy can override the routing plane, set/reset the cost for each next hop and change the face ranking on each node.</div><div class=""><br class=""></div><div class="">To access the cost, you will have to access the FIB of a node and then use the FIB look up API:</div><div class=""><br class=""></div><div class=""><a href="https://github.com/named-data-ndnSIM/NFD/blob/NFD-0.3.4-ndnSIM/daemon/table/fib.hpp#L57-L69" target="_blank" class="">https://github.com/named-data-ndnSIM/NFD/blob/NFD-0.3.4-ndnSIM/daemon/table/fib.hpp#L57-L69</a></div><div class=""><br class=""></div><div class="">The highlighted methods will return a shared_ptr to a fib entry. Then you can use the fib entry API to get the next-hops for this fib entry:</div><div class=""><br class=""></div><div class=""><a href="https://github.com/named-data-ndnSIM/NFD/blob/NFD-0.3.4-ndnSIM/daemon/table/fib-entry.hpp#L62-L63" target="_blank" class="">https://github.com/named-data-ndnSIM/NFD/blob/NFD-0.3.4-ndnSIM/daemon/table/fib-entry.hpp#L62-L63</a></div><div class=""><br class=""></div><div class="">Finally, you will use the next-hop API to get the cost of each next hop:</div><div class=""><br class=""></div><div class=""><a href="https://github.com/named-data-ndnSIM/NFD/blob/NFD-0.3.4-ndnSIM/daemon/table/fib-nexthop.hpp#L50-L51" target="_blank" class="">https://github.com/named-data-ndnSIM/NFD/blob/NFD-0.3.4-ndnSIM/daemon/table/fib-nexthop.hpp#L50-L51</a> </div><div class=""><br class=""></div><div class="">Hope that this helps,</div><div class=""><br class=""><div class="">
<div class=""><div class=""><div class=""><span style="float:none;display:inline!important" class="">Spyridon (Spyros) Mastorakis</span><br class=""><span style="float:none;display:inline!important" class="">Personal Website: </span><a href="http://cs.ucla.edu/~mastorakis/" target="_blank" class="">http://cs.ucla.edu/~mastorakis/</a><br class=""><span style="float:none;display:inline!important" class="">Internet Research Laboratory</span><br class=""><span style="float:none;display:inline!important" class="">Computer Science Department</span><br class=""><span style="float:none;display:inline!important" class="">UCLA</span></div><div class=""><br class=""></div></div></div></div><div class=""><div class="h5"><div class=""><blockquote type="cite" class=""><div class="">On May 22, 2016, at 6:17 AM, Muhammad Hosain Abdollahi Sabet <<a href="mailto:mhasabet@gmail.com" target="_blank" class="">mhasabet@gmail.com</a>> wrote:</div><br class=""><div class=""><div dir="ltr" class=""><div class="gmail_default" style="font-family:tahoma,sans-serif"><font face="tahoma, sans-serif" class="">Hi everyone,</font></div><div class="gmail_default" style="font-family:tahoma,sans-serif"><br class=""></div><div class="gmail_default" style="font-family:tahoma,sans-serif">In my custom application, based on the received interest I want to create a FIB entry for a prefix - which is retrieved by processing the interest's name. For using FIBHelper::AddRoute in need to have the metric for prefix. How can I calculate it? Is there any method some where which you(in a node) can give it prefix and it gives you back the metric for that prefix?</div><div class="gmail_default" style="font-family:tahoma,sans-serif"><br class=""></div><div class="gmail_default" style="font-family:tahoma,sans-serif">Thanks,</div><div class="gmail_default" style="font-family:tahoma,sans-serif">Sabet</div>
</div></div></blockquote></div><br class=""></div></div></div></div></blockquote></div><br class=""></div>
</div></blockquote></div><br class=""></div></body></html>