| 1239 | } |
| 1240 | |
| 1241 | static void |
| 1242 | rt_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. |
no test coverage detected