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

Function rt_routemsg

freebsd/net/route.c:718–732  ·  view source on GitHub ↗

* Announce kernel-originated route addition/removal to rtsock based on @rt data. * cmd: RTM_ cmd * @rt: valid rtentry * @nh: nhop object to announce * @fibnum: fib id or RT_ALL_FIBS * * Returns 0 on success. */

Source from the content-addressed store, hash-verified

716 * Returns 0 on success.
717 */
718int
719rt_routemsg(int cmd, struct rtentry *rt, struct nhop_object *nh,
720 int fibnum)
721{
722
723 KASSERT(cmd == RTM_ADD || cmd == RTM_DELETE,
724 ("unexpected cmd %d", cmd));
725
726 KASSERT(fibnum == RT_ALL_FIBS || (fibnum >= 0 && fibnum < rt_numfibs),
727 ("%s: fib out of range 0 <=%d<%d", __func__, fibnum, rt_numfibs));
728
729 KASSERT(rt_key(rt) != NULL, (":%s: rt_key must be supplied", __func__));
730
731 return (rtsock_routemsg(cmd, rt, nh, fibnum));
732}
733
734/*
735 * Announce kernel-originated route addition/removal to rtsock based on @rt data.

Callers 4

defrouter_addreqFunction · 0.85
defrouter_delreqFunction · 0.85
rib_walk_delFunction · 0.85
rib_handle_ifaddr_oneFunction · 0.85

Calls 1

rtsock_routemsgFunction · 0.85

Tested by

no test coverage detected