Commit 567396ad authored by Dan Williams's avatar Dan Williams
Browse files

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



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@4240 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
parent 2c78fb12
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
2008-10-30 Dan Williams <dcbw@redhat.com>
* libnm-util/libnm-util.ver
......
......@@ -15,7 +15,6 @@ libnm_util_include_HEADERS = \
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 @@ pkgconfig_DATA = libnm-util.pc
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
......@@ -125,10 +125,6 @@ global:
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 @@ 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_dns_from_gvalue;
nm_utils_ip6_dns_to_gvalue;
nm_utils_is_empty_ssid;
nm_utils_register_value_transformations;
nm_utils_same_ssid;
......
......@@ -107,7 +107,7 @@ static guint signals[LAST_SIGNAL] = { 0 };
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 @@ 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,
7);
/* Be sure to update DEFAULT_MAP_SIZE if you add another setting!! */
}
......
This diff is collapsed.
......@@ -59,9 +59,9 @@ GQuark nm_setting_ip6_config_error_quark (void);
#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 @@ GQuark nm_setting_ip6_config_error_quark (void);
#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
......
......@@ -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 @@ nm_utils_ip6_addresses_from_gvalue (const GValue *value)
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 @@ nm_utils_ip6_addresses_from_gvalue (const GValue *value)
__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 @@ nm_utils_ip6_addresses_to_gvalue (GSList *list, GValue *value)
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 @@ nm_utils_ip6_addresses_to_gvalue (GSList *list, GValue *value)
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);
......
......@@ -194,12 +194,6 @@ void nm_utils_ip4_routes_to_gvalue (GSList *list, GValue *value);
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);
......
......@@ -1658,7 +1658,6 @@ can_scan (NMDeviceWifi *self)
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 @@ can_scan (NMDeviceWifi *self)
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;
......
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