]>
git.proxmox.com Git - mirror_frr.git/blob - lib/tc.h
2 * Traffic Control (TC) main header
3 * Copyright (C) 2022 Shichu Yang
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License as published by the Free
7 * Software Foundation; either version 2 of the License, or (at your option)
10 * This program is distributed in the hope that it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
15 * You should have received a copy of the GNU General Public License along
16 * with this program; see the file COPYING; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
30 #define TC_STR "Traffic Control\n"
32 /* qdisc definitions */
34 /* qdisc kind (same as class kinds) */
42 /* currently no members */
48 enum tc_qdisc_kind kind
;
50 struct tc_qdisc_htb htb
;
54 /* class definitions */
56 /* since classes share the same kinds of qdisc, duplicates omitted */
66 enum tc_qdisc_kind kind
;
68 struct tc_class_htb htb
;
72 /* filter definitions */
94 #define TC_FLOWER_IP_PROTOCOL (1 << 0)
95 #define TC_FLOWER_SRC_IP (1 << 1)
96 #define TC_FLOWER_DST_IP (1 << 2)
97 #define TC_FLOWER_SRC_PORT (1 << 3)
98 #define TC_FLOWER_DST_PORT (1 << 4)
99 #define TC_FLOWER_DSFIELD (1 << 5)
105 struct prefix src_ip
;
106 struct prefix dst_ip
;
108 uint16_t src_port_min
;
109 uint16_t src_port_max
;
110 uint16_t dst_port_min
;
111 uint16_t dst_port_max
;
114 uint8_t dsfield_mask
;
128 enum tc_filter_kind kind
;
133 struct tc_flower flower
;
138 extern int tc_getrate(const char *str
, uint64_t *rate
);
140 extern int zapi_tc_qdisc_encode(uint8_t cmd
, struct stream
*s
,
141 struct tc_qdisc
*qdisc
);
142 extern int zapi_tc_class_encode(uint8_t cmd
, struct stream
*s
,
143 struct tc_class
*class);
144 extern int zapi_tc_filter_encode(uint8_t cmd
, struct stream
*s
,
145 struct tc_filter
*filter
);