summaryrefslogtreecommitdiffstats
path: root/zebra/zebra_tc.h
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-09 13:16:35 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-09 13:16:35 +0000
commite2bbf175a2184bd76f6c54ccf8456babeb1a46fc (patch)
treef0b76550d6e6f500ada964a3a4ee933a45e5a6f1 /zebra/zebra_tc.h
parentInitial commit. (diff)
downloadfrr-e2bbf175a2184bd76f6c54ccf8456babeb1a46fc.tar.xz
frr-e2bbf175a2184bd76f6c54ccf8456babeb1a46fc.zip
Adding upstream version 9.1.upstream/9.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'zebra/zebra_tc.h')
-rw-r--r--zebra/zebra_tc.h66
1 files changed, 66 insertions, 0 deletions
diff --git a/zebra/zebra_tc.h b/zebra/zebra_tc.h
new file mode 100644
index 0000000..335430c
--- /dev/null
+++ b/zebra/zebra_tc.h
@@ -0,0 +1,66 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
+ * Zebra Traffic Control (TC) Data structures and definitions
+ * These are public definitions referenced by multiple files.
+ *
+ * Copyright (C) 2022 Shichu Yang
+ */
+
+#ifndef _ZEBRA_TC_H
+#define _ZEBRA_TC_H
+
+#include <zebra.h>
+#include "rt.h"
+#include "tc.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct zebra_tc_qdisc {
+ int sock;
+
+ struct tc_qdisc qdisc;
+};
+
+struct zebra_tc_class {
+ int sock;
+
+ struct tc_class class;
+};
+
+struct zebra_tc_filter {
+ int sock;
+
+ struct tc_filter filter;
+};
+
+const char *tc_qdisc_kind2str(uint32_t type);
+enum tc_qdisc_kind tc_qdisc_str2kind(const char *type);
+
+uint32_t zebra_tc_qdisc_hash_key(const void *arg);
+bool zebra_tc_qdisc_hash_equal(const void *arg1, const void *arg2);
+void zebra_tc_qdisc_install(struct zebra_tc_qdisc *qdisc);
+void zebra_tc_qdisc_uninstall(struct zebra_tc_qdisc *qdisc);
+
+uint32_t zebra_tc_class_hash_key(const void *arg);
+bool zebra_tc_class_hash_equal(const void *arg1, const void *arg2);
+void zebra_tc_class_add(struct zebra_tc_class *class);
+void zebra_tc_class_delete(struct zebra_tc_class *class);
+
+const char *tc_filter_kind2str(uint32_t type);
+enum tc_qdisc_kind tc_filter_str2kind(const char *type);
+void zebra_tc_filter_add(struct zebra_tc_filter *filter);
+void zebra_tc_filter_delete(struct zebra_tc_filter *filter);
+
+void zebra_tc_filters_free(void *arg);
+uint32_t zebra_tc_filter_hash_key(const void *arg);
+bool zebra_tc_filter_hash_equal(const void *arg1, const void *arg2);
+
+void kernel_read_tc_qdisc(struct zebra_ns *zns);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _ZEBRA_TC_H */