mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-09 18:10:21 +01:00
core: move NMIPAddr to nm-core-utils.h
This commit is contained in:
parent
5fc4bfc0e3
commit
67da0a28db
4 changed files with 23 additions and 22 deletions
|
|
@ -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 \
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue