diff options
Diffstat (limited to 'src/NetworkManagerUtils.h')
| -rw-r--r-- | src/NetworkManagerUtils.h | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/NetworkManagerUtils.h b/src/NetworkManagerUtils.h index f1cd62a263..6e80069f57 100644 --- a/src/NetworkManagerUtils.h +++ b/src/NetworkManagerUtils.h @@ -27,6 +27,7 @@ #include <net/ethernet.h> #include "nm-connection.h" +#include "nm-platform.h" gboolean nm_ethernet_address_is_valid (const struct ether_addr *test_addr); @@ -131,4 +132,35 @@ const char *nm_utils_ip6_property_path (const char *ifname, const char *property gboolean nm_utils_is_specific_hostname (const char *name); +/* IPv6 Interface Identifer helpers */ + +/** + * NMUtilsIPv6IfaceId: + * @id: convenience member for validity checking; never use directly + * @id_u8: the 64-bit Interface Identifier + * + * Holds a 64-bit IPv6 Interface Identifier. The IID is a sequence of bytes + * and should not normally be treated as a %guint64, but this is done for + * convenience of validity checking and initialization. + */ +typedef struct { + union { + guint64 id; + guint8 id_u8[8]; + }; +} NMUtilsIPv6IfaceId; + +#define NM_UTILS_IPV6_IFACE_ID_INIT { .id = 0 }; + +gboolean nm_utils_get_ipv6_interface_identifier (NMLinkType link_type, + const guint8 *hwaddr, + guint len, + NMUtilsIPv6IfaceId *out_iid); + +void nm_utils_ipv6_addr_set_interface_identfier (struct in6_addr *addr, + const NMUtilsIPv6IfaceId iid); + +void nm_utils_ipv6_interface_identfier_get_from_addr (NMUtilsIPv6IfaceId *iid, + const struct in6_addr *addr); + #endif /* NETWORK_MANAGER_UTILS_H */ |
