diff options
author | Thomas Haller <thaller@redhat.com> | 2014-08-28 19:17:07 +0200 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2014-11-07 15:19:05 +0100 |
commit | c52e33101436bfd5cabffdc01947b6850616a7c1 (patch) | |
tree | ee955b99da4ebf0a1dd4631c8826ba28ac3cba2f | |
parent | c2628193607ccf6f8fb162f8459ccbb815c5cd86 (diff) | |
download | NetworkManager-c52e33101436bfd5cabffdc01947b6850616a7c1.tar.gz |
core: move definition of NMLinkType to nm-types.h
As we use NMLinkType in NetworkManagerUtils.h, we cannot use
the utils header without nm-platform.h. That is clearly wrong.
Apparently NMLinkType has a wider use outside of platform (and
its name is not prefixed with 'platform' either).
Move the enum definition to nm-types.h.
Signed-off-by: Thomas Haller <thaller@redhat.com>
-rw-r--r-- | src/NetworkManagerUtils.c | 1 | ||||
-rw-r--r-- | src/NetworkManagerUtils.h | 3 | ||||
-rw-r--r-- | src/dhcp-manager/nm-dhcp-systemd.c | 1 | ||||
-rw-r--r-- | src/nm-ip4-config.c | 1 | ||||
-rw-r--r-- | src/nm-ip6-config.c | 1 | ||||
-rw-r--r-- | src/nm-types.h | 43 | ||||
-rw-r--r-- | src/platform/nm-platform.h | 43 |
7 files changed, 49 insertions, 44 deletions
diff --git a/src/NetworkManagerUtils.c b/src/NetworkManagerUtils.c index c8bf226659..538295a10c 100644 --- a/src/NetworkManagerUtils.c +++ b/src/NetworkManagerUtils.c @@ -36,6 +36,7 @@ #include <linux/if_infiniband.h> #include "NetworkManagerUtils.h" +#include "nm-platform.h" #include "nm-utils.h" #include "nm-core-internal.h" #include "nm-logging.h" diff --git a/src/NetworkManagerUtils.h b/src/NetworkManagerUtils.h index 0dab6babcb..492edd133e 100644 --- a/src/NetworkManagerUtils.h +++ b/src/NetworkManagerUtils.h @@ -24,9 +24,10 @@ #include <glib.h> #include <stdio.h> +#include <arpa/inet.h> #include "nm-connection.h" -#include "nm-platform.h" +#include "nm-types.h" gboolean nm_ethernet_address_is_valid (gconstpointer addr, gssize len); diff --git a/src/dhcp-manager/nm-dhcp-systemd.c b/src/dhcp-manager/nm-dhcp-systemd.c index 363c87f870..18b7b32180 100644 --- a/src/dhcp-manager/nm-dhcp-systemd.c +++ b/src/dhcp-manager/nm-dhcp-systemd.c @@ -37,6 +37,7 @@ #include "nm-dhcp-utils.h" #include "NetworkManagerUtils.h" #include "gsystem-local-alloc.h" +#include "nm-platform.h" #include "nm-sd-adapt.h" diff --git a/src/nm-ip4-config.c b/src/nm-ip4-config.c index 604d627f52..d491e62fb9 100644 --- a/src/nm-ip4-config.c +++ b/src/nm-ip4-config.c @@ -25,6 +25,7 @@ #include "nm-ip4-config.h" #include "nm-utils.h" +#include "nm-platform.h" #include "nm-dbus-manager.h" #include "nm-dbus-glib-types.h" #include "nm-ip4-config-glue.h" diff --git a/src/nm-ip6-config.c b/src/nm-ip6-config.c index 13db237cc6..6932ab028a 100644 --- a/src/nm-ip6-config.c +++ b/src/nm-ip6-config.c @@ -26,6 +26,7 @@ #include "nm-glib-compat.h" #include "nm-utils.h" +#include "nm-platform.h" #include "nm-dbus-manager.h" #include "nm-dbus-glib-types.h" #include "nm-ip6-config-glue.h" diff --git a/src/nm-types.h b/src/nm-types.h index e67ae20527..4d204fc2b4 100644 --- a/src/nm-types.h +++ b/src/nm-types.h @@ -60,6 +60,49 @@ typedef struct _NMPlatformIP6Address NMPlatformIP6Address; typedef struct _NMPlatformIP6Route NMPlatformIP6Route; typedef struct _NMPlatformLink NMPlatformLink; +typedef enum { + /* Please don't interpret type numbers outside nm-platform and use functions + * like nm_platform_link_is_software() and nm_platform_supports_slaves(). + * + * type & 0x10000 -> Software device type + * type & 0x20000 -> Type supports slaves + */ + + /* No type, used as error value */ + NM_LINK_TYPE_NONE, + + /* Unknown type */ + NM_LINK_TYPE_UNKNOWN, + + /* Hardware types */ + NM_LINK_TYPE_ETHERNET, + NM_LINK_TYPE_INFINIBAND, + NM_LINK_TYPE_OLPC_MESH, + NM_LINK_TYPE_WIFI, + NM_LINK_TYPE_WWAN_ETHERNET, /* WWAN pseudo-ethernet */ + NM_LINK_TYPE_WIMAX, + + /* Software types */ + NM_LINK_TYPE_DUMMY = 0x10000, + NM_LINK_TYPE_GRE, + NM_LINK_TYPE_GRETAP, + NM_LINK_TYPE_IFB, + NM_LINK_TYPE_LOOPBACK, + NM_LINK_TYPE_MACVLAN, + NM_LINK_TYPE_MACVTAP, + NM_LINK_TYPE_OPENVSWITCH, + NM_LINK_TYPE_TAP, + NM_LINK_TYPE_TUN, + NM_LINK_TYPE_VETH, + NM_LINK_TYPE_VLAN, + NM_LINK_TYPE_VXLAN, + + /* Software types with slaves */ + NM_LINK_TYPE_BRIDGE = 0x10000 | 0x20000, + NM_LINK_TYPE_BOND, + NM_LINK_TYPE_TEAM, +} NMLinkType; + /* settings */ typedef struct _NMAgentManager NMAgentManager; typedef struct _NMSecretAgent NMSecretAgent; diff --git a/src/platform/nm-platform.h b/src/platform/nm-platform.h index 0ec372ff89..d6836d20ac 100644 --- a/src/platform/nm-platform.h +++ b/src/platform/nm-platform.h @@ -72,49 +72,6 @@ typedef enum { NM_PLATFORM_REASON_CACHE_CHECK } NMPlatformReason; -typedef enum { - /* Please don't interpret type numbers outside nm-platform and use functions - * like nm_platform_link_is_software() and nm_platform_supports_slaves(). - * - * type & 0x10000 -> Software device type - * type & 0x20000 -> Type supports slaves - */ - - /* No type, used as error value */ - NM_LINK_TYPE_NONE, - - /* Unknown type */ - NM_LINK_TYPE_UNKNOWN, - - /* Hardware types */ - NM_LINK_TYPE_ETHERNET, - NM_LINK_TYPE_INFINIBAND, - NM_LINK_TYPE_OLPC_MESH, - NM_LINK_TYPE_WIFI, - NM_LINK_TYPE_WWAN_ETHERNET, /* WWAN pseudo-ethernet */ - NM_LINK_TYPE_WIMAX, - - /* Software types */ - NM_LINK_TYPE_DUMMY = 0x10000, - NM_LINK_TYPE_GRE, - NM_LINK_TYPE_GRETAP, - NM_LINK_TYPE_IFB, - NM_LINK_TYPE_LOOPBACK, - NM_LINK_TYPE_MACVLAN, - NM_LINK_TYPE_MACVTAP, - NM_LINK_TYPE_OPENVSWITCH, - NM_LINK_TYPE_TAP, - NM_LINK_TYPE_TUN, - NM_LINK_TYPE_VETH, - NM_LINK_TYPE_VLAN, - NM_LINK_TYPE_VXLAN, - - /* Software types with slaves */ - NM_LINK_TYPE_BRIDGE = 0x10000 | 0x20000, - NM_LINK_TYPE_BOND, - NM_LINK_TYPE_TEAM, -} NMLinkType; - #define __NMPlatformObject_COMMON \ int ifindex; \ ; |