Changeset View
Changeset View
Standalone View
Standalone View
sys/net/rtsock.c
Show First 20 Lines • Show All 1,287 Lines • ▼ Show 20 Lines | rt_getmetrics(const struct rtentry *rt, const struct nhop_object *nh, | ||||
struct rt_metrics *out) | struct rt_metrics *out) | ||||
{ | { | ||||
bzero(out, sizeof(*out)); | bzero(out, sizeof(*out)); | ||||
out->rmx_mtu = nh->nh_mtu; | out->rmx_mtu = nh->nh_mtu; | ||||
out->rmx_weight = rt->rt_weight; | out->rmx_weight = rt->rt_weight; | ||||
out->rmx_nhidx = nhop_get_idx(nh); | out->rmx_nhidx = nhop_get_idx(nh); | ||||
/* Kernel -> userland timebase conversion. */ | /* Kernel -> userland timebase conversion. */ | ||||
out->rmx_expire = rt->rt_expire ? | out->rmx_expire = nhop_get_expire(nh) ? | ||||
rt->rt_expire - time_uptime + time_second : 0; | nhop_get_expire(nh) - time_uptime + time_second : 0; | ||||
} | } | ||||
/* | /* | ||||
* Extract the addresses of the passed sockaddrs. | * Extract the addresses of the passed sockaddrs. | ||||
* Do a little sanity checking so as to avoid bad memory references. | * Do a little sanity checking so as to avoid bad memory references. | ||||
* This data is derived straight from userland. | * This data is derived straight from userland. | ||||
*/ | */ | ||||
static int | static int | ||||
▲ Show 20 Lines • Show All 1,429 Lines • Show Last 20 Lines |