From 634f0f983c57e41292dd36c7327e99316ff61aa3 Mon Sep 17 00:00:00 2001 From: Zbigniew Jędrzejewski-Szmek Date: Thu, 28 Apr 2016 22:52:04 -0400 Subject: networkd: rework headers to avoid circular includes Header files were organized in a way where the includer would add various typedefs used by the includee before including it, resulting in a tangled web of dependencies between files. Replace this with the following logic: networkd.h / \ networkd-link.h \ networkd-ipv4ll.h--\__\ networkd-fdb.h \ networkd-network.h netword-netdev-*.h networkd-route.h \ networkd-netdev.h If a pointer to a structure defined in a different header file is needed, use a typedef line instead of including the whole header. --- src/network/networkd-netdev-tunnel.h | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'src/network/networkd-netdev-tunnel.h') diff --git a/src/network/networkd-netdev-tunnel.h b/src/network/networkd-netdev-tunnel.h index 0d41f80a3c..7d31e7b687 100644 --- a/src/network/networkd-netdev-tunnel.h +++ b/src/network/networkd-netdev-tunnel.h @@ -19,7 +19,7 @@ along with systemd; If not, see . ***/ -typedef struct Tunnel Tunnel; +#include "in-addr-util.h" #include "networkd-netdev.h" @@ -37,7 +37,7 @@ typedef enum IPv6FlowLabel { _NETDEV_IPV6_FLOWLABEL_INVALID = -1, } IPv6FlowLabel; -struct Tunnel { +typedef struct Tunnel { NetDev meta; uint8_t encap_limit; @@ -56,8 +56,17 @@ struct Tunnel { bool pmtudisc; bool copy_dscp; -}; - +} Tunnel; + +DEFINE_NETDEV_CAST(IPIP, Tunnel); +DEFINE_NETDEV_CAST(GRE, Tunnel); +DEFINE_NETDEV_CAST(GRETAP, Tunnel); +DEFINE_NETDEV_CAST(IP6GRE, Tunnel); +DEFINE_NETDEV_CAST(IP6GRETAP, Tunnel); +DEFINE_NETDEV_CAST(SIT, Tunnel); +DEFINE_NETDEV_CAST(VTI, Tunnel); +DEFINE_NETDEV_CAST(VTI6, Tunnel); +DEFINE_NETDEV_CAST(IP6TNL, Tunnel); extern const NetDevVTable ipip_vtable; extern const NetDevVTable sit_vtable; extern const NetDevVTable vti_vtable; -- cgit v1.2.3-54-g00ecf