NetworkManager r4240 - in trunk: . libnm-util src
- From: dcbw svn gnome org
- To: svn-commits-list gnome org
- Subject: NetworkManager r4240 - in trunk: . libnm-util src
- Date: Thu, 30 Oct 2008 19:39:51 +0000 (UTC)
Author: dcbw
Date: Thu Oct 30 19:39:51 2008
New Revision: 4240
URL: http://svn.gnome.org/viewvc/NetworkManager?rev=4240&view=rev
Log:
2008-10-30 Dan Williams <dcbw redhat com>
* libnm-util/libnm-util.ver
libnm-util/nm-setting-ip6-config.c
libnm-util/nm-setting-ip6-config.h
libnm-util/Makefile.am
- Make properties private and add accessor functions
- Hide IPv6 stuff from public API, it's incomplete and completely unused
* libnm-util/nm-connection.c
libnm-util/nm-utils.c
libnm-util/nm-utils.h
- Ignore IPv6 stuff for now
Modified:
trunk/ChangeLog
trunk/libnm-util/Makefile.am
trunk/libnm-util/libnm-util.ver
trunk/libnm-util/nm-connection.c
trunk/libnm-util/nm-setting-ip6-config.c
trunk/libnm-util/nm-setting-ip6-config.h
trunk/libnm-util/nm-utils.c
trunk/libnm-util/nm-utils.h
trunk/src/nm-device-wifi.c
Modified: trunk/libnm-util/Makefile.am
==============================================================================
--- trunk/libnm-util/Makefile.am (original)
+++ trunk/libnm-util/Makefile.am Thu Oct 30 19:39:51 2008
@@ -15,7 +15,6 @@
nm-setting-8021x.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 \
@@ -91,5 +90,5 @@
DISTCLEANFILES = libnm-util.pc
-EXTRA_DIST = libnm-util.pc.in libnm-util.ver
+EXTRA_DIST = libnm-util.pc.in libnm-util.ver nm-setting-ip6-config.h
Modified: trunk/libnm-util/libnm-util.ver
==============================================================================
--- trunk/libnm-util/libnm-util.ver (original)
+++ trunk/libnm-util/libnm-util.ver Thu Oct 30 19:39:51 2008
@@ -125,10 +125,6 @@
nm_setting_ip4_config_get_ignore_auto_dns;
nm_setting_ip4_config_get_dhcp_client_id;
nm_setting_ip4_config_get_dhcp_hostname;
- nm_setting_ip6_config_error_get_type;
- nm_setting_ip6_config_error_quark;
- nm_setting_ip6_config_get_type;
- nm_setting_ip6_config_new;
nm_setting_need_secrets;
nm_setting_ppp_error_get_type;
nm_setting_ppp_error_quark;
@@ -253,10 +249,6 @@
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_dns_from_gvalue;
- nm_utils_ip6_dns_to_gvalue;
nm_utils_is_empty_ssid;
nm_utils_register_value_transformations;
nm_utils_same_ssid;
Modified: trunk/libnm-util/nm-connection.c
==============================================================================
--- trunk/libnm-util/nm-connection.c (original)
+++ trunk/libnm-util/nm-connection.c Thu Oct 30 19:39:51 2008
@@ -107,7 +107,7 @@
static GHashTable *registered_settings = NULL;
-#define DEFAULT_MAP_SIZE 14
+#define DEFAULT_MAP_SIZE 13
static struct SettingInfo {
const char *name;
@@ -201,11 +201,6 @@
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,
- 7);
-
/* Be sure to update DEFAULT_MAP_SIZE if you add another setting!! */
}
Modified: trunk/libnm-util/nm-setting-ip6-config.c
==============================================================================
--- trunk/libnm-util/nm-setting-ip6-config.c (original)
+++ trunk/libnm-util/nm-setting-ip6-config.c Thu Oct 30 19:39:51 2008
@@ -30,6 +30,13 @@
#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)
{
@@ -68,6 +75,20 @@
G_DEFINE_TYPE (NMSettingIP6Config, nm_setting_ip6_config, NM_TYPE_SETTING)
+#define NM_SETTING_IP6_CONFIG_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SETTING_IP6_CONFIG, NMSettingIP6ConfigPrivate))
+
+typedef struct {
+ char *method;
+ GSList *dns; /* array of struct in6_addr */
+ GSList *dns_search; /* list of strings */
+ GSList *addresses; /* array of NMIP6Address */
+ GSList *routes; /* array of NMIP6Route */
+ gboolean ignore_auto_dns;
+ gboolean ignore_ra;
+ char *dhcp_mode;
+} NMSettingIP6ConfigPrivate;
+
+
enum {
PROP_0,
PROP_METHOD,
@@ -75,9 +96,9 @@
PROP_DNS_SEARCH,
PROP_ADDRESSES,
PROP_ROUTES,
- PROP_IGNORE_DHCPV6_DNS,
- PROP_DISABLE_RA,
- PROP_DHCPV6_MODE,
+ PROP_IGNORE_AUTO_DNS,
+ PROP_IGNORE_ROUTER_ADV,
+ PROP_DHCP_MODE,
LAST_PROP
};
@@ -88,12 +109,324 @@
return (NMSetting *) g_object_new (NM_TYPE_SETTING_IP6_CONFIG, NULL);
}
+const char *
+nm_setting_ip6_config_get_method (NMSettingIP6Config *setting)
+{
+ g_return_val_if_fail (NM_IS_SETTING_IP6_CONFIG (setting), NULL);
+
+ return NM_SETTING_IP6_CONFIG_GET_PRIVATE (setting)->method;
+}
+
+guint32
+nm_setting_ip6_config_get_num_dns (NMSettingIP6Config *setting)
+{
+ g_return_val_if_fail (NM_IS_SETTING_IP6_CONFIG (setting), 0);
+
+ return g_slist_length (NM_SETTING_IP6_CONFIG_GET_PRIVATE (setting)->dns);
+}
+
+const struct in6_addr *
+nm_setting_ip6_config_get_dns (NMSettingIP6Config *setting, guint32 i)
+{
+ NMSettingIP6ConfigPrivate *priv;
+
+
+ g_return_val_if_fail (NM_IS_SETTING_IP6_CONFIG (setting), 0);
+
+ priv = NM_SETTING_IP6_CONFIG_GET_PRIVATE (setting);
+ g_return_val_if_fail (i <= g_slist_length (priv->dns), NULL);
+
+ return (const struct in6_addr *) g_slist_nth_data (priv->dns, i);
+}
+
+gboolean
+nm_setting_ip6_config_add_dns (NMSettingIP6Config *setting, const struct in6_addr *addr)
+{
+ NMSettingIP6ConfigPrivate *priv;
+ struct in6_addr *copy;
+ GSList *iter;
+
+ g_return_val_if_fail (NM_IS_SETTING_IP6_CONFIG (setting), FALSE);
+
+ priv = NM_SETTING_IP6_CONFIG_GET_PRIVATE (setting);
+ for (iter = priv->dns; iter; iter = g_slist_next (iter)) {
+ if (!memcmp (addr, (struct in6_addr *) iter->data, sizeof (struct in6_addr)))
+ return FALSE;
+ }
+
+ copy = g_malloc0 (sizeof (struct in6_addr));
+ memcpy (copy, addr, sizeof (struct in6_addr));
+ priv->dns = g_slist_append (priv->dns, copy);
+
+ return TRUE;
+}
+
+void
+nm_setting_ip6_config_remove_dns (NMSettingIP6Config *setting, guint32 i)
+{
+ NMSettingIP6ConfigPrivate *priv;
+ GSList *elt;
+
+ g_return_if_fail (NM_IS_SETTING_IP6_CONFIG (setting));
+
+ priv = NM_SETTING_IP6_CONFIG_GET_PRIVATE (setting);
+ elt = g_slist_nth (priv->dns, i);
+ g_return_if_fail (elt != NULL);
+
+ g_free (elt->data);
+ priv->dns = g_slist_delete_link (priv->dns, elt);
+}
+
+void
+nm_setting_ip6_config_clear_dns (NMSettingIP6Config *setting)
+{
+ g_return_if_fail (NM_IS_SETTING_IP6_CONFIG (setting));
+
+ nm_utils_slist_free (NM_SETTING_IP6_CONFIG_GET_PRIVATE (setting)->dns, g_free);
+ NM_SETTING_IP6_CONFIG_GET_PRIVATE (setting)->dns = NULL;
+}
+
+guint32
+nm_setting_ip6_config_get_num_dns_searches (NMSettingIP6Config *setting)
+{
+ g_return_val_if_fail (NM_IS_SETTING_IP6_CONFIG (setting), 0);
+
+ return g_slist_length (NM_SETTING_IP6_CONFIG_GET_PRIVATE (setting)->dns_search);
+}
+
+const char *
+nm_setting_ip6_config_get_dns_search (NMSettingIP6Config *setting, guint32 i)
+{
+ NMSettingIP6ConfigPrivate *priv;
+
+ g_return_val_if_fail (NM_IS_SETTING_IP6_CONFIG (setting), NULL);
+
+ priv = NM_SETTING_IP6_CONFIG_GET_PRIVATE (setting);
+ g_return_val_if_fail (i <= g_slist_length (priv->dns_search), NULL);
+
+ return (const char *) g_slist_nth_data (priv->dns_search, i);
+}
+
+gboolean
+nm_setting_ip6_config_add_dns_search (NMSettingIP6Config *setting,
+ const char *dns_search)
+{
+ NMSettingIP6ConfigPrivate *priv;
+ GSList *iter;
+
+ g_return_val_if_fail (NM_IS_SETTING_IP6_CONFIG (setting), FALSE);
+ g_return_val_if_fail (dns_search != NULL, FALSE);
+ g_return_val_if_fail (dns_search[0] != '\0', FALSE);
+
+ priv = NM_SETTING_IP6_CONFIG_GET_PRIVATE (setting);
+ for (iter = priv->dns_search; iter; iter = g_slist_next (iter)) {
+ if (!strcmp (dns_search, (char *) iter->data))
+ return FALSE;
+ }
+
+ priv->dns_search = g_slist_append (priv->dns_search, g_strdup (dns_search));
+ return TRUE;
+}
+
+void
+nm_setting_ip6_config_remove_dns_search (NMSettingIP6Config *setting, guint32 i)
+{
+ NMSettingIP6ConfigPrivate *priv;
+ GSList *elt;
+
+ g_return_if_fail (NM_IS_SETTING_IP6_CONFIG (setting));
+
+ priv = NM_SETTING_IP6_CONFIG_GET_PRIVATE (setting);
+ elt = g_slist_nth (priv->dns_search, i);
+ g_return_if_fail (elt != NULL);
+
+ g_free (elt->data);
+ priv->dns_search = g_slist_delete_link (priv->dns_search, elt);
+}
+
+void
+nm_setting_ip6_config_clear_dns_searches (NMSettingIP6Config *setting)
+{
+ g_return_if_fail (NM_IS_SETTING_IP6_CONFIG (setting));
+
+ nm_utils_slist_free (NM_SETTING_IP6_CONFIG_GET_PRIVATE (setting)->dns_search, g_free);
+ NM_SETTING_IP6_CONFIG_GET_PRIVATE (setting)->dns_search = NULL;
+}
+
+guint32
+nm_setting_ip6_config_get_num_addresses (NMSettingIP6Config *setting)
+{
+ g_return_val_if_fail (NM_IS_SETTING_IP6_CONFIG (setting), 0);
+
+ return g_slist_length (NM_SETTING_IP6_CONFIG_GET_PRIVATE (setting)->addresses);
+}
+
+NMIP6Address *
+nm_setting_ip6_config_get_address (NMSettingIP6Config *setting, guint32 i)
+{
+ NMSettingIP6ConfigPrivate *priv;
+
+ g_return_val_if_fail (NM_IS_SETTING_IP6_CONFIG (setting), NULL);
+
+ priv = NM_SETTING_IP6_CONFIG_GET_PRIVATE (setting);
+ g_return_val_if_fail (i <= g_slist_length (priv->addresses), NULL);
+
+ return (NMIP6Address *) g_slist_nth_data (priv->addresses, i);
+}
+
+gboolean
+nm_setting_ip6_config_add_address (NMSettingIP6Config *setting,
+ NMIP6Address *address)
+{
+ NMSettingIP6ConfigPrivate *priv;
+ NMIP6Address *copy;
+ GSList *iter;
+
+ g_return_val_if_fail (NM_IS_SETTING_IP6_CONFIG (setting), FALSE);
+ g_return_val_if_fail (address != NULL, FALSE);
+
+ priv = NM_SETTING_IP6_CONFIG_GET_PRIVATE (setting);
+ for (iter = priv->addresses; iter; iter = g_slist_next (iter)) {
+ if (nm_ip6_address_compare ((NMIP6Address *) iter->data, address))
+ return FALSE;
+ }
+
+ copy = nm_ip6_address_dup (address);
+ g_return_val_if_fail (copy != NULL, FALSE);
+
+ priv->addresses = g_slist_append (priv->addresses, copy);
+ return TRUE;
+}
+
+void
+nm_setting_ip6_config_remove_address (NMSettingIP6Config *setting, guint32 i)
+{
+ NMSettingIP6ConfigPrivate *priv;
+ GSList *elt;
+
+ g_return_if_fail (NM_IS_SETTING_IP6_CONFIG (setting));
+
+ priv = NM_SETTING_IP6_CONFIG_GET_PRIVATE (setting);
+ elt = g_slist_nth (priv->addresses, i);
+ g_return_if_fail (elt != NULL);
+
+ nm_ip6_address_unref ((NMIP6Address *) elt->data);
+ priv->addresses = g_slist_delete_link (priv->addresses, elt);
+}
+
+void
+nm_setting_ip6_config_clear_addresses (NMSettingIP6Config *setting)
+{
+ NMSettingIP6ConfigPrivate *priv = NM_SETTING_IP6_CONFIG_GET_PRIVATE (setting);
+
+ g_return_if_fail (NM_IS_SETTING_IP6_CONFIG (setting));
+
+ nm_utils_slist_free (priv->addresses, (GDestroyNotify) nm_ip6_address_unref);
+ priv->addresses = NULL;
+}
+
+guint32
+nm_setting_ip6_config_get_num_routes (NMSettingIP6Config *setting)
+{
+ g_return_val_if_fail (NM_IS_SETTING_IP6_CONFIG (setting), 0);
+
+ return g_slist_length (NM_SETTING_IP6_CONFIG_GET_PRIVATE (setting)->routes);
+}
+
+NMIP6Route *
+nm_setting_ip6_config_get_route (NMSettingIP6Config *setting, guint32 i)
+{
+ NMSettingIP6ConfigPrivate *priv;
+
+ g_return_val_if_fail (NM_IS_SETTING_IP6_CONFIG (setting), NULL);
+
+ priv = NM_SETTING_IP6_CONFIG_GET_PRIVATE (setting);
+ g_return_val_if_fail (i <= g_slist_length (priv->routes), NULL);
+
+ return (NMIP6Route *) g_slist_nth_data (priv->routes, i);
+}
+
+gboolean
+nm_setting_ip6_config_add_route (NMSettingIP6Config *setting,
+ NMIP6Route *route)
+{
+ NMSettingIP6ConfigPrivate *priv;
+ NMIP6Route *copy;
+ GSList *iter;
+
+ g_return_val_if_fail (NM_IS_SETTING_IP6_CONFIG (setting), FALSE);
+ g_return_val_if_fail (route != NULL, FALSE);
+
+ priv = NM_SETTING_IP6_CONFIG_GET_PRIVATE (setting);
+ for (iter = priv->routes; iter; iter = g_slist_next (iter)) {
+ if (nm_ip6_route_compare ((NMIP6Route *) iter->data, route))
+ return FALSE;
+ }
+
+ copy = nm_ip6_route_dup (route);
+ g_return_val_if_fail (copy != NULL, FALSE);
+
+ priv->routes = g_slist_append (priv->routes, copy);
+ return TRUE;
+}
+
+void
+nm_setting_ip6_config_remove_route (NMSettingIP6Config *setting, guint32 i)
+{
+ NMSettingIP6ConfigPrivate *priv;
+ GSList *elt;
+
+ g_return_if_fail (NM_IS_SETTING_IP6_CONFIG (setting));
+
+ priv = NM_SETTING_IP6_CONFIG_GET_PRIVATE (setting);
+ elt = g_slist_nth (priv->routes, i);
+ g_return_if_fail (elt != NULL);
+
+ nm_ip6_route_unref ((NMIP6Route *) elt->data);
+ priv->routes = g_slist_delete_link (priv->routes, elt);
+}
+
+void
+nm_setting_ip6_config_clear_routes (NMSettingIP6Config *setting)
+{
+ NMSettingIP6ConfigPrivate *priv = NM_SETTING_IP6_CONFIG_GET_PRIVATE (setting);
+
+ g_return_if_fail (NM_IS_SETTING_IP6_CONFIG (setting));
+
+ nm_utils_slist_free (priv->routes, (GDestroyNotify) nm_ip6_route_unref);
+ priv->routes = NULL;
+}
+
+gboolean
+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_auto_dns;
+}
+
+gboolean
+nm_setting_ip6_config_get_ignore_router_adv (NMSettingIP6Config *setting)
+{
+ g_return_val_if_fail (NM_IS_SETTING_IP6_CONFIG (setting), FALSE);
+
+ return NM_SETTING_IP6_CONFIG_GET_PRIVATE (setting)->ignore_ra;
+}
+
+const char *
+nm_setting_ip6_config_get_dhcp_mode (NMSettingIP6Config *setting)
+{
+ g_return_val_if_fail (NM_IS_SETTING_IP6_CONFIG (setting), FALSE);
+
+ return NM_SETTING_IP6_CONFIG_GET_PRIVATE (setting)->dhcp_mode;
+}
+
static gboolean
verify (NMSetting *setting, GSList *all_settings, GError **error)
{
- NMSettingIP6Config *self = NM_SETTING_IP6_CONFIG (setting);
+ NMSettingIP6ConfigPrivate *priv = NM_SETTING_IP6_CONFIG_GET_PRIVATE (setting);
- if (!self->method) {
+ if (!priv->method) {
g_set_error (error,
NM_SETTING_IP6_CONFIG_ERROR,
NM_SETTING_IP6_CONFIG_ERROR_MISSING_PROPERTY,
@@ -101,18 +434,18 @@
return FALSE;
}
- if (!strcmp (self->method, NM_SETTING_IP6_CONFIG_METHOD_MANUAL)) {
- if (!self->addresses) {
+ if (!strcmp (priv->method, NM_SETTING_IP6_CONFIG_METHOD_MANUAL)) {
+ if (!priv->addresses) {
g_set_error (error,
NM_SETTING_IP6_CONFIG_ERROR,
NM_SETTING_IP6_CONFIG_ERROR_MISSING_PROPERTY,
NM_SETTING_IP6_CONFIG_ADDRESSES);
return FALSE;
}
- } else if ( !strcmp (self->method, NM_SETTING_IP6_CONFIG_METHOD_AUTO)
- || !strcmp (self->method, NM_SETTING_IP6_CONFIG_METHOD_SHARED)) {
- if (!self->ignore_dhcpv6_dns) {
- if (self->dns && g_slist_length (self->dns)) {
+ } else if ( !strcmp (priv->method, NM_SETTING_IP6_CONFIG_METHOD_AUTO)
+ || !strcmp (priv->method, NM_SETTING_IP6_CONFIG_METHOD_SHARED)) {
+ if (!priv->ignore_auto_dns) {
+ if (priv->dns && g_slist_length (priv->dns)) {
g_set_error (error,
NM_SETTING_IP6_CONFIG_ERROR,
NM_SETTING_IP6_CONFIG_ERROR_NOT_ALLOWED_FOR_METHOD,
@@ -120,7 +453,7 @@
return FALSE;
}
- if (g_slist_length (self->dns_search)) {
+ if (g_slist_length (priv->dns_search)) {
g_set_error (error,
NM_SETTING_IP6_CONFIG_ERROR,
NM_SETTING_IP6_CONFIG_ERROR_NOT_ALLOWED_FOR_METHOD,
@@ -129,7 +462,7 @@
}
}
- if (g_slist_length (self->addresses)) {
+ if (g_slist_length (priv->addresses)) {
g_set_error (error,
NM_SETTING_IP6_CONFIG_ERROR,
NM_SETTING_IP6_CONFIG_ERROR_NOT_ALLOWED_FOR_METHOD,
@@ -140,11 +473,11 @@
/* if router advertisement autoconf is disabled, dhcpv6 mode must
* be SOMETHING as long as the user has selected the auto method
*/
- if (self->disable_ra && (self->dhcpv6_mode == NULL)) {
+ 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_DHCPV6_MODE);
+ NM_SETTING_IP6_CONFIG_DHCP_MODE);
return FALSE;
}
} else {
@@ -168,16 +501,16 @@
static void
finalize (GObject *object)
{
- NMSettingIP6Config *self = NM_SETTING_IP6_CONFIG (object);
+ NMSettingIP6ConfigPrivate *priv = NM_SETTING_IP6_CONFIG_GET_PRIVATE (object);
- g_free (self->method);
+ g_free (priv->method);
- if (self->dns)
- g_slist_free (self->dns);
+ if (priv->dns)
+ g_slist_free (priv->dns);
- nm_utils_slist_free (self->dns_search, g_free);
- nm_utils_slist_free (self->addresses, g_free);
- nm_utils_slist_free (self->routes, g_free);
+ nm_utils_slist_free (priv->dns_search, g_free);
+ nm_utils_slist_free (priv->addresses, g_free);
+ nm_utils_slist_free (priv->routes, g_free);
G_OBJECT_CLASS (nm_setting_ip6_config_parent_class)->finalize (object);
}
@@ -186,38 +519,38 @@
set_property (GObject *object, guint prop_id,
const GValue *value, GParamSpec *pspec)
{
- NMSettingIP6Config *setting = NM_SETTING_IP6_CONFIG (object);
+ NMSettingIP6ConfigPrivate *priv = NM_SETTING_IP6_CONFIG_GET_PRIVATE (object);
switch (prop_id) {
case PROP_METHOD:
- g_free (setting->method);
- setting->method = g_value_dup_string (value);
+ g_free (priv->method);
+ priv->method = g_value_dup_string (value);
break;
case PROP_DNS:
- nm_utils_slist_free (setting->dns, g_free);
- setting->dns = nm_utils_ip6_dns_from_gvalue (value);
+ nm_utils_slist_free (priv->dns, g_free);
+ priv->dns = nm_utils_ip6_dns_from_gvalue (value);
break;
case PROP_DNS_SEARCH:
- nm_utils_slist_free (setting->dns_search, g_free);
- setting->dns_search = g_value_dup_boxed (value);
+ nm_utils_slist_free (priv->dns_search, g_free);
+ priv->dns_search = g_value_dup_boxed (value);
break;
case PROP_ADDRESSES:
- nm_utils_slist_free (setting->addresses, g_free);
- setting->addresses = nm_utils_ip6_addresses_from_gvalue (value);
+ nm_utils_slist_free (priv->addresses, g_free);
+ priv->addresses = nm_utils_ip6_addresses_from_gvalue (value);
break;
case PROP_ROUTES:
- nm_utils_slist_free (setting->routes, g_free);
- setting->routes = nm_utils_ip6_addresses_from_gvalue (value);
+ nm_utils_slist_free (priv->routes, g_free);
+ priv->routes = nm_utils_ip6_addresses_from_gvalue (value);
break;
- case PROP_IGNORE_DHCPV6_DNS:
- setting->ignore_dhcpv6_dns = g_value_get_boolean (value);
+ case PROP_IGNORE_AUTO_DNS:
+ priv->ignore_auto_dns = g_value_get_boolean (value);
break;
- case PROP_DISABLE_RA:
- setting->disable_ra = g_value_get_boolean (value);
+ case PROP_IGNORE_ROUTER_ADV:
+ priv->ignore_ra = g_value_get_boolean (value);
break;
- case PROP_DHCPV6_MODE:
- g_free (setting->dhcpv6_mode);
- setting->dhcpv6_mode = g_value_dup_string (value);
+ case PROP_DHCP_MODE:
+ g_free (priv->dhcp_mode);
+ priv->dhcp_mode = g_value_dup_string (value);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
@@ -229,32 +562,32 @@
get_property (GObject *object, guint prop_id,
GValue *value, GParamSpec *pspec)
{
- NMSettingIP6Config *setting = NM_SETTING_IP6_CONFIG (object);
+ NMSettingIP6ConfigPrivate *priv = NM_SETTING_IP6_CONFIG_GET_PRIVATE (object);
switch (prop_id) {
case PROP_METHOD:
- g_value_set_string (value, setting->method);
+ g_value_set_string (value, priv->method);
break;
case PROP_DNS:
- nm_utils_ip6_dns_to_gvalue (setting->dns, value);
+ nm_utils_ip6_dns_to_gvalue (priv->dns, value);
break;
case PROP_DNS_SEARCH:
- g_value_set_boxed (value, setting->dns_search);
+ g_value_set_boxed (value, priv->dns_search);
break;
case PROP_ADDRESSES:
- nm_utils_ip6_addresses_to_gvalue (setting->addresses, value);
+ nm_utils_ip6_addresses_to_gvalue (priv->addresses, value);
break;
case PROP_ROUTES:
- nm_utils_ip6_addresses_to_gvalue (setting->routes, value);
+ nm_utils_ip6_addresses_to_gvalue (priv->routes, value);
break;
- case PROP_IGNORE_DHCPV6_DNS:
- g_value_set_boolean (value, setting->ignore_dhcpv6_dns);
+ case PROP_IGNORE_AUTO_DNS:
+ g_value_set_boolean (value, priv->ignore_auto_dns);
break;
- case PROP_DISABLE_RA:
- g_value_set_boolean (value, setting->disable_ra);
+ case PROP_IGNORE_ROUTER_ADV:
+ g_value_set_boolean (value, priv->ignore_ra);
break;
- case PROP_DHCPV6_MODE:
- g_value_set_string (value, setting->dhcpv6_mode);
+ case PROP_DHCP_MODE:
+ g_value_set_string (value, priv->dhcp_mode);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
@@ -316,26 +649,344 @@
G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE));
g_object_class_install_property
- (object_class, PROP_IGNORE_DHCPV6_DNS,
- g_param_spec_boolean (NM_SETTING_IP6_CONFIG_IGNORE_DHCPV6_DNS,
+ (object_class, PROP_IGNORE_AUTO_DNS,
+ g_param_spec_boolean (NM_SETTING_IP6_CONFIG_IGNORE_AUTO_DNS,
"Ignore DHCPv6 DNS",
"Ignore DHCPv6 DNS",
FALSE,
G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE));
g_object_class_install_property
- (object_class, PROP_DISABLE_RA,
- g_param_spec_boolean (NM_SETTING_IP6_CONFIG_DISABLE_RA,
+ (object_class, PROP_IGNORE_ROUTER_ADV,
+ g_param_spec_boolean (NM_SETTING_IP6_CONFIG_IGNORE_ROUTER_ADV,
"Ignore Router Advertisements",
"Ignore Router Advertisements",
FALSE,
G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE));
g_object_class_install_property
- (object_class, PROP_DHCPV6_MODE,
- g_param_spec_string (NM_SETTING_IP6_CONFIG_DHCPV6_MODE,
+ (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 */
+ guint32 prefix;
+ struct in6_addr *gateway; /* network byte order */
+};
+
+NMIP6Address *
+nm_ip6_address_new (void)
+{
+ NMIP6Address *address;
+
+ address = g_malloc0 (sizeof (NMIP6Address));
+ address->refcount = 1;
+ return address;
+}
+
+NMIP6Address *
+nm_ip6_address_dup (NMIP6Address *source)
+{
+ NMIP6Address *address;
+
+ g_return_val_if_fail (source != NULL, NULL);
+ g_return_val_if_fail (source->refcount > 0, NULL);
+
+ 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));
+ }
+
+ return address;
+}
+
+void
+nm_ip6_address_ref (NMIP6Address *address)
+{
+ g_return_if_fail (address != NULL);
+ g_return_if_fail (address->refcount > 0);
+
+ address->refcount++;
+}
+
+void
+nm_ip6_address_unref (NMIP6Address *address)
+{
+ g_return_if_fail (address != NULL);
+ g_return_if_fail (address->refcount > 0);
+
+ address->refcount--;
+ if (address->refcount == 0) {
+ g_free (address->address);
+ g_free (address->gateway);
+ memset (address, 0, sizeof (NMIP6Address));
+ g_free (address);
+ }
+}
+
+gboolean
+nm_ip6_address_compare (NMIP6Address *address, NMIP6Address *other)
+{
+ g_return_val_if_fail (address != NULL, FALSE);
+ g_return_val_if_fail (address->refcount > 0, FALSE);
+
+ 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)))
+ return FALSE;
+ return TRUE;
+}
+
+const struct in6_addr *
+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;
+}
+
+void
+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_free (address->address);
+ address->address = NULL;
+
+ if (addr) {
+ address->address = g_malloc0 (sizeof (struct in6_addr));
+ memcpy (address->address, addr, sizeof (struct in6_addr));
+ }
+}
+
+guint32
+nm_ip6_address_get_prefix (NMIP6Address *address)
+{
+ g_return_val_if_fail (address != NULL, 0);
+ g_return_val_if_fail (address->refcount > 0, 0);
+
+ return address->prefix;
+}
+
+void
+nm_ip6_address_set_prefix (NMIP6Address *address, guint32 prefix)
+{
+ g_return_if_fail (address != NULL);
+ g_return_if_fail (address->refcount > 0);
+
+ 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 */
+ guint32 prefix;
+ struct in6_addr *next_hop; /* network byte order */
+ guint32 metric; /* lower metric == more preferred */
+};
+
+NMIP6Route *
+nm_ip6_route_new (void)
+{
+ NMIP6Route *route;
+
+ route = g_malloc0 (sizeof (NMIP6Route));
+ route->refcount = 1;
+ return route;
+}
+
+NMIP6Route *
+nm_ip6_route_dup (NMIP6Route *source)
+{
+ NMIP6Route *route;
+
+ g_return_val_if_fail (source != NULL, NULL);
+ g_return_val_if_fail (source->refcount > 0, NULL);
+
+ 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));
+ }
+
+ return route;
+}
+
+void
+nm_ip6_route_ref (NMIP6Route *route)
+{
+ g_return_if_fail (route != NULL);
+ g_return_if_fail (route->refcount > 0);
+
+ route->refcount++;
+}
+
+void
+nm_ip6_route_unref (NMIP6Route *route)
+{
+ g_return_if_fail (route != NULL);
+ g_return_if_fail (route->refcount > 0);
+
+ route->refcount--;
+ if (route->refcount == 0) {
+ g_free (route->dest);
+ g_free (route->next_hop);
+ memset (route, 0, sizeof (NMIP6Route));
+ g_free (route);
+ }
+}
+
+gboolean
+nm_ip6_route_compare (NMIP6Route *route, NMIP6Route *other)
+{
+ g_return_val_if_fail (route != NULL, FALSE);
+ g_return_val_if_fail (route->refcount > 0, FALSE);
+
+ 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))
+ || route->prefix != other->prefix
+ || memcmp (route->next_hop, other->next_hop, sizeof (struct in6_addr))
+ || route->metric != other->metric)
+ return FALSE;
+ return TRUE;
+}
+
+const struct in6_addr *
+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;
+}
+
+void
+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_free (route->dest);
+ route->dest = NULL;
+
+ if (dest) {
+ route->dest = g_malloc0 (sizeof (struct in6_addr));
+ memcpy (route->dest, dest, sizeof (struct in6_addr));
+ }
+}
+
+guint32
+nm_ip6_route_get_prefix (NMIP6Route *route)
+{
+ g_return_val_if_fail (route != NULL, 0);
+ g_return_val_if_fail (route->refcount > 0, 0);
+
+ return route->prefix;
+}
+
+void
+nm_ip6_route_set_prefix (NMIP6Route *route, guint32 prefix)
+{
+ g_return_if_fail (route != NULL);
+ g_return_if_fail (route->refcount > 0);
+
+ route->prefix = prefix;
+}
+
+const struct in6_addr *
+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;
+}
+
+void
+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_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));
+ }
+}
+
+guint32
+nm_ip6_route_get_metric (NMIP6Route *route)
+{
+ g_return_val_if_fail (route != NULL, 0);
+ g_return_val_if_fail (route->refcount > 0, 0);
+
+ return route->metric;
+}
+
+void
+nm_ip6_route_set_metric (NMIP6Route *route, guint32 metric)
+{
+ g_return_if_fail (route != NULL);
+ g_return_if_fail (route->refcount > 0);
+
+ route->metric = metric;
+}
+
Modified: trunk/libnm-util/nm-setting-ip6-config.h
==============================================================================
--- trunk/libnm-util/nm-setting-ip6-config.h (original)
+++ trunk/libnm-util/nm-setting-ip6-config.h Thu Oct 30 19:39:51 2008
@@ -59,9 +59,9 @@
#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_DHCPV6_DNS "ignore-dhcpv6-dns"
-#define NM_SETTING_IP6_CONFIG_DISABLE_RA "disable-ra"
-#define NM_SETTING_IP6_CONFIG_DHCPV6_MODE "dhcpv6-mode"
+#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"
@@ -70,32 +70,95 @@
#define NM_SETTING_IP6_CONFIG_DHCPV6_MODE_INFO "info"
#define NM_SETTING_IP6_CONFIG_DHCPV6_MODE_REQUEST "request"
-typedef struct {
- struct in6_addr address;
- guint32 prefix;
- struct in6_addr gateway;
-} NMSettingIP6Address;
+
+typedef struct NMIP6Address NMIP6Address;
+
+NMIP6Address * nm_ip6_address_new (void);
+NMIP6Address * nm_ip6_address_dup (NMIP6Address *source);
+void nm_ip6_address_ref (NMIP6Address *address);
+void nm_ip6_address_unref (NMIP6Address *address);
+/* Return TRUE if addresses are identical */
+gboolean nm_ip6_address_compare (NMIP6Address *address, NMIP6Address *other);
+
+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 */
+
+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);
+NMIP6Route * nm_ip6_route_dup (NMIP6Route *route);
+void nm_ip6_route_ref (NMIP6Route *route);
+void nm_ip6_route_unref (NMIP6Route *route);
+/* Return TRUE if routes are identical */
+gboolean nm_ip6_route_compare (NMIP6Route *route, NMIP6Route *other);
+
+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 */
+
+guint32 nm_ip6_route_get_prefix (NMIP6Route *route);
+void nm_ip6_route_set_prefix (NMIP6Route *route,
+ guint32 prefix);
+
+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 */
+
+guint32 nm_ip6_route_get_metric (NMIP6Route *route);
+void nm_ip6_route_set_metric (NMIP6Route *route,
+ guint32 metric);
typedef struct {
NMSetting parent;
-
- char *method;
- GSList *dns; /* array of struct in6_addr */
- GSList *dns_search; /* list of strings */
- GSList *addresses; /* array of NMSettingIP6Address */
- GSList *routes; /* array of NMSettingIP6Address */
- gboolean ignore_dhcpv6_dns;
- gboolean disable_ra;
- char *dhcpv6_mode;
} NMSettingIP6Config;
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);
+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);
G_END_DECLS
Modified: trunk/libnm-util/nm-utils.c
==============================================================================
--- trunk/libnm-util/nm-utils.c (original)
+++ trunk/libnm-util/nm-utils.c Thu Oct 30 19:39:51 2008
@@ -44,6 +44,14 @@
#include "nm-setting-ip6-config.h"
#include "crypto.h"
+/* IP6 currently incomplete */
+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);
+
+
struct EncodingTriplet
{
const char *encoding1;
@@ -1027,7 +1035,7 @@
GValueArray *elements = (GValueArray *) g_ptr_array_index (addresses, i);
GValue *tmp;
GByteArray *ba_addr, *ba_gw;
- NMSettingIP6Address *addr;
+ NMIP6Address *addr;
guint32 prefix;
if ( (elements->n_values != 3)
@@ -1061,11 +1069,11 @@
__func__, ba_gw->len);
continue;
}
-
- addr = g_malloc0 (sizeof (NMSettingIP6Address));
- addr->prefix = prefix;
- memcpy (addr->address.s6_addr, ba_addr->data, 16);
- memcpy (addr->gateway.s6_addr, ba_gw->data, 16);
+
+ addr = nm_ip6_address_new ();
+ nm_ip6_address_set_prefix (addr, prefix);
+ nm_ip6_address_set_address (addr, (const struct in6_addr *) ba_addr->data);
+ nm_ip6_address_set_gateway (addr, (const struct in6_addr *) ba_gw->data);
list = g_slist_prepend (list, addr);
}
@@ -1081,7 +1089,7 @@
addresses = g_ptr_array_new ();
for (iter = list; iter; iter = iter->next) {
- NMSettingIP6Address *addr = (NMSettingIP6Address *) iter->data;
+ NMIP6Address *addr = (NMIP6Address *) iter->data;
GValue element = { 0, };
GByteArray *ba_addr, *ba_gw;
@@ -1089,14 +1097,14 @@
g_value_take_boxed (&element, dbus_g_type_specialized_construct (DBUS_TYPE_G_IP6_ADDRESS));
ba_addr = g_byte_array_sized_new (16);
- g_byte_array_append (ba_addr, (guint8 *) addr->address.s6_addr, 16);
+ g_byte_array_append (ba_addr, (guint8 *) nm_ip6_address_get_address (addr), 16);
ba_gw = g_byte_array_sized_new (16);
- g_byte_array_append (ba_gw, (guint8 *) addr->gateway.s6_addr, 16);
+ g_byte_array_append (ba_gw, (guint8 *) nm_ip6_address_get_gateway (addr), 16);
dbus_g_type_struct_set (&element,
0, ba_addr,
- 1, addr->prefix,
+ 1, nm_ip6_address_get_prefix (addr),
2, ba_gw,
G_MAXUINT);
Modified: trunk/libnm-util/nm-utils.h
==============================================================================
--- trunk/libnm-util/nm-utils.h (original)
+++ trunk/libnm-util/nm-utils.h Thu Oct 30 19:39:51 2008
@@ -194,12 +194,6 @@
guint32 nm_utils_ip4_netmask_to_prefix (guint32 ip4_netmask);
guint32 nm_utils_ip4_prefix_to_netmask (guint32 ip4_prefix);
-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);
-
char *nm_utils_uuid_generate (void);
char *nm_utils_uuid_generate_from_string (const char *s);
Modified: trunk/src/nm-device-wifi.c
==============================================================================
--- trunk/src/nm-device-wifi.c (original)
+++ trunk/src/nm-device-wifi.c Thu Oct 30 19:39:51 2008
@@ -1658,7 +1658,6 @@
if (req) {
NMConnection *connection;
NMSettingIP4Config *s_ip4;
- NMSettingIP6Config *s_ip6;
const char *ip4_method = NULL;
connection = nm_act_request_get_connection (req);
@@ -1668,10 +1667,6 @@
if (s_ip4 && !strcmp (ip4_method, NM_SETTING_IP4_CONFIG_METHOD_SHARED))
return FALSE;
-
- s_ip6 = (NMSettingIP6Config *) nm_connection_get_setting (connection, NM_TYPE_SETTING_IP6_CONFIG);
- if (s_ip6 && !strcmp (s_ip6->method, NM_SETTING_IP6_CONFIG_METHOD_SHARED))
- return FALSE;
}
return TRUE;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]