Commit 90bd1ad5 authored by Dan Winship's avatar Dan Winship
Browse files

Install and fix up libnm-util IPv6 config stuff

parent e324f783
......@@ -34,8 +34,10 @@
#define DBUS_TYPE_G_MAP_OF_STRING (dbus_g_type_get_map ("GHashTable", G_TYPE_STRING, G_TYPE_STRING))
#define DBUS_TYPE_G_LIST_OF_STRING (dbus_g_type_get_collection ("GSList", G_TYPE_STRING))
#define DBUS_TYPE_G_IP6_ADDRESS (dbus_g_type_get_struct ("GValueArray", DBUS_TYPE_G_UCHAR_ARRAY, G_TYPE_UINT, DBUS_TYPE_G_UCHAR_ARRAY, G_TYPE_INVALID))
#define DBUS_TYPE_G_IP6_ADDRESS (dbus_g_type_get_struct ("GValueArray", DBUS_TYPE_G_UCHAR_ARRAY, G_TYPE_UINT, G_TYPE_INVALID))
#define DBUS_TYPE_G_ARRAY_OF_IP6_ADDRESS (dbus_g_type_get_collection ("GPtrArray", DBUS_TYPE_G_IP6_ADDRESS))
#define DBUS_TYPE_G_IP6_ROUTE (dbus_g_type_get_struct ("GValueArray", DBUS_TYPE_G_UCHAR_ARRAY, G_TYPE_UINT, DBUS_TYPE_G_UCHAR_ARRAY, G_TYPE_UINT, G_TYPE_INVALID))
#define DBUS_TYPE_G_ARRAY_OF_IP6_ROUTE (dbus_g_type_get_collection ("GPtrArray", DBUS_TYPE_G_IP6_ROUTE))
#endif /* DBUS_GLIB_TYPES_H */
......@@ -17,6 +17,7 @@ libnm_util_include_HEADERS = \
nm-setting-bluetooth.h \
nm-setting-connection.h \
nm-setting-ip4-config.h \
nm-setting-ip6-config.h \
nm-setting-ppp.h \
nm-setting-pppoe.h \
nm-setting-serial.h \
......@@ -106,5 +107,5 @@ pkgconfig_DATA = libnm-util.pc
DISTCLEANFILES = libnm-util.pc
EXTRA_DIST = libnm-util.pc.in libnm-util.ver nm-setting-ip6-config.h
EXTRA_DIST = libnm-util.pc.in libnm-util.ver
......@@ -140,6 +140,56 @@ global:
nm_setting_ip4_config_get_dhcp_hostname;
nm_setting_ip4_config_get_dhcp_send_hostname;
nm_setting_ip4_config_get_never_default;
nm_setting_ip6_config_error_get_type;
nm_setting_ip6_config_error_quark;
nm_ip6_address_new;
nm_ip6_address_dup;
nm_ip6_address_ref;
nm_ip6_address_unref;
nm_ip6_address_compare;
nm_ip6_address_get_address;
nm_ip6_address_set_address;
nm_ip6_address_get_prefix;
nm_ip6_address_set_prefix;
nm_ip6_route_new;
nm_ip6_route_dup;
nm_ip6_route_ref;
nm_ip6_route_unref;
nm_ip6_route_compare;
nm_ip6_route_get_dest;
nm_ip6_route_set_dest;
nm_ip6_route_get_prefix;
nm_ip6_route_set_prefix;
nm_ip6_route_get_next_hop;
nm_ip6_route_set_next_hop;
nm_ip6_route_get_metric;
nm_ip6_route_set_metric;
nm_setting_ip6_config_get_type;
nm_setting_ip6_config_new;
nm_setting_ip6_config_get_method;
nm_setting_ip6_config_get_num_dns;
nm_setting_ip6_config_get_dns;
nm_setting_ip6_config_add_dns;
nm_setting_ip6_config_remove_dns;
nm_setting_ip6_config_clear_dns;
nm_setting_ip6_config_get_num_dns_searches;
nm_setting_ip6_config_get_dns_search;
nm_setting_ip6_config_add_dns_search;
nm_setting_ip6_config_remove_dns_search;
nm_setting_ip6_config_clear_dns_searches;
nm_setting_ip6_config_get_num_addresses;
nm_setting_ip6_config_get_address;
nm_setting_ip6_config_add_address;
nm_setting_ip6_config_remove_address;
nm_setting_ip6_config_clear_addresses;
nm_setting_ip6_config_get_num_routes;
nm_setting_ip6_config_get_route;
nm_setting_ip6_config_add_route;
nm_setting_ip6_config_remove_route;
nm_setting_ip6_config_clear_routes;
nm_setting_ip6_config_get_ignore_auto_routes;
nm_setting_ip6_config_get_ignore_auto_dns;
nm_setting_ip6_config_get_never_default;
nm_setting_need_secrets;
nm_setting_ppp_error_get_type;
nm_setting_ppp_error_quark;
......@@ -263,6 +313,10 @@ global:
nm_utils_ip4_prefix_to_netmask;
nm_utils_ip4_routes_from_gvalue;
nm_utils_ip4_routes_to_gvalue;
nm_utils_ip6_addresses_from_gvalue;
nm_utils_ip6_addresses_to_gvalue;
nm_utils_ip6_routes_from_gvalue;
nm_utils_ip6_routes_to_gvalue;
nm_utils_is_empty_ssid;
nm_utils_same_ssid;
nm_utils_security_valid;
......
......@@ -266,6 +266,11 @@ register_default_settings (void)
NM_SETTING_IP4_CONFIG_ERROR,
6);
register_one_setting (NM_SETTING_IP6_CONFIG_SETTING_NAME,
NM_TYPE_SETTING_IP6_CONFIG,
NM_SETTING_IP6_CONFIG_ERROR,
6);
/* Be sure to update DEFAULT_MAP_SIZE if you add another setting!! */
}
......
......@@ -30,13 +30,6 @@
#include "nm-utils.h"
#include "nm-dbus-glib-types.h"
GSList *nm_utils_ip6_addresses_from_gvalue (const GValue *value);
void nm_utils_ip6_addresses_to_gvalue (GSList *list, GValue *value);
GSList *nm_utils_ip6_dns_from_gvalue (const GValue *value);
void nm_utils_ip6_dns_to_gvalue (GSList *list, GValue *value);
GQuark
nm_setting_ip6_config_error_quark (void)
{
......@@ -83,9 +76,9 @@ typedef struct {
GSList *dns_search; /* list of strings */
GSList *addresses; /* array of NMIP6Address */
GSList *routes; /* array of NMIP6Route */
gboolean ignore_auto_routes;
gboolean ignore_auto_dns;
gboolean ignore_ra;
char *dhcp_mode;
gboolean never_default;
} NMSettingIP6ConfigPrivate;
......@@ -96,9 +89,9 @@ enum {
PROP_DNS_SEARCH,
PROP_ADDRESSES,
PROP_ROUTES,
PROP_IGNORE_AUTO_ROUTES,
PROP_IGNORE_AUTO_DNS,
PROP_IGNORE_ROUTER_ADV,
PROP_DHCP_MODE,
PROP_NEVER_DEFAULT,
LAST_PROP
};
......@@ -398,27 +391,27 @@ nm_setting_ip6_config_clear_routes (NMSettingIP6Config *setting)
}
gboolean
nm_setting_ip6_config_get_ignore_auto_dns (NMSettingIP6Config *setting)
nm_setting_ip6_config_get_ignore_auto_routes (NMSettingIP6Config *setting)
{
g_return_val_if_fail (NM_IS_SETTING_IP6_CONFIG (setting), FALSE);
return NM_SETTING_IP6_CONFIG_GET_PRIVATE (setting)->ignore_auto_dns;
return NM_SETTING_IP6_CONFIG_GET_PRIVATE (setting)->ignore_auto_routes;
}
gboolean
nm_setting_ip6_config_get_ignore_router_adv (NMSettingIP6Config *setting)
nm_setting_ip6_config_get_ignore_auto_dns (NMSettingIP6Config *setting)
{
g_return_val_if_fail (NM_IS_SETTING_IP6_CONFIG (setting), FALSE);
return NM_SETTING_IP6_CONFIG_GET_PRIVATE (setting)->ignore_ra;
return NM_SETTING_IP6_CONFIG_GET_PRIVATE (setting)->ignore_auto_dns;
}
const char *
nm_setting_ip6_config_get_dhcp_mode (NMSettingIP6Config *setting)
gboolean
nm_setting_ip6_config_get_never_default (NMSettingIP6Config *setting)
{
g_return_val_if_fail (NM_IS_SETTING_IP6_CONFIG (setting), FALSE);
return NM_SETTING_IP6_CONFIG_GET_PRIVATE (setting)->dhcp_mode;
return NM_SETTING_IP6_CONFIG_GET_PRIVATE (setting)->never_default;
}
static gboolean
......@@ -443,6 +436,7 @@ verify (NMSetting *setting, GSList *all_settings, GError **error)
return FALSE;
}
} else if ( !strcmp (priv->method, NM_SETTING_IP6_CONFIG_METHOD_AUTO)
|| !strcmp (priv->method, NM_SETTING_IP6_CONFIG_METHOD_LINK_LOCAL)
|| !strcmp (priv->method, NM_SETTING_IP6_CONFIG_METHOD_SHARED)) {
if (!priv->ignore_auto_dns) {
if (priv->dns && g_slist_length (priv->dns)) {
......@@ -469,17 +463,6 @@ verify (NMSetting *setting, GSList *all_settings, GError **error)
NM_SETTING_IP6_CONFIG_ADDRESSES);
return FALSE;
}
/* if router advertisement autoconf is disabled, dhcpv6 mode must
* be SOMETHING as long as the user has selected the auto method
*/
if (priv->ignore_ra && (priv->dhcp_mode == NULL)) {
g_set_error (error,
NM_SETTING_IP6_CONFIG_ERROR,
NM_SETTING_IP6_CONFIG_ERROR_INVALID_PROPERTY,
NM_SETTING_IP6_CONFIG_DHCP_MODE);
return FALSE;
}
} else {
g_set_error (error,
NM_SETTING_IP6_CONFIG_ERROR,
......@@ -540,17 +523,16 @@ set_property (GObject *object, guint prop_id,
break;
case PROP_ROUTES:
nm_utils_slist_free (priv->routes, g_free);
priv->routes = nm_utils_ip6_addresses_from_gvalue (value);
priv->routes = nm_utils_ip6_routes_from_gvalue (value);
break;
case PROP_IGNORE_AUTO_ROUTES:
priv->ignore_auto_routes = g_value_get_boolean (value);
break;
case PROP_IGNORE_AUTO_DNS:
priv->ignore_auto_dns = g_value_get_boolean (value);
break;
case PROP_IGNORE_ROUTER_ADV:
priv->ignore_ra = g_value_get_boolean (value);
break;
case PROP_DHCP_MODE:
g_free (priv->dhcp_mode);
priv->dhcp_mode = g_value_dup_string (value);
case PROP_NEVER_DEFAULT:
priv->never_default = g_value_get_boolean (value);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
......@@ -578,16 +560,16 @@ get_property (GObject *object, guint prop_id,
nm_utils_ip6_addresses_to_gvalue (priv->addresses, value);
break;
case PROP_ROUTES:
nm_utils_ip6_addresses_to_gvalue (priv->routes, value);
nm_utils_ip6_routes_to_gvalue (priv->routes, value);
break;
case PROP_IGNORE_AUTO_ROUTES:
g_value_set_boolean (value, priv->ignore_auto_routes);
break;
case PROP_IGNORE_AUTO_DNS:
g_value_set_boolean (value, priv->ignore_auto_dns);
break;
case PROP_IGNORE_ROUTER_ADV:
g_value_set_boolean (value, priv->ignore_ra);
break;
case PROP_DHCP_MODE:
g_value_set_string (value, priv->dhcp_mode);
case PROP_NEVER_DEFAULT:
g_value_set_boolean (value, priv->never_default);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
......@@ -601,6 +583,8 @@ nm_setting_ip6_config_class_init (NMSettingIP6ConfigClass *setting_class)
GObjectClass *object_class = G_OBJECT_CLASS (setting_class);
NMSettingClass *parent_class = NM_SETTING_CLASS (setting_class);
g_type_class_add_private (setting_class, sizeof (NMSettingIP6ConfigPrivate));
/* virtual methods */
object_class->set_property = set_property;
object_class->get_property = get_property;
......@@ -645,39 +629,39 @@ nm_setting_ip6_config_class_init (NMSettingIP6ConfigClass *setting_class)
_nm_param_spec_specialized (NM_SETTING_IP6_CONFIG_ROUTES,
"Routes",
"List of NMSettingIP6Addresses",
DBUS_TYPE_G_ARRAY_OF_IP6_ADDRESS,
DBUS_TYPE_G_ARRAY_OF_IP6_ROUTE,
G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE));
g_object_class_install_property
(object_class, PROP_IGNORE_AUTO_ROUTES,
g_param_spec_boolean (NM_SETTING_IP6_CONFIG_IGNORE_AUTO_ROUTES,
"Ignore automatic routes",
"Ignore automatic routes",
FALSE,
G_PARAM_READWRITE | G_PARAM_CONSTRUCT | NM_SETTING_PARAM_SERIALIZE));
g_object_class_install_property
(object_class, PROP_IGNORE_AUTO_DNS,
g_param_spec_boolean (NM_SETTING_IP6_CONFIG_IGNORE_AUTO_DNS,
"Ignore DHCPv6 DNS",
"Ignore DHCPv6 DNS",
"Ignore DHCPv6/RDNSS DNS",
"Ignore DHCPv6/RDNSS DNS",
FALSE,
G_PARAM_READWRITE | G_PARAM_CONSTRUCT | NM_SETTING_PARAM_SERIALIZE));
g_object_class_install_property
(object_class, PROP_IGNORE_ROUTER_ADV,
g_param_spec_boolean (NM_SETTING_IP6_CONFIG_IGNORE_ROUTER_ADV,
"Ignore Router Advertisements",
"Ignore Router Advertisements",
(object_class, PROP_NEVER_DEFAULT,
g_param_spec_boolean (NM_SETTING_IP6_CONFIG_NEVER_DEFAULT,
"Never default",
"Never make this connection the default IPv6 connection",
FALSE,
G_PARAM_READWRITE | G_PARAM_CONSTRUCT | NM_SETTING_PARAM_SERIALIZE));
g_object_class_install_property
(object_class, PROP_DHCP_MODE,
g_param_spec_string (NM_SETTING_IP6_CONFIG_DHCP_MODE,
"DHCPv6 Client Mode",
"DHCPv6 Client Mode",
NULL,
G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE));
}
struct NMIP6Address {
guint32 refcount;
struct in6_addr *address; /* network byte order */
struct in6_addr address;
guint32 prefix;
struct in6_addr *gateway; /* network byte order */
};
NMIP6Address *
......@@ -700,16 +684,7 @@ nm_ip6_address_dup (NMIP6Address *source)
address = nm_ip6_address_new ();
address->prefix = source->prefix;
if (source->address) {
address->address = g_malloc0 (sizeof (struct in6_addr));
memcpy (address->address, source->address, sizeof (struct in6_addr));
}
if (source->gateway) {
address->gateway = g_malloc0 (sizeof (struct in6_addr));
memcpy (address->gateway, source->gateway, sizeof (struct in6_addr));
}
memcpy (&address->address, &source->address, sizeof (struct in6_addr));
return address;
}
......@@ -731,8 +706,6 @@ nm_ip6_address_unref (NMIP6Address *address)
address->refcount--;
if (address->refcount == 0) {
g_free (address->address);
g_free (address->gateway);
memset (address, 0, sizeof (NMIP6Address));
g_free (address);
}
......@@ -747,9 +720,8 @@ nm_ip6_address_compare (NMIP6Address *address, NMIP6Address *other)
g_return_val_if_fail (other != NULL, FALSE);
g_return_val_if_fail (other->refcount > 0, FALSE);
if ( memcmp (address->address, other->address, sizeof (struct in6_addr))
|| address->prefix != other->prefix
|| memcmp (address->gateway, other->gateway, sizeof (struct in6_addr)))
if ( memcmp (&address->address, &other->address, sizeof (struct in6_addr))
|| address->prefix != other->prefix)
return FALSE;
return TRUE;
}
......@@ -760,7 +732,7 @@ nm_ip6_address_get_address (NMIP6Address *address)
g_return_val_if_fail (address != NULL, 0);
g_return_val_if_fail (address->refcount > 0, 0);
return address->address;
return &address->address;
}
void
......@@ -768,14 +740,9 @@ nm_ip6_address_set_address (NMIP6Address *address, const struct in6_addr *addr)
{
g_return_if_fail (address != NULL);
g_return_if_fail (address->refcount > 0);
g_return_if_fail (addr != NULL);
g_free (address->address);
address->address = NULL;
if (addr) {
address->address = g_malloc0 (sizeof (struct in6_addr));
memcpy (address->address, addr, sizeof (struct in6_addr));
}
memcpy (&address->address, addr, sizeof (struct in6_addr));
}
guint32
......@@ -796,37 +763,12 @@ nm_ip6_address_set_prefix (NMIP6Address *address, guint32 prefix)
address->prefix = prefix;
}
const struct in6_addr *
nm_ip6_address_get_gateway (NMIP6Address *address)
{
g_return_val_if_fail (address != NULL, 0);
g_return_val_if_fail (address->refcount > 0, 0);
return address->gateway;
}
void
nm_ip6_address_set_gateway (NMIP6Address *address, const struct in6_addr *gateway)
{
g_return_if_fail (address != NULL);
g_return_if_fail (address->refcount > 0);
g_free (address->gateway);
address->gateway = NULL;
if (gateway) {
address->gateway = g_malloc0 (sizeof (struct in6_addr));
memcpy (address->gateway, gateway, sizeof (struct in6_addr));
}
}
struct NMIP6Route {
guint32 refcount;
struct in6_addr *dest; /* network byte order */
struct in6_addr dest;
guint32 prefix;
struct in6_addr *next_hop; /* network byte order */
struct in6_addr next_hop;
guint32 metric; /* lower metric == more preferred */
};
......@@ -851,16 +793,8 @@ nm_ip6_route_dup (NMIP6Route *source)
route = nm_ip6_route_new ();
route->prefix = source->prefix;
route->metric = source->metric;
if (source->dest) {
route->dest = g_malloc0 (sizeof (struct in6_addr));
memcpy (route->dest, source->dest, sizeof (struct in6_addr));
}
if (source->next_hop) {
route->next_hop = g_malloc0 (sizeof (struct in6_addr));
memcpy (route->next_hop, source->next_hop, sizeof (struct in6_addr));
}
memcpy (&route->dest, &source->dest, sizeof (struct in6_addr));
memcpy (&route->next_hop, &source->next_hop, sizeof (struct in6_addr));
return route;
}
......@@ -882,8 +816,6 @@ nm_ip6_route_unref (NMIP6Route *route)
route->refcount--;
if (route->refcount == 0) {
g_free (route->dest);
g_free (route->next_hop);
memset (route, 0, sizeof (NMIP6Route));
g_free (route);
}
......@@ -898,9 +830,9 @@ nm_ip6_route_compare (NMIP6Route *route, NMIP6Route *other)
g_return_val_if_fail (other != NULL, FALSE);
g_return_val_if_fail (other->refcount > 0, FALSE);
if ( memcmp (route->dest, other->dest, sizeof (struct in6_addr))
if ( memcmp (&route->dest, &other->dest, sizeof (struct in6_addr))
|| route->prefix != other->prefix
|| memcmp (route->next_hop, other->next_hop, sizeof (struct in6_addr))
|| memcmp (&route->next_hop, &other->next_hop, sizeof (struct in6_addr))
|| route->metric != other->metric)
return FALSE;
return TRUE;
......@@ -912,7 +844,7 @@ nm_ip6_route_get_dest (NMIP6Route *route)
g_return_val_if_fail (route != NULL, 0);
g_return_val_if_fail (route->refcount > 0, 0);
return route->dest;
return &route->dest;
}
void
......@@ -920,14 +852,9 @@ nm_ip6_route_set_dest (NMIP6Route *route, const struct in6_addr *dest)
{
g_return_if_fail (route != NULL);
g_return_if_fail (route->refcount > 0);
g_return_if_fail (dest != NULL);
g_free (route->dest);
route->dest = NULL;
if (dest) {
route->dest = g_malloc0 (sizeof (struct in6_addr));
memcpy (route->dest, dest, sizeof (struct in6_addr));
}
memcpy (&route->dest, dest, sizeof (struct in6_addr));
}
guint32
......@@ -954,7 +881,7 @@ nm_ip6_route_get_next_hop (NMIP6Route *route)
g_return_val_if_fail (route != NULL, 0);
g_return_val_if_fail (route->refcount > 0, 0);
return route->next_hop;
return &route->next_hop;
}
void
......@@ -962,14 +889,9 @@ nm_ip6_route_set_next_hop (NMIP6Route *route, const struct in6_addr *next_hop)
{
g_return_if_fail (route != NULL);
g_return_if_fail (route->refcount > 0);
g_return_if_fail (next_hop != NULL);
g_free (route->next_hop);
route->next_hop = NULL;
if (next_hop) {
route->next_hop = g_malloc0 (sizeof (struct in6_addr));
memcpy (route->next_hop, next_hop, sizeof (struct in6_addr));
}
memcpy (&route->next_hop, next_hop, sizeof (struct in6_addr));
}
guint32
......@@ -989,4 +911,3 @@ nm_ip6_route_set_metric (NMIP6Route *route, guint32 metric)
route->metric = metric;
}
......@@ -54,21 +54,20 @@ GType nm_setting_ip6_config_error_get_type (void);
#define NM_SETTING_IP6_CONFIG_ERROR nm_setting_ip6_config_error_quark ()
GQuark nm_setting_ip6_config_error_quark (void);
#define NM_SETTING_IP6_CONFIG_METHOD "method"
#define NM_SETTING_IP6_CONFIG_DNS "dns"
#define NM_SETTING_IP6_CONFIG_DNS_SEARCH "dns-search"
#define NM_SETTING_IP6_CONFIG_ADDRESSES "addresses"
#define NM_SETTING_IP6_CONFIG_ROUTES "routes"
#define NM_SETTING_IP6_CONFIG_IGNORE_AUTO_DNS "ignore-auto-dns"
#define NM_SETTING_IP6_CONFIG_IGNORE_ROUTER_ADV "ignore-router-adv"
#define NM_SETTING_IP6_CONFIG_DHCP_MODE "dhcp-mode"
#define NM_SETTING_IP6_CONFIG_METHOD_AUTO "auto"
#define NM_SETTING_IP6_CONFIG_METHOD_MANUAL "manual"
#define NM_SETTING_IP6_CONFIG_METHOD_SHARED "shared"
#define NM_SETTING_IP6_CONFIG_DHCPV6_MODE_INFO "info"
#define NM_SETTING_IP6_CONFIG_DHCPV6_MODE_REQUEST "request"
#define NM_SETTING_IP6_CONFIG_METHOD "method"
#define NM_SETTING_IP6_CONFIG_DNS "dns"
#define NM_SETTING_IP6_CONFIG_DNS_SEARCH "dns-search"
#define NM_SETTING_IP6_CONFIG_ADDRESSES "addresses"
#define NM_SETTING_IP6_CONFIG_ROUTES "routes"
#define NM_SETTING_IP6_CONFIG_IGNORE_AUTO_ROUTES "ignore-auto-routes"
#define NM_SETTING_IP6_CONFIG_IGNORE_AUTO_DNS "ignore-auto-dns"
#define NM_SETTING_IP6_CONFIG_NEVER_DEFAULT "never-default"
#define NM_SETTING_IP6_CONFIG_METHOD_IGNORE "ignore"
#define NM_SETTING_IP6_CONFIG_METHOD_AUTO "auto"
#define NM_SETTING_IP6_CONFIG_METHOD_LINK_LOCAL "link-local"
#define NM_SETTING_IP6_CONFIG_METHOD_MANUAL "manual"
#define NM_SETTING_IP6_CONFIG_METHOD_SHARED "shared"
typedef struct NMIP6Address NMIP6Address;
......@@ -82,16 +81,12 @@ gboolean nm_ip6_address_compare (NMIP6Address *address, NMIP6A
const struct in6_addr *nm_ip6_address_get_address (NMIP6Address *address);
void nm_ip6_address_set_address (NMIP6Address *address,
const struct in6_addr *addr); /* network byte order */
const struct in6_addr *addr);
guint32 nm_ip6_address_get_prefix (NMIP6Address *address);
void nm_ip6_address_set_prefix (NMIP6Address *address,
guint32 prefix);
const struct in6_addr *nm_ip6_address_get_gateway (NMIP6Address *address);
void nm_ip6_address_set_gateway (NMIP6Address *address,
const struct in6_addr *addr); /* network byte order */
typedef struct NMIP6Route NMIP6Route;
NMIP6Route * nm_ip6_route_new (void);
......@@ -103,7 +98,7 @@ gboolean nm_ip6_route_compare (NMIP6Route *route, NMIP6Route
const struct in6_addr *nm_ip6_route_get_dest (NMIP6Route *route);
void nm_ip6_route_set_dest (NMIP6Route *route,
const struct in6_addr *dest); /* network byte order */
const struct in6_addr *dest);
guint32 nm_ip6_route_get_prefix (NMIP6Route *route);
void nm_ip6_route_set_prefix (NMIP6Route *route,
......@@ -111,7 +106,7 @@ void nm_ip6_route_set_prefix (NMIP6Route *route,
const struct in6_addr *nm_ip6_route_get_next_hop (NMIP6Route *route);
void nm_ip6_route_set_next_hop (NMIP6Route *route,
const struct in6_addr *next_hop); /* network byte order */
const struct in6_addr *next_hop);
guint32 nm_ip6_route_get_metric (NMIP6Route *route);
void nm_ip6_route_set_metric (NMIP6Route *route,
......@@ -125,40 +120,38 @@ typedef struct {
NMSettingClass parent;
} NMSettingIP6ConfigClass;
/* IPv6 support is currently incomplete. Do not use. */
GType nm_setting_ip6_config_get_type (void);
NMSetting * nm_setting_ip6_config_new (void);
const char * nm_setting_ip6_config_get_method (NMSettingIP6Config *setting);
guint32 nm_setting_ip6_config_get_num_dns (NMSettingIP6Config *setting);
const struct in6_addr *nm_setting_ip6_config_get_dns (NMSettingIP6Config *setting, guint32 i);
gboolean nm_setting_ip6_config_add_dns (NMSettingIP6Config *setting, const struct in6_addr *dns);
void nm_setting_ip6_config_remove_dns (NMSettingIP6Config *setting, guint32 i);
void nm_setting_ip6_config_clear_dns (NMSettingIP6Config *setting);
guint32 nm_setting_ip6_config_get_num_dns_searches (NMSettingIP6Config *setting);
const char * nm_setting_ip6_config_get_dns_search (NMSettingIP6Config *setting, guint32 i);
gboolean nm_setting_ip6_config_add_dns_search (NMSettingIP6Config *setting, const char *dns_search);
void nm_setting_ip6_config_remove_dns_search (NMSettingIP6Config *setting, guint32 i);
void nm_setting_ip6_config_clear_dns_searches (NMSettingIP6Config *setting);
guint32 nm_setting_ip6_config_get_num_addresses (NMSettingIP6Config *setting);
NMIP6Address * nm_setting_ip6_config_get_address (NMSettingIP6Config *setting, guint32 i);
gboolean nm_setting_ip6_config_add_address (NMSettingIP6Config *setting, NMIP6Address *address);
void nm_setting_ip6_config_remove_address (NMSettingIP6Config *setting, guint32 i);
void nm_setting_ip6_config_clear_addresses (NMSettingIP6Config *setting);
guint32 nm_setting_ip6_config_get_num_routes (NMSettingIP6Config *setting);
NMIP6Route * nm_setting_ip6_config_get_route (NMSettingIP6Config *setting, guint32 i);
gboolean nm_setting_ip6_config_add_route (NMSettingIP6Config *setting, NMIP6Route *route);
void nm_setting_ip6_config_remove_route (NMSettingIP6Config *setting, guint32 i);
void nm_setting_ip6_config_clear_routes (NMSettingIP6Config *setting);
gboolean nm_setting_ip6_config_get_ignore_auto_dns (NMSettingIP6Config *setting);
gboolean nm_setting_ip6_config_get_ignore_router_adv (NMSettingIP6Config *setting);
const char * nm_setting_ip6_config_get_dhcp_mode (NMSettingIP6Config *setting);
NMSetting * nm_setting_ip6_config_new (void);
const char * nm_setting_ip6_config_get_method (NMSettingIP6Config *setting);
guint32 nm_setting_ip6_config_get_num_dns (NMSettingIP6Config *setting);