Searched refs:rtnh (Results 1 – 7 of 7) sorted by relevance
| /linux-6.15/include/net/ |
| H A 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-6.15/net/ipv4/ |
| H A D | fib_semantics.c | 693 rtnh = rtnh_next(rtnh, &remaining); in fib_count_nexthops() 797 rtnh = rtnh_next(rtnh, &remaining); in fib_get_nhs() 910 struct rtnexthop *rtnh; in fib_nh_match() local 963 rtnh = cfg->fc_mp; in fib_nh_match() 972 if (rtnh->rtnh_ifindex && rtnh->rtnh_ifindex != nh->fib_nh_oif) in fib_nh_match() 1033 rtnh = rtnh_next(rtnh, &remaining); in fib_nh_match() 1660 struct rtnexthop *rtnh; in fib_add_nexthop() local 1663 rtnh = nla_reserve_nohdr(skb, sizeof(*rtnh)); in fib_add_nexthop() 1664 if (!rtnh) in fib_add_nexthop() 1673 rtnh->rtnh_flags = flags; in fib_add_nexthop() [all …]
|
| H A D | ipmr.c | 2662 struct rtnexthop *rtnh = nla_data(nla); in ipmr_nla_get_ttls() local 2665 while (rtnh_ok(rtnh, remaining)) { in ipmr_nla_get_ttls() 2666 mfcc->mfcc_ttls[vifi] = rtnh->rtnh_hops; in ipmr_nla_get_ttls() 2669 rtnh = rtnh_next(rtnh, &remaining); in ipmr_nla_get_ttls()
|
| /linux-6.15/include/uapi/linux/ |
| H A D | rtnetlink.h | 443 #define RTNH_OK(rtnh,len) ((rtnh)->rtnh_len >= sizeof(struct rtnexthop) && \ argument 444 ((int)(rtnh)->rtnh_len) <= (len)) 445 #define RTNH_NEXT(rtnh) ((struct rtnexthop*)(((char*)(rtnh)) + RTNH_ALIGN((rtnh)->rtnh_len))) argument 448 #define RTNH_DATA(rtnh) ((struct rtattr*)(((char*)(rtnh)) + RTNH_LENGTH(0))) argument
|
| /linux-6.15/net/core/ |
| H A D | lwtunnel.c | 192 struct rtnexthop *rtnh = (struct rtnexthop *)attr; in lwtunnel_valid_encap_type_attr() local 198 while (rtnh_ok(rtnh, remaining)) { in lwtunnel_valid_encap_type_attr() 199 attrlen = rtnh_attrlen(rtnh); in lwtunnel_valid_encap_type_attr() 201 attrs = rtnh_attrs(rtnh); in lwtunnel_valid_encap_type_attr() 217 rtnh = rtnh_next(rtnh, &remaining); in lwtunnel_valid_encap_type_attr()
|
| /linux-6.15/net/mpls/ |
| H A D | af_mpls.c | 846 while (rtnh_ok(rtnh, remaining)) { in mpls_count_nexthops() 851 attrlen = rtnh_attrlen(rtnh); in mpls_count_nexthops() 878 rtnh = rtnh_next(rtnh, &remaining); in mpls_count_nexthops() 902 if (!rtnh_ok(rtnh, remaining)) in mpls_nh_build_multi() 908 if (rtnh->rtnh_hops || rtnh->rtnh_flags) in mpls_nh_build_multi() 911 attrlen = rtnh_attrlen(rtnh); in mpls_nh_build_multi() 928 rtnh = rtnh_next(rtnh, &remaining); in mpls_nh_build_multi() 2023 struct rtnexthop *rtnh; in mpls_dump_route() local 2037 rtnh = nla_reserve_nohdr(skb, sizeof(*rtnh)); in mpls_dump_route() 2038 if (!rtnh) in mpls_dump_route() [all …]
|
| /linux-6.15/net/ipv6/ |
| H A D | route.c | 5309 struct rtnexthop *rtnh; in ip6_route_multipath_add() local 5327 rtnh = (struct rtnexthop *)cfg->fc_mp; in ip6_route_multipath_add() 5332 while (rtnh_ok(rtnh, remaining)) { in ip6_route_multipath_add() 5334 if (rtnh->rtnh_ifindex) in ip6_route_multipath_add() 5337 attrlen = rtnh_attrlen(rtnh); in ip6_route_multipath_add() 5384 rtnh = rtnh_next(rtnh, &remaining); in ip6_route_multipath_add() 5493 struct rtnexthop *rtnh; in ip6_route_multipath_del() local 5503 while (rtnh_ok(rtnh, remaining)) { in ip6_route_multipath_del() 5505 if (rtnh->rtnh_ifindex) in ip6_route_multipath_del() 5508 attrlen = rtnh_attrlen(rtnh); in ip6_route_multipath_del() [all …]
|