diff options
author | Thomas Haller <thaller@redhat.com> | 2014-08-28 19:17:07 +0200 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2014-11-05 23:49:54 +0100 |
commit | 22d94e782cc667ed709beeefe1cb1c7dde70e33a (patch) | |
tree | 321b6055db15649a44d235c04b54f50b5dc455b5 | |
parent | 270fdca12e061d5f8ddc4560b924c4d391bb42e9 (diff) | |
download | NetworkManager-22d94e782cc667ed709beeefe1cb1c7dde70e33a.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/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 |
6 files changed, 48 insertions, 44 deletions
diff --git a/src/NetworkManagerUtils.c b/src/NetworkManagerUtils.c index 0911cced5d..318c5ca001 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/nm-ip4-config.c b/src/nm-ip4-config.c index 343aabcd0b..fb8629f92c 100644 --- a/src/nm-ip4-config.c +++ b/src/nm-ip4-config.c @@ -24,6 +24,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 d18b35c6a3..e0a97710dd 100644 --- a/src/nm-ip6-config.c +++ b/src/nm-ip6-config.c @@ -25,6 +25,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; \ ; |