]> git.proxmox.com Git - mirror_frr.git/blob - zebra/zebra_tc.h
Merge pull request #13577 from raja-rajasekar/frr_dev1
[mirror_frr.git] / zebra / zebra_tc.h
1 // SPDX-License-Identifier: GPL-2.0-or-later
2 /*
3 * Zebra Traffic Control (TC) Data structures and definitions
4 * These are public definitions referenced by multiple files.
5 *
6 * Copyright (C) 2022 Shichu Yang
7 */
8
9 #ifndef _ZEBRA_TC_H
10 #define _ZEBRA_TC_H
11
12 #include <zebra.h>
13 #include "rt.h"
14 #include "tc.h"
15
16 #ifdef __cplusplus
17 extern "C" {
18 #endif
19
20 struct zebra_tc_qdisc {
21 int sock;
22
23 struct tc_qdisc qdisc;
24 };
25
26 struct zebra_tc_class {
27 int sock;
28
29 struct tc_class class;
30 };
31
32 struct zebra_tc_filter {
33 int sock;
34
35 struct tc_filter filter;
36 };
37
38 const char *tc_qdisc_kind2str(uint32_t type);
39 enum tc_qdisc_kind tc_qdisc_str2kind(const char *type);
40
41 uint32_t zebra_tc_qdisc_hash_key(const void *arg);
42 bool zebra_tc_qdisc_hash_equal(const void *arg1, const void *arg2);
43 void zebra_tc_qdisc_install(struct zebra_tc_qdisc *qdisc);
44 void zebra_tc_qdisc_uninstall(struct zebra_tc_qdisc *qdisc);
45
46 uint32_t zebra_tc_class_hash_key(const void *arg);
47 bool zebra_tc_class_hash_equal(const void *arg1, const void *arg2);
48 void zebra_tc_class_add(struct zebra_tc_class *class);
49 void zebra_tc_class_delete(struct zebra_tc_class *class);
50
51 const char *tc_filter_kind2str(uint32_t type);
52 enum tc_qdisc_kind tc_filter_str2kind(const char *type);
53 void zebra_tc_filter_add(struct zebra_tc_filter *filter);
54 void zebra_tc_filter_delete(struct zebra_tc_filter *filter);
55
56 void zebra_tc_filters_free(void *arg);
57 uint32_t zebra_tc_filter_hash_key(const void *arg);
58 bool zebra_tc_filter_hash_equal(const void *arg1, const void *arg2);
59
60 void kernel_read_tc_qdisc(struct zebra_ns *zns);
61
62 #ifdef __cplusplus
63 }
64 #endif
65
66 #endif /* _ZEBRA_TC_H */