tree-wide: Introduce sd-forward.h and shared-forward.h headers

Let's not leak details from src/shared and src/libsystemd into
src/basic, even though you can't actually do anything useful with
just forward declarations from src/shared.

The sd-forward.h header is put in src/libsystemd/sd-common as we
don't have a directory for shared internal headers for libsystemd
yet.

Let's also rename forward.h to basic-forward.h to keep things
self-explanatory.
This commit is contained in:
Daan De Meyer
2025-10-16 17:00:29 +02:00
parent ac9391c552
commit f102bc3e5f
597 changed files with 944 additions and 927 deletions
+1 -1
View File
@@ -2,7 +2,7 @@
* Copyright © 2020 VMware, Inc. */
#pragma once
#include "forward.h"
#include "shared-forward.h"
#include "netdev.h"
typedef enum BareUDPProtocol {
+1 -1
View File
@@ -4,7 +4,7 @@
#include <linux/batman_adv.h>
#include "forward.h"
#include "shared-forward.h"
#include "netdev.h"
#define BATADV_GENL_NAME "batadv"
+1 -1
View File
@@ -2,7 +2,7 @@
#pragma once
#include "bond-util.h"
#include "forward.h"
#include "shared-forward.h"
#include "netdev.h"
typedef struct Bond {
+1 -1
View File
@@ -1,7 +1,7 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
#include "forward.h"
#include "shared-forward.h"
#include "netdev.h"
#define LINK_BRIDGE_PORT_PRIORITY_INVALID 128U
+1 -1
View File
@@ -1,7 +1,7 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
#include "forward.h"
#include "shared-forward.h"
#include "netdev.h"
typedef struct Dummy {
+1 -1
View File
@@ -4,7 +4,7 @@
#include <linux/fou.h>
#include "in-addr-util.h"
#include "forward.h"
#include "shared-forward.h"
#include "netdev.h"
typedef enum FooOverUDPEncapType {
+1 -1
View File
@@ -3,7 +3,7 @@
#include <linux/if_link.h>
#include "forward.h"
#include "shared-forward.h"
#include "in-addr-util.h"
#include "netdev.h"
+1 -1
View File
@@ -4,7 +4,7 @@
#include <linux/l2tp.h>
#include "in-addr-util.h"
#include "forward.h"
#include "shared-forward.h"
#include "netdev.h"
typedef enum L2tpL2specType {
+1 -1
View File
@@ -4,7 +4,7 @@
#include <linux/if_macsec.h>
#include <net/ethernet.h>
#include "forward.h"
#include "shared-forward.h"
#include "netdev.h"
#include "sparse-endian.h"
+1 -1
View File
@@ -1,7 +1,7 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
#include "forward.h"
#include "shared-forward.h"
#include "fou-tunnel.h"
#include "netdev.h"
#include "networkd-link.h"
+1 -1
View File
@@ -1,7 +1,7 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
#include "forward.h"
#include "shared-forward.h"
#include "netdev.h"
typedef struct TunTap {
+1 -1
View File
@@ -1,7 +1,7 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
#include "forward.h"
#include "shared-forward.h"
#include "netdev.h"
typedef struct VLan {
+1 -1
View File
@@ -3,7 +3,7 @@
#include <linux/nl80211.h>
#include "forward.h"
#include "shared-forward.h"
#include "netdev.h"
typedef struct WLan {
+1 -1
View File
@@ -1,7 +1,7 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
#include "forward.h"
#include "shared-forward.h"
#include "netdev.h"
typedef struct Xfrm {
+1 -1
View File
@@ -1,7 +1,7 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
#include "forward.h"
#include "shared-forward.h"
int dump_list(Table *table, const char *key, char * const *l);
int ieee_oui(sd_hwdb *hwdb, const struct ether_addr *mac, char **ret);
+1 -1
View File
@@ -6,7 +6,7 @@
#include "ether-addr-util.h"
#include "ethtool-util.h"
#include "forward.h"
#include "shared-forward.h"
#include "in-addr-util.h"
typedef struct VxLanInfo {
+1 -1
View File
@@ -1,7 +1,7 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
#include "forward.h"
#include "shared-forward.h"
int dump_lldp_neighbors(sd_varlink *vl, Table *table, int ifindex);
int link_lldp_status(int argc, char *argv[], void *userdata);
+1 -1
View File
@@ -1,6 +1,6 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
#include "forward.h"
#include "shared-forward.h"
int system_status(sd_netlink *rtnl, sd_hwdb *hwdb);
+1 -1
View File
@@ -1,7 +1,7 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
#include "forward.h"
#include "shared-forward.h"
int varlink_connect_networkd(sd_varlink **ret_varlink);
bool networkd_is_running(void);
+1 -1
View File
@@ -1,7 +1,7 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
#include "forward.h"
#include "shared-forward.h"
#include "pager.h"
extern PagerFlags arg_pager_flags;
+1 -1
View File
@@ -2,7 +2,7 @@
#pragma once
#include "firewall-util.h"
#include "forward.h"
#include "shared-forward.h"
#include "in-addr-util.h"
#include "networkd-forward.h"
#include "networkd-util.h"
+1 -1
View File
@@ -8,7 +8,7 @@
#include <linux/neighbour.h>
#include <net/ethernet.h>
#include "forward.h"
#include "shared-forward.h"
#include "in-addr-util.h"
#include "networkd-forward.h"
+1 -1
View File
@@ -2,7 +2,7 @@
#pragma once
#include "conf-parser-forward.h" /* IWYU pragma: export */
#include "forward.h" /* IWYU pragma: export */
#include "shared-forward.h" /* IWYU pragma: export */
typedef enum NetDevLocalAddressType NetDevLocalAddressType;
typedef enum NetworkConfigSource NetworkConfigSource;
+1 -1
View File
@@ -4,7 +4,7 @@
#include <linux/nl80211.h>
#include "ether-addr-util.h"
#include "forward.h"
#include "shared-forward.h"
#include "network-util.h"
#include "networkd-bridge-vlan.h"
#include "networkd-forward.h"
+1 -1
View File
@@ -2,7 +2,7 @@
* Copyright © 2020 VMware, Inc. */
#pragma once
#include "forward.h"
#include "shared-forward.h"
#include "qdisc.h"
#include "tclass.h"
+1 -1
View File
@@ -3,7 +3,7 @@
#include <linux/pkt_sched.h>
#include "forward.h"
#include "shared-forward.h"
#include "qdisc.h"
typedef struct EnhancedTransmissionSelection {
+1 -1
View File
@@ -2,7 +2,7 @@
* Copyright © 2020 VMware, Inc. */
#pragma once
#include "forward.h"
#include "shared-forward.h"
#include "qdisc.h"
typedef struct FirstInFirstOut {
+1 -1
View File
@@ -2,7 +2,7 @@
* Copyright © 2019 VMware, Inc. */
#pragma once
#include "forward.h"
#include "shared-forward.h"
#include "qdisc.h"
typedef struct FairQueueingControlledDelay {
+1 -1
View File
@@ -2,7 +2,7 @@
* Copyright © 2020 VMware, Inc. */
#pragma once
#include "forward.h"
#include "shared-forward.h"
#include "qdisc.h"
typedef struct FlowQueuePIE {
+1 -1
View File
@@ -2,7 +2,7 @@
* Copyright © 2019 VMware, Inc. */
#pragma once
#include "forward.h"
#include "shared-forward.h"
#include "qdisc.h"
typedef struct FairQueueing {
+1 -1
View File
@@ -2,7 +2,7 @@
* Copyright © 2020 VMware, Inc. */
#pragma once
#include "forward.h"
#include "shared-forward.h"
#include "qdisc.h"
typedef struct GenericRandomEarlyDetection {
+1 -1
View File
@@ -2,7 +2,7 @@
* Copyright © 2020 VMware, Inc. */
#pragma once
#include "forward.h"
#include "shared-forward.h"
#include "qdisc.h"
typedef struct HeavyHitterFilter {
+1 -1
View File
@@ -1,7 +1,7 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
#include "forward.h"
#include "shared-forward.h"
#include "qdisc.h"
#include "tclass.h"
+1 -1
View File
@@ -1,6 +1,6 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#include "forward.h"
#include "shared-forward.h"
#include "mq.h"
const QDiscVTable mq_vtable = {
+1 -1
View File
@@ -1,7 +1,7 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
#include "forward.h"
#include "shared-forward.h"
#include "qdisc.h"
typedef struct ClassfulMultiQueueing {
+1 -1
View File
@@ -1,7 +1,7 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
#include "forward.h"
#include "shared-forward.h"
#include "qdisc.h"
typedef struct BandMultiQueueing {
+1 -1
View File
@@ -2,7 +2,7 @@
* Copyright © 2019 VMware, Inc. */
#pragma once
#include "forward.h"
#include "shared-forward.h"
#include "qdisc.h"
typedef struct NetworkEmulator {
+1 -1
View File
@@ -2,7 +2,7 @@
* Copyright © 2020 VMware, Inc. */
#pragma once
#include "forward.h"
#include "shared-forward.h"
#include "qdisc.h"
typedef struct ProportionalIntegralControllerEnhanced {
+1 -1
View File
@@ -2,7 +2,7 @@
* Copyright © 2020 VMware, Inc. */
#pragma once
#include "forward.h"
#include "shared-forward.h"
#include "qdisc.h"
#include "tclass.h"
+1 -1
View File
@@ -2,7 +2,7 @@
* Copyright © 2020 VMware, Inc. */
#pragma once
#include "forward.h"
#include "shared-forward.h"
#include "qdisc.h"
typedef struct StochasticFairBlue {
+1 -1
View File
@@ -2,7 +2,7 @@
* Copyright © 2019 VMware, Inc. */
#pragma once
#include "forward.h"
#include "shared-forward.h"
#include "qdisc.h"
typedef struct StochasticFairnessQueueing {
+1 -1
View File
@@ -2,7 +2,7 @@
* Copyright © 2019 VMware, Inc. */
#pragma once
#include "forward.h"
#include "shared-forward.h"
#include "qdisc.h"
typedef struct TokenBucketFilter {
+1 -1
View File
@@ -4,7 +4,7 @@
#include <linux/pkt_sched.h>
#include "forward.h"
#include "shared-forward.h"
int tc_init(double *ret_ticks_in_usec, uint32_t *ret_hz);
int tc_time_to_tick(usec_t t, uint32_t *ret);
+1 -1
View File
@@ -1,7 +1,7 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
#include "forward.h"
#include "shared-forward.h"
#include "qdisc.h"
typedef struct TrivialLinkEqualizer {
+1 -1
View File
@@ -3,7 +3,7 @@
#include <sys/uio.h>
#include "forward.h"
#include "shared-forward.h"
typedef struct DNSServer {
struct iovec addr;
+1 -1
View File
@@ -1,7 +1,7 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
#include "forward.h"
#include "shared-forward.h"
#include "network-util.h"
typedef struct DNSConfiguration DNSConfiguration;
@@ -1,7 +1,7 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
#include "forward.h"
#include "shared-forward.h"
#include "network-util.h"
typedef struct DNSConfiguration DNSConfiguration;