Home
last modified time | relevance | path

Searched refs:rtnh (Results 1 – 8 of 8) sorted by relevance

/openbmc/linux/include/net/
H A Drtnh.h8 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 …]
/openbmc/linux/net/ipv4/
H A Dfib_semantics.c657 static int fib_count_nexthops(struct rtnexthop *rtnh, int remaining, in fib_count_nexthops() argument
662 while (rtnh_ok(rtnh, remaining)) { in fib_count_nexthops()
664 rtnh = rtnh_next(rtnh, &remaining); in fib_count_nexthops()
691 static int fib_get_nhs(struct fib_info *fi, struct rtnexthop *rtnh, in fib_get_nhs() argument
705 if (!rtnh_ok(rtnh, remaining)) { in fib_get_nhs()
711 if (rtnh->rtnh_flags & (RTNH_F_DEAD | RTNH_F_LINKDOWN)) { in fib_get_nhs()
717 fib_cfg.fc_flags = (cfg->fc_flags & ~0xFF) | rtnh->rtnh_flags; in fib_get_nhs()
718 fib_cfg.fc_oif = rtnh->rtnh_ifindex; in fib_get_nhs()
720 attrlen = rtnh_attrlen(rtnh); in fib_get_nhs()
722 struct nlattr *nla, *nlav, *attrs = rtnh_attrs(rtnh); in fib_get_nhs()
[all …]
H A Dipmr.c2656 struct rtnexthop *rtnh = nla_data(nla); in ipmr_nla_get_ttls() local
2659 while (rtnh_ok(rtnh, remaining)) { in ipmr_nla_get_ttls()
2660 mfcc->mfcc_ttls[vifi] = rtnh->rtnh_hops; in ipmr_nla_get_ttls()
2663 rtnh = rtnh_next(rtnh, &remaining); in ipmr_nla_get_ttls()
/openbmc/linux/include/uapi/linux/
H A Drtnetlink.h433 #define RTNH_OK(rtnh,len) ((rtnh)->rtnh_len >= sizeof(struct rtnexthop) && \ argument
434 ((int)(rtnh)->rtnh_len) <= (len))
435 #define RTNH_NEXT(rtnh) ((struct rtnexthop*)(((char*)(rtnh)) + RTNH_ALIGN((rtnh)->rtnh_len))) argument
438 #define RTNH_DATA(rtnh) ((struct rtattr*)(((char*)(rtnh)) + RTNH_LENGTH(0))) argument
/openbmc/linux/net/core/
H A Dlwtunnel.c190 struct rtnexthop *rtnh = (struct rtnexthop *)attr; in lwtunnel_valid_encap_type_attr() local
196 while (rtnh_ok(rtnh, remaining)) { in lwtunnel_valid_encap_type_attr()
197 attrlen = rtnh_attrlen(rtnh); in lwtunnel_valid_encap_type_attr()
199 attrs = rtnh_attrs(rtnh); in lwtunnel_valid_encap_type_attr()
214 rtnh = rtnh_next(rtnh, &remaining); in lwtunnel_valid_encap_type_attr()
/openbmc/linux/net/mpls/
H A Daf_mpls.c836 static u8 mpls_count_nexthops(struct rtnexthop *rtnh, int len, in mpls_count_nexthops() argument
846 while (rtnh_ok(rtnh, remaining)) { in mpls_count_nexthops()
847 struct nlattr *nla, *attrs = rtnh_attrs(rtnh); in mpls_count_nexthops()
851 attrlen = rtnh_attrlen(rtnh); in mpls_count_nexthops()
878 rtnh = rtnh_next(rtnh, &remaining); in mpls_count_nexthops()
889 struct rtnexthop *rtnh = cfg->rc_mp; in mpls_nh_build_multi() local
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()
913 struct nlattr *attrs = rtnh_attrs(rtnh); in mpls_nh_build_multi()
[all …]
/openbmc/linux/net/ipv6/
H A Droute.c5244 struct rtnexthop *rtnh; in ip6_route_multipath_add() local
5262 rtnh = (struct rtnexthop *)cfg->fc_mp; in ip6_route_multipath_add()
5267 while (rtnh_ok(rtnh, remaining)) { in ip6_route_multipath_add()
5269 if (rtnh->rtnh_ifindex) in ip6_route_multipath_add()
5270 r_cfg.fc_ifindex = rtnh->rtnh_ifindex; in ip6_route_multipath_add()
5272 attrlen = rtnh_attrlen(rtnh); in ip6_route_multipath_add()
5274 struct nlattr *nla, *attrs = rtnh_attrs(rtnh); in ip6_route_multipath_add()
5295 r_cfg.fc_flags |= (rtnh->rtnh_flags & RTNH_F_ONLINK); in ip6_route_multipath_add()
5310 rt->fib6_nh->fib_nh_weight = rtnh->rtnh_hops + 1; in ip6_route_multipath_add()
5319 rtnh = rtnh_next(rtnh, &remaining); in ip6_route_multipath_add()
[all …]
/openbmc/linux/
H A Dopengrok0.0.log[all...]