<div dir="ltr">Thank you <span style="font-size:12.8px">Matthieu! Precise and super fast answer :) </span></div><div class="gmail_extra"><br><div class="gmail_quote">2016-11-21 18:07 GMT+01:00 Matthieu Boutier <span dir="ltr"><<a href="mailto:boutier@pps.univ-paris-diderot.fr" target="_blank">boutier@pps.univ-paris-diderot.fr</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Lorenzo,<br>
<span class=""><br>
> Is this the right place where to ask?<br>
<br>
</span>Yes.<br>
<span class=""><br>
> how to get the routing table entry matching a given prefix...<br>
<br>
</span>You must iterate over all the routing entries with "route streams" and search the one you want (or write your own function).  For example:<br>
<br>
    struct babel_route *rt = NULL;<br>
    struct route_stream *stream = NULL;<br>
    stream = route_stream(ROUTE_INSTALLED); /* or _ALL, or _SS_INSTALLED */<br>
    while(1) {<br>
        rt = route_stream_next(stream);<br>
        if(rt == NULL) break;<br>
        /* your code */<br>
        min = min_route(rt, min);<br>
    }<br>
    route_stream_done(stream);<br>
<br>
To compare prefixes, you can use prefix_cmp from util.h.  For your use case, it should be:<br>
<br>
if(prefix_cmp(rt->src->prefix, rt->src->plen, prefix, plen) == PST_MORE_SPECIFIC)) {<br>
    /* the RIB entry is more specific than my <prefix,plen> prefix*/<br>
}<br>
<br>
Best regards,<br>
Matthieu<br>
<br>
</blockquote></div><br></div>