]>
git.ipfire.org Git - thirdparty/systemd.git/blob - src/network/tc/tc.h
1 /* SPDX-License-Identifier: LGPL-2.1-or-later */
4 #include "networkd-link.h"
6 typedef enum TrafficControlKind
{
11 _TC_KIND_INVALID
= -1,
14 typedef struct TrafficControl
{
15 TrafficControlKind kind
;
18 /* For casting a tc into the various tc kinds */
19 #define DEFINE_TC_CAST(UPPERCASE, MixedCase) \
20 static inline MixedCase* TC_TO_##UPPERCASE(TrafficControl *tc) { \
21 if (_unlikely_(!tc || tc->kind != TC_KIND_##UPPERCASE)) \
24 return (MixedCase*) tc; \
27 /* For casting the various tc kinds into a tc */
28 #define TC(tc) (&(tc)->meta)
30 void traffic_control_free(TrafficControl
*tc
);
31 int link_configure_traffic_control(Link
*link
);
32 void network_drop_invalid_traffic_control(Network
*network
);