]> git.proxmox.com Git - mirror_frr.git/blob - zebra/zebra_tc.h
doc: Add `show ipv6 rpf X:X::X:X` command to docs
[mirror_frr.git] / zebra / zebra_tc.h
1 /*
2 * Zebra Traffic Control (TC) Data structures and definitions
3 * These are public definitions referenced by multiple files.
4 *
5 * Copyright (C) 2022 Shichu Yang
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the Free
9 * Software Foundation; either version 2 of the License, or (at your option)
10 * any later version.
11 *
12 * This program is distributed in the hope that it will be useful, but WITHOUT
13 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
15 * more details.
16 *
17 * You should have received a copy of the GNU General Public License along
18 * with this program; see the file COPYING; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20 */
21
22 #ifndef _ZEBRA_TC_H
23 #define _ZEBRA_TC_H
24
25 #include <zebra.h>
26 #include "rt.h"
27 #include "tc.h"
28
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32
33 struct zebra_tc_qdisc {
34 int sock;
35
36 struct tc_qdisc qdisc;
37 };
38
39 struct zebra_tc_class {
40 int sock;
41
42 struct tc_class class;
43 };
44
45 struct zebra_tc_filter {
46 int sock;
47
48 struct tc_filter filter;
49 };
50
51 const char *tc_qdisc_kind2str(uint32_t type);
52 enum tc_qdisc_kind tc_qdisc_str2kind(const char *type);
53
54 uint32_t zebra_tc_qdisc_hash_key(const void *arg);
55 bool zebra_tc_qdisc_hash_equal(const void *arg1, const void *arg2);
56 void zebra_tc_qdisc_install(struct zebra_tc_qdisc *qdisc);
57 void zebra_tc_qdisc_uninstall(struct zebra_tc_qdisc *qdisc);
58
59 uint32_t zebra_tc_class_hash_key(const void *arg);
60 bool zebra_tc_class_hash_equal(const void *arg1, const void *arg2);
61 void zebra_tc_class_add(struct zebra_tc_class *class);
62 void zebra_tc_class_delete(struct zebra_tc_class *class);
63
64 const char *tc_filter_kind2str(uint32_t type);
65 enum tc_qdisc_kind tc_filter_str2kind(const char *type);
66 void zebra_tc_filter_add(struct zebra_tc_filter *filter);
67 void zebra_tc_filter_delete(struct zebra_tc_filter *filter);
68
69 void zebra_tc_filters_free(void *arg);
70 uint32_t zebra_tc_filter_hash_key(const void *arg);
71 bool zebra_tc_filter_hash_equal(const void *arg1, const void *arg2);
72
73 void kernel_read_tc_qdisc(struct zebra_ns *zns);
74
75 #ifdef __cplusplus
76 }
77 #endif
78
79 #endif /* _ZEBRA_TC_H */