Lines Matching full:nh

101 static int nhop_get_prio(const struct nhop_object *nh);
191 nhop_can_multipath(const struct nhop_object *nh) in nhop_can_multipath() argument
194 if ((nh->nh_flags & NHF_MULTIPATH) != 0) in nhop_can_multipath()
196 if ((nh->nh_flags & NHF_GATEWAY) == 0) in nhop_can_multipath()
198 if ((nh->nh_flags & NHF_REDIRECT) != 0) in nhop_can_multipath()
238 nhop_get_prio(const struct nhop_object *nh) in nhop_get_prio() argument
240 if (NH_IS_PINNED(nh)) in nhop_get_prio()
246 * Check if specified @gw matches gw data in the nexthop @nh.
251 match_nhop_gw(const struct nhop_object *nh, const struct sockaddr *gw) in match_nhop_gw() argument
254 if (nh->gw_sa.sa_family != gw->sa_family) in match_nhop_gw()
259 return (nh->gw4_sa.sin_addr.s_addr == in match_nhop_gw()
271 if (IN6_ARE_ADDR_EQUAL(&nh->gw6_sa.sin6_addr, in match_nhop_gw()
280 return (nh->gwl_sa.sdl_index == sdl->sdl_index); in match_nhop_gw()
283 return (memcmp(&nh->gw_sa, gw, nh->gw_sa.sa_len) == 0); in match_nhop_gw()
295 rib_match_gw(const struct rtentry *rt, const struct nhop_object *nh, void *gw_sa) in rib_match_gw() argument
299 return (match_nhop_gw(nh, gw)); in rib_match_gw()
311 match_gw_one(const struct rtentry *rt, const struct nhop_object *nh, void *_data) in match_gw_one() argument
316 if (match_nhop_gw(nh, gwd->gw) && gwd->count++ == 0) in match_gw_one()
322 * Checks if data in @info matches nexhop @nh.
330 const struct nhop_object *nh) in check_info_match_nhop() argument
335 if (info->rti_filter(rt, nh, info->rti_filterdata) == 0) in check_info_match_nhop()
340 if ((gw != NULL) && !match_nhop_gw(nh, gw)) in check_info_match_nhop()
644 struct nhop_object *nh = nhop_alloc(rh_dst->rib_fibnum, rh_dst->rib_family); in rib_copy_route() local
645 if (nh == NULL) { in rib_copy_route()
649 nhop_copy(nh, rnd_src->rnd_nhop); in rib_copy_route()
650 nhop_set_origin(nh, nhop_get_origin(rnd_src->rnd_nhop)); in rib_copy_route()
651 nhop_set_fibnum(nh, rh_dst->rib_fibnum); in rib_copy_route()
652 nh = nhop_get_nhop_internal(rh_dst, nh, &error); in rib_copy_route()
662 nhop_free(nh); in rib_copy_route()
667 .rnd_nhop = nh, in rib_copy_route()
670 int op_flags = RTM_F_CREATE | (NH_IS_PINNED(nh) ? RTM_F_FORCE : 0); in rib_copy_route()
680 nhop_free(nh); in rib_copy_route()
730 struct nhop_object *nh; in add_route_byinfo() local
765 error = nhop_create_from_info(rnh, info, &nh); in add_route_byinfo()
771 rnd_add.rnd_nhop = nh; in add_route_byinfo()
791 struct nhop_object *nh; in add_route_flags() local
797 nh = rnd_add->rnd_nhop; in add_route_flags()
831 nh = rc->rc_nh_old; in add_route_flags()
866 nhop_free_any(nh); in add_route_flags()
1009 struct nhop_object *nh = rt->rt_nhop; in rt_delete_conditional() local
1012 if (NH_IS_NHGRP(nh)) { in rt_delete_conditional()
1013 struct nhgrp_object *nhg = (struct nhgrp_object *)nh; in rt_delete_conditional()
1031 if (cb != NULL && !cb(rt, nh, cbdata)) in rt_delete_conditional()
1034 if (prio < nhop_get_prio(nh)) in rt_delete_conditional()
1147 if (check_info_match_nhop(info, NULL, wn[i].nh) == 0) { in change_mpath_route()
1148 nh_orig = wn[i].nh; in change_mpath_route()
1169 wn_new[found_idx].nh = nh_new; in change_mpath_route()
1479 struct nhop_object *nh; in rib_walk_del() local
1506 nh = rt->rt_nhop; in rib_walk_del()
1509 di.rc.rc_nh_old = nh; in rib_walk_del()
1517 if (NH_IS_NHGRP(nh)) { in rib_walk_del()
1518 nhg = (struct nhgrp_object *)nh; in rib_walk_del()
1521 rt_routemsg(RTM_DELETE, rt, wn[i].nh, fibnum); in rib_walk_del()
1524 rt_routemsg(RTM_DELETE, rt, nh, fibnum); in rib_walk_del()