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

Function rt_getmetrics

freebsd/net/rtsock.c:1241–1253  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1239}
1240
1241static void
1242rt_getmetrics(const struct rtentry *rt, const struct nhop_object *nh,
1243 struct rt_metrics *out)
1244{
1245
1246 bzero(out, sizeof(*out));
1247 out->rmx_mtu = nh->nh_mtu;
1248 out->rmx_weight = rt->rt_weight;
1249 out->rmx_nhidx = nhop_get_idx(nh);
1250 /* Kernel -> userland timebase conversion. */
1251 out->rmx_expire = rt->rt_expire ?
1252 rt->rt_expire - time_uptime + time_second : 0;
1253}
1254
1255/*
1256 * Extract the addresses of the passed sockaddrs.

Callers 2

update_rtm_from_rcFunction · 0.70
sysctl_dumpnhopFunction · 0.70

Calls 2

bzeroFunction · 0.85
nhop_get_idxFunction · 0.85

Tested by

no test coverage detected