Commit 67da0a28 authored by Thomas Haller's avatar Thomas Haller

core: move NMIPAddr to nm-core-utils.h

parent 5fc4bfc0
......@@ -110,6 +110,10 @@ _nm_utils_set_testing (NMUtilsTestFlags flags)
/*****************************************************************************/
const NMIPAddr nm_ip_addr_zero = NMIPAddrInit;
/*****************************************************************************/
static GSList *_singletons = NULL;
static gboolean _singletons_shutdown = FALSE;
......
......@@ -90,6 +90,25 @@ GETTER (void) \
/*****************************************************************************/
typedef struct {
union {
guint8 addr_ptr[1];
in_addr_t addr4;
struct in6_addr addr6;
/* NMIPAddr is really a union for IP addresses.
* However, as ethernet addresses fit in here nicely, use
* it also for an ethernet MAC address. */
guint8 addr_eth[6 /*ETH_ALEN*/];
};
} NMIPAddr;
extern const NMIPAddr nm_ip_addr_zero;
#define NMIPAddrInit { .addr6 = IN6ADDR_ANY_INIT }
/*****************************************************************************/
gboolean nm_ethernet_address_is_valid (gconstpointer addr, gssize len);
gconstpointer nm_utils_ipx_address_clear_host_address (int family, gpointer dst, gconstpointer src, guint8 plen);
......
......@@ -43,10 +43,6 @@
/*****************************************************************************/
const NMIPAddr nm_ip_addr_zero = NMIPAddrInit;
/*****************************************************************************/
G_STATIC_ASSERT (sizeof ( ((NMPlatformLink *) NULL)->addr.data ) == NM_UTILS_HWADDR_LEN_MAX);
G_STATIC_ASSERT (G_STRUCT_OFFSET (NMPlatformIPAddress, address_ptr) == G_STRUCT_OFFSET (NMPlatformIP4Address, address));
G_STATIC_ASSERT (G_STRUCT_OFFSET (NMPlatformIPAddress, address_ptr) == G_STRUCT_OFFSET (NMPlatformIP6Address, address));
......
......@@ -93,24 +93,6 @@ typedef enum { /*< skip >*/
NM_PLATFORM_ERROR_OPNOTSUPP,
} NMPlatformError;
typedef struct {
union {
guint8 addr_ptr[1];
in_addr_t addr4;
struct in6_addr addr6;
/* NMIPAddr is really a union for IP addresses.
* However, as ethernet addresses fit in here nicely, use
* it also for an ethernet MAC address. */
guint8 addr_eth[6 /*ETH_ALEN*/];
};
} NMIPAddr;
extern const NMIPAddr nm_ip_addr_zero;
#define NMIPAddrInit { .addr6 = IN6ADDR_ANY_INIT }
#define NM_PLATFORM_LINK_OTHER_NETNS (-1)
#define __NMPlatformObject_COMMON \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment