]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
ip: nexthop: add nh entry structure
authorNikolay Aleksandrov <nikolay@nvidia.com>
Thu, 30 Sep 2021 11:38:37 +0000 (14:38 +0300)
committerDavid Ahern <dsahern@kernel.org>
Mon, 4 Oct 2021 00:24:24 +0000 (18:24 -0600)
Add a structure which describes a nexthop, it will be later used to
parse, print and cache nexthops.

Signed-off-by: Nikolay Aleksandrov <nikolay@nvidia.com>
Signed-off-by: David Ahern <dsahern@kernel.org>
ip/nh_common.h

index f747244cbcd0ec57807ed8257c841fdacf553443..d9730f45c6fb97e774a28ab4b153d8d22668d774 100644 (file)
@@ -9,4 +9,35 @@ struct nha_res_grp {
        __u64                   unbalanced_time;
 };
 
+struct nh_entry {
+       __u32                   nh_id;
+       __u32                   nh_oif;
+       __u32                   nh_flags;
+       __u16                   nh_grp_type;
+       __u8                    nh_family;
+       __u8                    nh_scope;
+       __u8                    nh_protocol;
+
+       bool                    nh_blackhole;
+       bool                    nh_fdb;
+
+       int                     nh_gateway_len;
+       union {
+               __be32          ipv4;
+               struct in6_addr ipv6;
+       }                       nh_gateway;
+
+       struct rtattr           *nh_encap;
+       union {
+               struct rtattr   rta;
+               __u8            _buf[RTA_LENGTH(sizeof(__u16))];
+       }                       nh_encap_type;
+
+       bool                    nh_has_res_grp;
+       struct nha_res_grp      nh_res_grp;
+
+       int                     nh_groups_cnt;
+       struct nexthop_grp      *nh_groups;
+};
+
 #endif /* __NH_COMMON_H__ */