]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
network: Remove circular header dependencies in network/tc
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Sat, 19 Apr 2025 10:12:20 +0000 (12:12 +0200)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Wed, 23 Apr 2025 08:33:37 +0000 (10:33 +0200)
Include the headers in the implementation file (and the gperf file)
instead of in the qdisc.h header. I opted to keep them separate from
the other headers since they're slightly different than regular headers.

12 files changed:
src/network/networkd-network-gperf.gperf
src/network/tc/codel.c
src/network/tc/drr.h
src/network/tc/fq-codel.c
src/network/tc/gred.c
src/network/tc/multiq.c
src/network/tc/qdisc.c
src/network/tc/qdisc.h
src/network/tc/qfq.h
src/network/tc/tbf.c
src/network/tc/tclass.c
src/network/tc/tclass.h

index c1aff5c02d272200c59ae49cc18810034078f3e8..a788186ea670f477ce6a736e4caaf20afc552f10 100644 (file)
@@ -41,6 +41,27 @@ _Pragma("GCC diagnostic ignored \"-Wzero-as-null-pointer-constant\"")
 #include "qdisc.h"
 #include "tclass.h"
 #include "vlan-util.h"
+
+#include "cake.h"
+#include "codel.h"
+#include "ets.h"
+#include "fifo.h"
+#include "fq-codel.h"
+#include "fq-pie.h"
+#include "fq.h"
+#include "gred.h"
+#include "hhf.h"
+#include "htb.h"
+#include "mq.h"
+#include "multiq.h"
+#include "pie.h"
+#include "qfq.h"
+#include "netem.h"
+#include "drr.h"
+#include "sfb.h"
+#include "sfq.h"
+#include "tbf.h"
+#include "teql.h"
 %}
 struct ConfigPerfItem;
 %null_strings
index 53ccf66e419e64a04721d79720625d8d7250b4f1..2bba46f2e9fb93da6b32c55946e7cb5b3fb56e39 100644 (file)
@@ -4,10 +4,10 @@
 #include <linux/pkt_sched.h>
 
 #include "alloc-util.h"
+#include "codel.h"
 #include "conf-parser.h"
 #include "netlink-util.h"
 #include "parse-util.h"
-#include "qdisc.h"
 #include "string-util.h"
 
 static int controlled_delay_init(QDisc *qdisc) {
index c96cc4db0070190156f669b3c6d19c4a6a92507c..4719bf6c4f98bc15ea7b9e4d24be33b5d7414e84 100644 (file)
@@ -3,6 +3,7 @@
 #pragma once
 
 #include "qdisc.h"
+#include "tclass.h"
 
 typedef struct DeficitRoundRobinScheduler {
         QDisc meta;
index 9255cde4650d9c2093acc13822cace7a2413d99b..4f5f09dfe58dd2c658e9ecdda64d26144c7d02e4 100644 (file)
@@ -5,9 +5,9 @@
 
 #include "alloc-util.h"
 #include "conf-parser.h"
+#include "fq-codel.h"
 #include "netlink-util.h"
 #include "parse-util.h"
-#include "qdisc.h"
 #include "string-util.h"
 #include "strv.h"
 
index 198905a1521ff207f07a1d2a84083ae3c7ea2859..550c2da0f416a00d3195062a3d0abdfe2a518d26 100644 (file)
@@ -5,9 +5,9 @@
 
 #include "alloc-util.h"
 #include "conf-parser.h"
+#include "gred.h"
 #include "netlink-util.h"
 #include "parse-util.h"
-#include "qdisc.h"
 #include "string-util.h"
 
 static int generic_random_early_detection_init(QDisc *qdisc) {
index c70d8c59061e33c5bbf7ee3e982b20287370e349..5e637e9e514c8b4f17d878929127c62c6c627e83 100644 (file)
@@ -1,5 +1,7 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
+#include <linux/pkt_sched.h>
+
 #include "multiq.h"
 
 static int multi_queueing_fill_message(Link *link, QDisc *qdisc, sd_netlink_message *req) {
index 3bcc3930662f494b65c5031819e44e0c31d915d0..3b7bcfd48a0e2eeccf8b42e67422db83852010c3 100644 (file)
 #include "strv.h"
 #include "tc-util.h"
 
+#include "cake.h"
+#include "codel.h"
+#include "ets.h"
+#include "fifo.h"
+#include "fq-codel.h"
+#include "fq-pie.h"
+#include "fq.h"
+#include "gred.h"
+#include "hhf.h"
+#include "htb.h"
+#include "mq.h"
+#include "multiq.h"
+#include "pie.h"
+#include "qfq.h"
+#include "netem.h"
+#include "drr.h"
+#include "sfb.h"
+#include "sfq.h"
+#include "tbf.h"
+#include "teql.h"
+
 const QDiscVTable * const qdisc_vtable[_QDISC_KIND_MAX] = {
         [QDISC_KIND_BFIFO]           = &bfifo_vtable,
         [QDISC_KIND_CAKE]            = &cake_vtable,
index 80b95c2aab4fcf77a343ae750dc45ae8b9bf1999..5a2b1be5f429d2575bcea61cbfd6acba695e3d04 100644 (file)
@@ -97,24 +97,3 @@ DEFINE_SECTION_CLEANUP_FUNCTIONS(QDisc, qdisc_unref);
 
 CONFIG_PARSER_PROTOTYPE(config_parse_qdisc_parent);
 CONFIG_PARSER_PROTOTYPE(config_parse_qdisc_handle);
-
-#include "cake.h"
-#include "codel.h"
-#include "ets.h"
-#include "fifo.h"
-#include "fq-codel.h"
-#include "fq-pie.h"
-#include "fq.h"
-#include "gred.h"
-#include "hhf.h"
-#include "htb.h"
-#include "mq.h"
-#include "multiq.h"
-#include "pie.h"
-#include "qfq.h"
-#include "netem.h"
-#include "drr.h"
-#include "sfb.h"
-#include "sfq.h"
-#include "tbf.h"
-#include "teql.h"
index 0f013a9863da6f32427efbfbf1103df92a2a29c0..2e6599391acf7d80665983e0c1201b346020e3be 100644 (file)
@@ -4,6 +4,7 @@
 
 #include "conf-parser.h"
 #include "qdisc.h"
+#include "tclass.h"
 
 typedef struct QuickFairQueueing {
         QDisc meta;
index 3e7a3098dab3fa736f5be4becd78c432e4530f28..85ecbe39be8eb71519e99a5d74e617187f6138f4 100644 (file)
@@ -10,9 +10,9 @@
 #include "netlink-util.h"
 #include "networkd-manager.h"
 #include "parse-util.h"
-#include "qdisc.h"
 #include "string-util.h"
 #include "strv.h"
+#include "tbf.h"
 #include "tc-util.h"
 
 static int token_bucket_filter_fill_message(Link *link, QDisc *qdisc, sd_netlink_message *req) {
index 684f917c50562bcc36004162b39ada1d2f9d60f3..e156a7f1cf0860a41126781a9197c04668cf48b8 100644 (file)
 #include "tc-util.h"
 #include "tclass.h"
 
+#include "drr.h"
+#include "htb.h"
+#include "qfq.h"
+
 const TClassVTable * const tclass_vtable[_TCLASS_KIND_MAX] = {
         [TCLASS_KIND_DRR] = &drr_tclass_vtable,
         [TCLASS_KIND_HTB] = &htb_tclass_vtable,
index 31374d6da8dccbc81950a4468dae497ccbc4b924..b5dc5c8c3cdd898e0527e96a95d60f9c6be7a2ed 100644 (file)
@@ -77,7 +77,3 @@ DEFINE_SECTION_CLEANUP_FUNCTIONS(TClass, tclass_unref);
 
 CONFIG_PARSER_PROTOTYPE(config_parse_tclass_parent);
 CONFIG_PARSER_PROTOTYPE(config_parse_tclass_classid);
-
-#include "drr.h"
-#include "htb.h"
-#include "qfq.h"