<div dir="ltr"><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></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"><div><div class="gmail_signature"><div dir="ltr"><div dir="rtl"><font face="tahoma, sans-serif">خندان باشید</font></div><div dir="rtl"><font face="tahoma, sans-serif">با تشکر</font></div></div></div></div>
<br><div class="gmail_quote">On Tue, May 24, 2016 at 6:23 AM, Spyridon (Spyros) Mastorakis <span dir="ltr"><<a href="mailto:mastorakis@cs.ucla.edu" target="_blank">mastorakis@cs.ucla.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">Hi Sabet,<div><br></div><div>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><br></div><div>To access the cost, you will have to access the FIB of a node and then use the FIB look up API:</div><div><br></div><div><a href="https://github.com/named-data-ndnSIM/NFD/blob/NFD-0.3.4-ndnSIM/daemon/table/fib.hpp#L57-L69" target="_blank">https://github.com/named-data-ndnSIM/NFD/blob/NFD-0.3.4-ndnSIM/daemon/table/fib.hpp#L57-L69</a></div><div><br></div><div>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><br></div><div><a href="https://github.com/named-data-ndnSIM/NFD/blob/NFD-0.3.4-ndnSIM/daemon/table/fib-entry.hpp#L62-L63" target="_blank">https://github.com/named-data-ndnSIM/NFD/blob/NFD-0.3.4-ndnSIM/daemon/table/fib-entry.hpp#L62-L63</a></div><div><br></div><div>Finally, you will use the next-hop API to get the cost of each next hop:</div><div><br></div><div><a href="https://github.com/named-data-ndnSIM/NFD/blob/NFD-0.3.4-ndnSIM/daemon/table/fib-nexthop.hpp#L50-L51" target="_blank">https://github.com/named-data-ndnSIM/NFD/blob/NFD-0.3.4-ndnSIM/daemon/table/fib-nexthop.hpp#L50-L51</a> </div><div><br></div><div>Hope that this helps,</div><div><br><div>
<div><div><div><span style="float:none;display:inline!important">Spyridon (Spyros) Mastorakis</span><br><span style="float:none;display:inline!important">Personal Website: </span><a href="http://cs.ucla.edu/~mastorakis/" target="_blank">http://cs.ucla.edu/~mastorakis/</a><br><span style="float:none;display:inline!important">Internet Research Laboratory</span><br><span style="float:none;display:inline!important">Computer Science Department</span><br><span style="float:none;display:inline!important">UCLA</span></div><div><br></div></div></div></div><div><div class="h5"><div><blockquote type="cite"><div>On May 22, 2016, at 6:17 AM, Muhammad Hosain Abdollahi Sabet <<a href="mailto:mhasabet@gmail.com" target="_blank">mhasabet@gmail.com</a>> wrote:</div><br><div><div dir="ltr"><div class="gmail_default" style="font-family:tahoma,sans-serif"><font face="tahoma, sans-serif">Hi everyone,</font></div><div class="gmail_default" style="font-family:tahoma,sans-serif"><br></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></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></div></div></div></div></blockquote></div><br></div>