Lines Matching defs:nh
80 struct rtnl_nexthop *nh, *tmp;
89 nl_list_for_each_entry_safe(nh, tmp, &r->rt_nexthops, rtnh_list) {
90 rtnl_route_remove_nexthop(r, nh);
91 rtnl_route_nh_free(nh);
99 struct rtnl_nexthop *nh, *new;
114 nl_list_for_each_entry(nh, &src->rt_nexthops, rtnh_list) {
115 new = rtnl_route_nh_clone(nh);
160 struct rtnl_nexthop *nh;
162 nl_list_for_each_entry(nh, &r->rt_nexthops, rtnh_list) {
164 rtnl_route_nh_dump(nh, p);
247 struct rtnl_nexthop *nh;
249 nl_list_for_each_entry(nh, &r->rt_nexthops, rtnh_list) {
252 rtnl_route_nh_dump(nh, p);
344 struct rtnl_nexthop *nh;
350 nl_list_for_each_entry(nh, &route->rt_nexthops, rtnh_list) {
352 rtnl_route_nh_dump(nh, p);
409 /* search for a dup in each nh of a */
422 /* search for a dup in each nh of b, covers case where a has
746 void rtnl_route_add_nexthop(struct rtnl_route *route, struct rtnl_nexthop *nh)
748 nl_list_add_tail(&nh->rtnh_list, &route->rt_nexthops);
753 void rtnl_route_remove_nexthop(struct rtnl_route *route, struct rtnl_nexthop *nh)
756 nl_list_del(&nh->rtnh_list);
773 struct rtnl_nexthop *nh;
776 nl_list_for_each_entry(nh, &r->rt_nexthops, rtnh_list) {
777 cb(nh, arg);
784 struct rtnl_nexthop *nh;
789 nl_list_for_each_entry(nh, &r->rt_nexthops, rtnh_list) {
790 if (i == n) return nh;
823 struct rtnl_nexthop *nh;
829 nl_list_for_each_entry(nh, &route->rt_nexthops, rtnh_list) {
830 if (nh->rtnh_gateway)
852 struct rtnl_nexthop *nh = NULL;
858 nh = rtnl_route_nh_alloc();
859 if (!nh)
862 rtnl_route_nh_set_weight(nh, rtnh->rtnh_hops);
863 rtnl_route_nh_set_ifindex(nh, rtnh->rtnh_ifindex);
864 rtnl_route_nh_set_flags(nh, rtnh->rtnh_flags);
886 rtnl_route_nh_set_gateway(nh, addr);
894 rtnl_route_nh_set_realms(nh, realms);
898 rtnl_route_add_nexthop(route, nh);
905 if (err && nh)
906 rtnl_route_nh_free(nh);
1141 struct rtnl_nexthop *nh;
1146 nl_list_for_each_entry(nh, &route->rt_nexthops, rtnh_list) {
1153 rtnh->rtnh_flags = nh->rtnh_flags;
1154 rtnh->rtnh_hops = nh->rtnh_weight;
1155 rtnh->rtnh_ifindex = nh->rtnh_ifindex;
1157 if (nh->rtnh_gateway)
1159 nh->rtnh_gateway);
1161 if (nh->rtnh_realms)
1162 NLA_PUT_U32(msg, RTA_FLOW, nh->rtnh_realms);