summaryrefslogtreecommitdiff
path: root/src/NetworkManagerUtils.c
diff options
context:
space:
mode:
authorMichael Biebl <biebl@debian.org>2011-05-27 19:57:25 +0200
committerMichael Biebl <biebl@debian.org>2011-05-27 19:57:25 +0200
commitd465e5fac63f36bcf4069e36827f4b62c494556d (patch)
tree65f4ba9567e091233cdf3279f7ba3c9479e74a1c /src/NetworkManagerUtils.c
parent9f806e97a24bba61417ae312fcc0da40914266fb (diff)
Imported Upstream version 0.8.9997upstream/0.8.9997
Diffstat (limited to 'src/NetworkManagerUtils.c')
-rw-r--r--src/NetworkManagerUtils.c36
1 files changed, 34 insertions, 2 deletions
diff --git a/src/NetworkManagerUtils.c b/src/NetworkManagerUtils.c
index d069eca75..5a6a61b64 100644
--- a/src/NetworkManagerUtils.c
+++ b/src/NetworkManagerUtils.c
@@ -391,6 +391,38 @@ dump_object_to_props (GObject *object, GHashTable *hash)
}
static void
+dump_dhcp4_to_props (NMDHCP4Config *config, GHashTable *hash)
+{
+ GSList *options, *iter;
+
+ options = nm_dhcp4_config_list_options (config);
+ for (iter = options; iter; iter = g_slist_next (iter)) {
+ const char *option = (const char *) iter->data;
+ const char *val;
+
+ val = nm_dhcp4_config_get_option (config, option);
+ value_hash_add_str (hash, option, val);
+ }
+ g_slist_free (options);
+}
+
+static void
+dump_dhcp6_to_props (NMDHCP6Config *config, GHashTable *hash)
+{
+ GSList *options, *iter;
+
+ options = nm_dhcp6_config_list_options (config);
+ for (iter = options; iter; iter = g_slist_next (iter)) {
+ const char *option = (const char *) iter->data;
+ const char *val;
+
+ val = nm_dhcp6_config_get_option (config, option);
+ value_hash_add_str (hash, option, val);
+ }
+ g_slist_free (options);
+}
+
+static void
fill_device_props (NMDevice *device,
GHashTable *dev_hash,
GHashTable *ip4_hash,
@@ -420,11 +452,11 @@ fill_device_props (NMDevice *device,
dhcp4_config = nm_device_get_dhcp4_config (device);
if (dhcp4_config)
- dump_object_to_props (G_OBJECT (dhcp4_config), dhcp4_hash);
+ dump_dhcp4_to_props (dhcp4_config, dhcp4_hash);
dhcp6_config = nm_device_get_dhcp6_config (device);
if (dhcp6_config)
- dump_object_to_props (G_OBJECT (dhcp6_config), dhcp6_hash);
+ dump_dhcp6_to_props (dhcp6_config, dhcp6_hash);
}
static void