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>
This commit is contained in:
Thomas Haller
2014-08-28 19:17:07 +02:00
parent c262819360
commit c52e331014
7 changed files with 49 additions and 44 deletions

View File

@@ -36,6 +36,7 @@
#include <linux/if_infiniband.h> #include <linux/if_infiniband.h>
#include "NetworkManagerUtils.h" #include "NetworkManagerUtils.h"
#include "nm-platform.h"
#include "nm-utils.h" #include "nm-utils.h"
#include "nm-core-internal.h" #include "nm-core-internal.h"
#include "nm-logging.h" #include "nm-logging.h"

View File

@@ -24,9 +24,10 @@
#include <glib.h> #include <glib.h>
#include <stdio.h> #include <stdio.h>
#include <arpa/inet.h>
#include "nm-connection.h" #include "nm-connection.h"
#include "nm-platform.h" #include "nm-types.h"
gboolean nm_ethernet_address_is_valid (gconstpointer addr, gssize len); gboolean nm_ethernet_address_is_valid (gconstpointer addr, gssize len);

View File

@@ -37,6 +37,7 @@
#include "nm-dhcp-utils.h" #include "nm-dhcp-utils.h"
#include "NetworkManagerUtils.h" #include "NetworkManagerUtils.h"
#include "gsystem-local-alloc.h" #include "gsystem-local-alloc.h"
#include "nm-platform.h"
#include "nm-sd-adapt.h" #include "nm-sd-adapt.h"

View File

@@ -25,6 +25,7 @@
#include "nm-ip4-config.h" #include "nm-ip4-config.h"
#include "nm-utils.h" #include "nm-utils.h"
#include "nm-platform.h"
#include "nm-dbus-manager.h" #include "nm-dbus-manager.h"
#include "nm-dbus-glib-types.h" #include "nm-dbus-glib-types.h"
#include "nm-ip4-config-glue.h" #include "nm-ip4-config-glue.h"

View File

@@ -26,6 +26,7 @@
#include "nm-glib-compat.h" #include "nm-glib-compat.h"
#include "nm-utils.h" #include "nm-utils.h"
#include "nm-platform.h"
#include "nm-dbus-manager.h" #include "nm-dbus-manager.h"
#include "nm-dbus-glib-types.h" #include "nm-dbus-glib-types.h"
#include "nm-ip6-config-glue.h" #include "nm-ip6-config-glue.h"

View File

@@ -60,6 +60,49 @@ typedef struct _NMPlatformIP6Address NMPlatformIP6Address;
typedef struct _NMPlatformIP6Route NMPlatformIP6Route; typedef struct _NMPlatformIP6Route NMPlatformIP6Route;
typedef struct _NMPlatformLink NMPlatformLink; 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 */ /* settings */
typedef struct _NMAgentManager NMAgentManager; typedef struct _NMAgentManager NMAgentManager;
typedef struct _NMSecretAgent NMSecretAgent; typedef struct _NMSecretAgent NMSecretAgent;

View File

@@ -72,49 +72,6 @@ typedef enum {
NM_PLATFORM_REASON_CACHE_CHECK NM_PLATFORM_REASON_CACHE_CHECK
} NMPlatformReason; } 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 \ #define __NMPlatformObject_COMMON \
int ifindex; \ int ifindex; \
; ;