Searched refs:rtnh (Results 1 – 7 of 7) sorted by relevance
/Linux-v5.4/include/net/ |
D | rtnh.h | 8 static inline int rtnh_ok(const struct rtnexthop *rtnh, int remaining) in rtnh_ok() argument 10 return remaining >= (int)sizeof(*rtnh) && in rtnh_ok() 11 rtnh->rtnh_len >= sizeof(*rtnh) && in rtnh_ok() 12 rtnh->rtnh_len <= remaining; in rtnh_ok() 15 static inline struct rtnexthop *rtnh_next(const struct rtnexthop *rtnh, in rtnh_next() argument 18 int totlen = NLA_ALIGN(rtnh->rtnh_len); in rtnh_next() 21 return (struct rtnexthop *) ((char *) rtnh + totlen); in rtnh_next() 24 static inline struct nlattr *rtnh_attrs(const struct rtnexthop *rtnh) in rtnh_attrs() argument 26 return (struct nlattr *) ((char *) rtnh + NLA_ALIGN(sizeof(*rtnh))); in rtnh_attrs() 29 static inline int rtnh_attrlen(const struct rtnexthop *rtnh) in rtnh_attrlen() argument [all …]
|
/Linux-v5.4/net/ipv4/ |
D | fib_semantics.c | 637 static int fib_count_nexthops(struct rtnexthop *rtnh, int remaining, in fib_count_nexthops() argument 642 while (rtnh_ok(rtnh, remaining)) { in fib_count_nexthops() 644 rtnh = rtnh_next(rtnh, &remaining); in fib_count_nexthops() 658 static int fib_get_nhs(struct fib_info *fi, struct rtnexthop *rtnh, in fib_get_nhs() argument 672 if (!rtnh_ok(rtnh, remaining)) { in fib_get_nhs() 678 if (rtnh->rtnh_flags & (RTNH_F_DEAD | RTNH_F_LINKDOWN)) { in fib_get_nhs() 684 fib_cfg.fc_flags = (cfg->fc_flags & ~0xFF) | rtnh->rtnh_flags; in fib_get_nhs() 685 fib_cfg.fc_oif = rtnh->rtnh_ifindex; in fib_get_nhs() 687 attrlen = rtnh_attrlen(rtnh); in fib_get_nhs() 689 struct nlattr *nla, *nlav, *attrs = rtnh_attrs(rtnh); in fib_get_nhs() [all …]
|
D | ipmr.c | 2647 struct rtnexthop *rtnh = nla_data(nla); in ipmr_nla_get_ttls() local 2650 while (rtnh_ok(rtnh, remaining)) { in ipmr_nla_get_ttls() 2651 mfcc->mfcc_ttls[vifi] = rtnh->rtnh_hops; in ipmr_nla_get_ttls() 2654 rtnh = rtnh_next(rtnh, &remaining); in ipmr_nla_get_ttls()
|
/Linux-v5.4/include/uapi/linux/ |
D | rtnetlink.h | 392 #define RTNH_OK(rtnh,len) ((rtnh)->rtnh_len >= sizeof(struct rtnexthop) && \ argument 393 ((int)(rtnh)->rtnh_len) <= (len)) 394 #define RTNH_NEXT(rtnh) ((struct rtnexthop*)(((char*)(rtnh)) + RTNH_ALIGN((rtnh)->rtnh_len))) argument 397 #define RTNH_DATA(rtnh) ((struct rtattr*)(((char*)(rtnh)) + RTNH_LENGTH(0))) argument
|
/Linux-v5.4/net/core/ |
D | lwtunnel.c | 180 struct rtnexthop *rtnh = (struct rtnexthop *)attr; in lwtunnel_valid_encap_type_attr() local 186 while (rtnh_ok(rtnh, remaining)) { in lwtunnel_valid_encap_type_attr() 187 attrlen = rtnh_attrlen(rtnh); in lwtunnel_valid_encap_type_attr() 189 attrs = rtnh_attrs(rtnh); in lwtunnel_valid_encap_type_attr() 200 rtnh = rtnh_next(rtnh, &remaining); in lwtunnel_valid_encap_type_attr()
|
/Linux-v5.4/net/mpls/ |
D | af_mpls.c | 834 static u8 mpls_count_nexthops(struct rtnexthop *rtnh, int len, in mpls_count_nexthops() argument 844 while (rtnh_ok(rtnh, remaining)) { in mpls_count_nexthops() 845 struct nlattr *nla, *attrs = rtnh_attrs(rtnh); in mpls_count_nexthops() 849 attrlen = rtnh_attrlen(rtnh); in mpls_count_nexthops() 876 rtnh = rtnh_next(rtnh, &remaining); in mpls_count_nexthops() 887 struct rtnexthop *rtnh = cfg->rc_mp; in mpls_nh_build_multi() local 900 if (!rtnh_ok(rtnh, remaining)) in mpls_nh_build_multi() 906 if (rtnh->rtnh_hops || rtnh->rtnh_flags) in mpls_nh_build_multi() 909 attrlen = rtnh_attrlen(rtnh); in mpls_nh_build_multi() 911 struct nlattr *attrs = rtnh_attrs(rtnh); in mpls_nh_build_multi() [all …]
|
/Linux-v5.4/net/ipv6/ |
D | route.c | 5030 struct rtnexthop *rtnh; in ip6_route_multipath_add() local 5048 rtnh = (struct rtnexthop *)cfg->fc_mp; in ip6_route_multipath_add() 5053 while (rtnh_ok(rtnh, remaining)) { in ip6_route_multipath_add() 5055 if (rtnh->rtnh_ifindex) in ip6_route_multipath_add() 5056 r_cfg.fc_ifindex = rtnh->rtnh_ifindex; in ip6_route_multipath_add() 5058 attrlen = rtnh_attrlen(rtnh); in ip6_route_multipath_add() 5060 struct nlattr *nla, *attrs = rtnh_attrs(rtnh); in ip6_route_multipath_add() 5073 r_cfg.fc_flags |= (rtnh->rtnh_flags & RTNH_F_ONLINK); in ip6_route_multipath_add() 5088 rt->fib6_nh->fib_nh_weight = rtnh->rtnh_hops + 1; in ip6_route_multipath_add() 5097 rtnh = rtnh_next(rtnh, &remaining); in ip6_route_multipath_add() [all …]
|