MCPcopy Create free account
hub / github.com/F-Stack/f-stack / lookup_prefix

Function lookup_prefix

freebsd/net/route/route_ctl.c:520–530  ·  view source on GitHub ↗

* Runs exact prefix match based on dst/netmask from @info. * Assumes RIB lock is held. * Returns matched @rtentry if found or NULL. * If rtentry was found, saves nexthop / weight value into @rnd. */

Source from the content-addressed store, hash-verified

518 * If rtentry was found, saves nexthop / weight value into @rnd.
519 */
520struct rtentry *
521lookup_prefix(struct rib_head *rnh, const struct rt_addrinfo *info,
522 struct route_nhop_data *rnd)
523{
524 struct rtentry *rt;
525
526 rt = lookup_prefix_bysa(rnh, info->rti_info[RTAX_DST],
527 info->rti_info[RTAX_NETMASK], rnd);
528
529 return (rt);
530}
531
532/*
533 * Adds route defined by @info into the kernel table specified by @fibnum and

Callers 3

add_route_mpathFunction · 0.85
add_routeFunction · 0.85
rt_unlinkrteFunction · 0.85

Calls 1

lookup_prefix_bysaFunction · 0.85

Tested by

no test coverage detected