Searched refs:rtnh (Results 1 – 5 of 5) sorted by relevance
/linux-4.4.14/include/net/ |
D | nexthop.h | 7 static inline int rtnh_ok(const struct rtnexthop *rtnh, int remaining) in rtnh_ok() argument 9 return remaining >= sizeof(*rtnh) && in rtnh_ok() 10 rtnh->rtnh_len >= sizeof(*rtnh) && in rtnh_ok() 11 rtnh->rtnh_len <= remaining; in rtnh_ok() 14 static inline struct rtnexthop *rtnh_next(const struct rtnexthop *rtnh, in rtnh_next() argument 17 int totlen = NLA_ALIGN(rtnh->rtnh_len); in rtnh_next() 20 return (struct rtnexthop *) ((char *) rtnh + totlen); in rtnh_next() 23 static inline struct nlattr *rtnh_attrs(const struct rtnexthop *rtnh) in rtnh_attrs() argument 25 return (struct nlattr *) ((char *) rtnh + NLA_ALIGN(sizeof(*rtnh))); in rtnh_attrs() 28 static inline int rtnh_attrlen(const struct rtnexthop *rtnh) in rtnh_attrlen() argument [all …]
|
/linux-4.4.14/net/ipv4/ |
D | fib_semantics.c | 457 static int fib_count_nexthops(struct rtnexthop *rtnh, int remaining) in fib_count_nexthops() argument 461 while (rtnh_ok(rtnh, remaining)) { in fib_count_nexthops() 463 rtnh = rtnh_next(rtnh, &remaining); in fib_count_nexthops() 470 static int fib_get_nhs(struct fib_info *fi, struct rtnexthop *rtnh, in fib_get_nhs() argument 479 if (!rtnh_ok(rtnh, remaining)) in fib_get_nhs() 483 (cfg->fc_flags & ~0xFF) | rtnh->rtnh_flags; in fib_get_nhs() 484 nexthop_nh->nh_oif = rtnh->rtnh_ifindex; in fib_get_nhs() 485 nexthop_nh->nh_weight = rtnh->rtnh_hops + 1; in fib_get_nhs() 487 attrlen = rtnh_attrlen(rtnh); in fib_get_nhs() 489 struct nlattr *nla, *attrs = rtnh_attrs(rtnh); in fib_get_nhs() [all …]
|
/linux-4.4.14/include/uapi/linux/ |
D | rtnetlink.h | 352 #define RTNH_OK(rtnh,len) ((rtnh)->rtnh_len >= sizeof(struct rtnexthop) && \ argument 353 ((int)(rtnh)->rtnh_len) <= (len)) 354 #define RTNH_NEXT(rtnh) ((struct rtnexthop*)(((char*)(rtnh)) + RTNH_ALIGN((rtnh)->rtnh_len))) argument 357 #define RTNH_DATA(rtnh) ((struct rtattr*)(((char*)(rtnh)) + RTNH_LENGTH(0))) argument
|
/linux-4.4.14/net/mpls/ |
D | af_mpls.c | 629 static int mpls_count_nexthops(struct rtnexthop *rtnh, int len, in mpls_count_nexthops() argument 635 if (!rtnh) { in mpls_count_nexthops() 642 while (rtnh_ok(rtnh, remaining)) { in mpls_count_nexthops() 643 struct nlattr *nla, *attrs = rtnh_attrs(rtnh); in mpls_count_nexthops() 646 attrlen = rtnh_attrlen(rtnh); in mpls_count_nexthops() 659 rtnh = rtnh_next(rtnh, &remaining); in mpls_count_nexthops() 669 struct rtnexthop *rtnh = cfg->rc_mp; in mpls_nh_build_multi() local 682 if (!rtnh_ok(rtnh, remaining)) in mpls_nh_build_multi() 688 if (rtnh->rtnh_hops || rtnh->rtnh_flags) in mpls_nh_build_multi() 691 attrlen = rtnh_attrlen(rtnh); in mpls_nh_build_multi() [all …]
|
/linux-4.4.14/net/ipv6/ |
D | route.c | 2830 struct rt6_info *rtnh; in ip6_route_info_append() local 2835 rtnh = nh->rt6_info; in ip6_route_info_append() 2837 if (rtnh->dst.dev == rt->dst.dev && in ip6_route_info_append() 2838 rtnh->rt6i_idev == rt->rt6i_idev && in ip6_route_info_append() 2839 ipv6_addr_equal(&rtnh->rt6i_gateway, in ip6_route_info_append() 2862 struct rtnexthop *rtnh; in ip6_route_multipath_add() local 2875 rtnh = (struct rtnexthop *)cfg->fc_mp; in ip6_route_multipath_add() 2880 while (rtnh_ok(rtnh, remaining)) { in ip6_route_multipath_add() 2882 if (rtnh->rtnh_ifindex) in ip6_route_multipath_add() 2883 r_cfg.fc_ifindex = rtnh->rtnh_ifindex; in ip6_route_multipath_add() [all …]
|