const gchar *name, const gchar *path, const gchar *interface,
const gchar *sig, GVariant *param, gpointer user_data);
+static void __netconfig_extract_ipv4_signal_data(GVariant *dictionary, const gchar *profile)
+{
+ gchar *key = NULL;
+ const gchar *value = NULL;
+ GVariant *var = NULL;
+ GVariantIter iter;
+
+ g_variant_iter_init(&iter, dictionary);
+ while (g_variant_iter_loop(&iter, "{sv}", &key, &var)) {
+ if (g_strcmp0(key, "Address") == 0) {
+ value = g_variant_get_string(var, NULL);
+ char *old_ip = vconf_get_str(VCONFKEY_NETWORK_IP);
+
+ DBG("Old IPv4.Address [%s] Received new IPv4.Address [%s]", old_ip, value);
+ if (g_strcmp0(old_ip, value) != 0) {
+ if (value == NULL)
+ vconf_set_str(VCONFKEY_NETWORK_IP, "");
+ else
+ vconf_set_str(VCONFKEY_NETWORK_IP, value);
+ }
+ g_free(old_ip);
+ }
+ }
+}
+
+static void __netconfig_extract_ipv6_signal_data(GVariant *dictionary, const gchar *profile)
+{
+ gchar *key = NULL;
+ const gchar *value = NULL;
+ GVariant *var = NULL;
+ GVariantIter iter;
+
+ g_variant_iter_init(&iter, dictionary);
+ while (g_variant_iter_loop(&iter, "{sv}", &key, &var)) {
+ if (g_strcmp0(key, "Address") == 0) {
+ value = g_variant_get_string(var, NULL);
+ char *old_ip6 = vconf_get_str(VCONFKEY_NETWORK_IP);
+
+ DBG("Old IPv6.Address [%s] Received new IPv6.Address [%s]", old_ip6, value);
+ if (g_strcmp0(old_ip6, value) != 0) {
+ if (value == NULL)
+ vconf_set_str(VCONFKEY_NETWORK_IP6, "");
+ else
+ vconf_set_str(VCONFKEY_NETWORK_IP6, value);
+ }
+ g_free(old_ip6);
+ }
+ }
+}
+
static void _technology_signal_cb(GDBusConnection *conn,
const gchar *name, const gchar *path, const gchar *interface,
const gchar *sig, GVariant *param, gpointer user_data)
}
g_variant_iter_free(iter);
+ } else if (g_strcmp0(sigvalue, "IPv4") == 0) {
+ __netconfig_extract_ipv4_signal_data(variant, path);
+ } else if (g_strcmp0(sigvalue, "IPv6") == 0) {
+ __netconfig_extract_ipv6_signal_data(variant, path);
} else if (g_strcmp0(sigvalue, "Error") == 0) {
g_variant_get(variant, "s", &property);
INFO("[%s] Property : %s", sigvalue, property);