Searched refs:rtnh (Results 1 – 4 of 4) sorted by relevance
/linux-4.1.27/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.1.27/net/ipv4/ |
D | fib_semantics.c | 439 static int fib_count_nexthops(struct rtnexthop *rtnh, int remaining) in fib_count_nexthops() argument 443 while (rtnh_ok(rtnh, remaining)) { in fib_count_nexthops() 445 rtnh = rtnh_next(rtnh, &remaining); in fib_count_nexthops() 452 static int fib_get_nhs(struct fib_info *fi, struct rtnexthop *rtnh, in fib_get_nhs() argument 458 if (!rtnh_ok(rtnh, remaining)) in fib_get_nhs() 462 (cfg->fc_flags & ~0xFF) | rtnh->rtnh_flags; in fib_get_nhs() 463 nexthop_nh->nh_oif = rtnh->rtnh_ifindex; in fib_get_nhs() 464 nexthop_nh->nh_weight = rtnh->rtnh_hops + 1; in fib_get_nhs() 466 attrlen = rtnh_attrlen(rtnh); in fib_get_nhs() 468 struct nlattr *nla, *attrs = rtnh_attrs(rtnh); in fib_get_nhs() [all …]
|
/linux-4.1.27/include/uapi/linux/ |
D | rtnetlink.h | 346 #define RTNH_OK(rtnh,len) ((rtnh)->rtnh_len >= sizeof(struct rtnexthop) && \ argument 347 ((int)(rtnh)->rtnh_len) <= (len)) 348 #define RTNH_NEXT(rtnh) ((struct rtnexthop*)(((char*)(rtnh)) + RTNH_ALIGN((rtnh)->rtnh_len))) argument 351 #define RTNH_DATA(rtnh) ((struct rtattr*)(((char*)(rtnh)) + RTNH_LENGTH(0))) argument
|
/linux-4.1.27/net/ipv6/ |
D | route.c | 2542 struct rt6_info *rtnh; in ip6_route_info_append() local 2547 rtnh = nh->rt6_info; in ip6_route_info_append() 2549 if (rtnh->dst.dev == rt->dst.dev && in ip6_route_info_append() 2550 rtnh->rt6i_idev == rt->rt6i_idev && in ip6_route_info_append() 2551 ipv6_addr_equal(&rtnh->rt6i_gateway, in ip6_route_info_append() 2574 struct rtnexthop *rtnh; in ip6_route_multipath_add() local 2587 rtnh = (struct rtnexthop *)cfg->fc_mp; in ip6_route_multipath_add() 2592 while (rtnh_ok(rtnh, remaining)) { in ip6_route_multipath_add() 2594 if (rtnh->rtnh_ifindex) in ip6_route_multipath_add() 2595 r_cfg.fc_ifindex = rtnh->rtnh_ifindex; in ip6_route_multipath_add() [all …]
|