summaryrefslogtreecommitdiffstats
path: root/ip/nh_common.h
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 14:18:53 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 14:18:53 +0000
commita0e0018c9a7ef5ce7f6d2c3ae16aecbbd16a8f67 (patch)
tree8feaf1a1932871b139b3b30be4c09c66489918be /ip/nh_common.h
parentInitial commit. (diff)
downloadiproute2-upstream/6.1.0.tar.xz
iproute2-upstream/6.1.0.zip
Adding upstream version 6.1.0.upstream/6.1.0upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'ip/nh_common.h')
-rw-r--r--ip/nh_common.h53
1 files changed, 53 insertions, 0 deletions
diff --git a/ip/nh_common.h b/ip/nh_common.h
new file mode 100644
index 0000000..4d6677e
--- /dev/null
+++ b/ip/nh_common.h
@@ -0,0 +1,53 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+#ifndef __NH_COMMON_H__
+#define __NH_COMMON_H__ 1
+
+#include <list.h>
+
+#define NH_CACHE_SIZE 1024
+
+struct nha_res_grp {
+ __u16 buckets;
+ __u32 idle_timer;
+ __u32 unbalanced_timer;
+ __u64 unbalanced_time;
+};
+
+struct nh_entry {
+ struct hlist_node nh_hash;
+
+ __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;
+};
+
+void print_cache_nexthop_id(FILE *fp, const char *fp_prefix, const char *jsobj,
+ __u32 nh_id);
+int print_cache_nexthop(struct nlmsghdr *n, void *arg, bool process_cache);
+
+#endif /* __NH_COMMON_H__ */