Lines Matching refs:rtnh
645 static int fib_count_nexthops(struct rtnexthop *rtnh, int remaining, in fib_count_nexthops() argument
650 while (rtnh_ok(rtnh, remaining)) { in fib_count_nexthops()
652 rtnh = rtnh_next(rtnh, &remaining); in fib_count_nexthops()
679 static int fib_get_nhs(struct fib_info *fi, struct rtnexthop *rtnh, in fib_get_nhs() argument
693 if (!rtnh_ok(rtnh, remaining)) { in fib_get_nhs()
699 if (rtnh->rtnh_flags & (RTNH_F_DEAD | RTNH_F_LINKDOWN)) { in fib_get_nhs()
705 fib_cfg.fc_flags = (cfg->fc_flags & ~0xFF) | rtnh->rtnh_flags; in fib_get_nhs()
706 fib_cfg.fc_oif = rtnh->rtnh_ifindex; in fib_get_nhs()
708 attrlen = rtnh_attrlen(rtnh); in fib_get_nhs()
710 struct nlattr *nla, *nlav, *attrs = rtnh_attrs(rtnh); in fib_get_nhs()
752 rtnh->rtnh_hops + 1, extack); in fib_get_nhs()
756 rtnh = rtnh_next(rtnh, &remaining); in fib_get_nhs()
830 static int fib_get_nhs(struct fib_info *fi, struct rtnexthop *rtnh, in fib_get_nhs() argument
869 struct rtnexthop *rtnh; in fib_nh_match() local
915 rtnh = cfg->fc_mp; in fib_nh_match()
921 if (!rtnh_ok(rtnh, remaining)) in fib_nh_match()
924 if (rtnh->rtnh_ifindex && rtnh->rtnh_ifindex != nh->fib_nh_oif) in fib_nh_match()
927 attrlen = rtnh_attrlen(rtnh); in fib_nh_match()
929 struct nlattr *nla, *nlav, *attrs = rtnh_attrs(rtnh); in fib_nh_match()
985 rtnh = rtnh_next(rtnh, &remaining); in fib_nh_match()
1704 struct rtnexthop *rtnh; in fib_add_nexthop() local
1707 rtnh = nla_reserve_nohdr(skb, sizeof(*rtnh)); in fib_add_nexthop()
1708 if (!rtnh) in fib_add_nexthop()
1711 rtnh->rtnh_hops = nh_weight - 1; in fib_add_nexthop()
1712 rtnh->rtnh_ifindex = dev ? dev->ifindex : 0; in fib_add_nexthop()
1717 rtnh->rtnh_flags = flags; in fib_add_nexthop()
1723 rtnh->rtnh_len = nlmsg_get_pos(skb) - (void *)rtnh; in fib_add_nexthop()