summaryrefslogtreecommitdiff
path: root/src/platform
diff options
context:
space:
mode:
authorDan Winship <danw@gnome.org>2014-07-17 17:06:44 -0400
committerDan Winship <danw@gnome.org>2014-07-23 10:56:26 -0400
commitb28f6526c27b920827416315f13ca051bf5a644d (patch)
treedc8a924222fc59fe15091558f23d02c576dd3a0c /src/platform
parentb7c7832ae87054bdf4138d0c509a3a31504f69cf (diff)
downloadNetworkManager-b28f6526c27b920827416315f13ca051bf5a644d.tar.gz
core: fill in nm-types.h, clean out other headers
Clean up some of the cross-includes between headers (which made it so that, eg, if you included NetworkManagerUtils.h in a test program, you would need to build the test with -I$(top_srcdir)/src/platform, and if you included nm-device.h you'd need $(POLKIT_CFLAGS)) by moving all GObject struct definitions for src/ and src/settings/ into nm-types.h (which already existed to solve the NMDevice/NMActRequest circular references). Update various .c files to explicitly include the headers they used to get implicitly, and remove some now-unnecessary -I options from Makefiles.
Diffstat (limited to 'src/platform')
-rw-r--r--src/platform/nm-platform.h21
1 files changed, 11 insertions, 10 deletions
diff --git a/src/platform/nm-platform.h b/src/platform/nm-platform.h
index 9bdc6a9cb1..844727391f 100644
--- a/src/platform/nm-platform.h
+++ b/src/platform/nm-platform.h
@@ -30,6 +30,7 @@
#include <NetworkManager.h>
#include "gsystem-local-alloc.h"
+#include "nm-types.h"
#define NM_TYPE_PLATFORM (nm_platform_get_type ())
#define NM_PLATFORM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_PLATFORM, NMPlatform))
@@ -120,7 +121,7 @@ typedef enum {
int ifindex; \
;
-typedef struct {
+struct _NMPlatformLink {
__NMPlatformObject_COMMON;
char name[IFNAMSIZ];
NMLinkType type;
@@ -133,7 +134,7 @@ typedef struct {
gboolean connected;
gboolean arp;
guint mtu;
-} NMPlatformLink;
+};
typedef enum {
NM_PLATFORM_SIGNAL_ADDED,
@@ -208,24 +209,24 @@ typedef struct {
* NMPlatformIP4Address:
* @timestamp: timestamp as returned by nm_utils_get_monotonic_timestamp_s()
**/
-typedef struct {
+struct _NMPlatformIP4Address {
__NMPlatformIPAddress_COMMON;
in_addr_t address;
in_addr_t peer_address; /* PTP peer address */
char label[IFNAMSIZ];
-} NMPlatformIP4Address;
+};
G_STATIC_ASSERT (G_STRUCT_OFFSET (NMPlatformIPAddress, address_ptr) == G_STRUCT_OFFSET (NMPlatformIP4Address, address));
/**
* NMPlatformIP6Address:
* @timestamp: timestamp as returned by nm_utils_get_monotonic_timestamp_s()
**/
-typedef struct {
+struct _NMPlatformIP6Address {
__NMPlatformIPAddress_COMMON;
struct in6_addr address;
struct in6_addr peer_address;
guint flags; /* ifa_flags from <linux/if_addr.h>, field type "unsigned int" is as used in rtnl_addr_get_flags. */
-} NMPlatformIP6Address;
+};
G_STATIC_ASSERT (G_STRUCT_OFFSET (NMPlatformIPAddress, address_ptr) == G_STRUCT_OFFSET (NMPlatformIP6Address, address));
#undef __NMPlatformIPAddress_COMMON
@@ -249,18 +250,18 @@ typedef struct {
};
} NMPlatformIPRoute;
-typedef struct {
+struct _NMPlatformIP4Route {
__NMPlatformIPRoute_COMMON;
in_addr_t network;
in_addr_t gateway;
-} NMPlatformIP4Route;
+};
G_STATIC_ASSERT (G_STRUCT_OFFSET (NMPlatformIPRoute, network_ptr) == G_STRUCT_OFFSET (NMPlatformIP4Route, network));
-typedef struct {
+struct _NMPlatformIP6Route {
__NMPlatformIPRoute_COMMON;
struct in6_addr network;
struct in6_addr gateway;
-} NMPlatformIP6Route;
+};
G_STATIC_ASSERT (G_STRUCT_OFFSET (NMPlatformIPRoute, network_ptr) == G_STRUCT_OFFSET (NMPlatformIP6Route, network));
#undef __NMPlatformIPRoute_COMMON