]>
git.proxmox.com Git - mirror_frr.git/blob - lib/tc.h
1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * Traffic Control (TC) main header
4 * Copyright (C) 2022 Shichu Yang
17 #define TC_STR "Traffic Control\n"
19 /* qdisc definitions */
21 /* qdisc kind (same as class kinds) */
29 /* currently no members */
35 enum tc_qdisc_kind kind
;
37 struct tc_qdisc_htb htb
;
41 /* class definitions */
43 /* since classes share the same kinds of qdisc, duplicates omitted */
53 enum tc_qdisc_kind kind
;
55 struct tc_class_htb htb
;
59 /* filter definitions */
81 #define TC_FLOWER_IP_PROTOCOL (1 << 0)
82 #define TC_FLOWER_SRC_IP (1 << 1)
83 #define TC_FLOWER_DST_IP (1 << 2)
84 #define TC_FLOWER_SRC_PORT (1 << 3)
85 #define TC_FLOWER_DST_PORT (1 << 4)
86 #define TC_FLOWER_DSFIELD (1 << 5)
95 uint16_t src_port_min
;
96 uint16_t src_port_max
;
97 uint16_t dst_port_min
;
98 uint16_t dst_port_max
;
101 uint8_t dsfield_mask
;
115 enum tc_filter_kind kind
;
120 struct tc_flower flower
;
125 extern int tc_getrate(const char *str
, uint64_t *rate
);
127 extern int zapi_tc_qdisc_encode(uint8_t cmd
, struct stream
*s
,
128 struct tc_qdisc
*qdisc
);
129 extern int zapi_tc_class_encode(uint8_t cmd
, struct stream
*s
,
130 struct tc_class
*class);
131 extern int zapi_tc_filter_encode(uint8_t cmd
, struct stream
*s
,
132 struct tc_filter
*filter
);