#define CONNMAN_SIGNAL_DEVICE_CHANGED "DeviceChanged"
#define CONNMAN_SIGNAL_DEVICE_DETECTED "DeviceDetected"
#define SIGNAL_NAME_OWNER_CHANGED "NameOwnerChanged"
+#define NETCONFIG_SIGNAL_VCONF_CHANGED "VconfChanged"
+
#define MAX_SIG_LEN 64
-#define TOTAL_CONN_SIGNALS 6
+#define TOTAL_CONN_SIGNALS 7
#define MAX_SOCKET_OPEN_RETRY 5
typedef enum {
#if defined TIZEN_DEBUG_ENABLE
static int dumpservice_subscription_id = 0;
#endif
+static int netconfig_subscription_id = 0;
typedef void (*supplicant_signal_cb)(GDBusConnection *conn,
const gchar *name, const gchar *path, const gchar *interface,
if (value != NULL) {
netconfig_set_default_ipaddress(value);
- vconf_set_str(VCONFKEY_NETWORK_IP, value);
+ netconfig_set_vconf_str(VCONFKEY_NETWORK_IP, value, TRUE);
g_variant_builder_add(builder, "{sv}", "IPv4Address",
g_variant_new_string(value));
} else if (old_ip != NULL && strlen(old_ip) > 0) {
- vconf_set_str(VCONFKEY_NETWORK_IP, "");
+ netconfig_set_vconf_str(VCONFKEY_NETWORK_IP, "",TRUE);
g_variant_builder_add(builder, "{sv}", "IPv4Address",
g_variant_new_string(""));
}
if (value != NULL) {
netconfig_set_default_ipaddress6(value);
- vconf_set_str(VCONFKEY_NETWORK_IP6, value);
+ netconfig_set_vconf_str(VCONFKEY_NETWORK_IP6, value, TRUE);
g_variant_builder_add(builder, "{sv}", "IPv6Address",
g_variant_new_string(value));
} else if (old_ip6 != NULL && strlen(old_ip6) > 0) {
- vconf_set_str(VCONFKEY_NETWORK_IP6, "");
+ netconfig_set_vconf_str(VCONFKEY_NETWORK_IP6, "", TRUE);
g_variant_builder_add(builder, "{sv}", "IPv6Address",
g_variant_new_string(""));
}
if (netconfig_is_wifi_profile(path) || netconfig_is_ethernet_profile(path)) {
if (g_strcmp0(property, "ready") == 0) {
+ if (g_strcmp0(path, netconfig_get_default_profile()) == 0
+ && netconfig_get_default_is_internet())
+ netconfig_set_default_is_internet(FALSE);
+
for (idx = 0; idx < MAX_SOCKET_OPEN_RETRY; idx++) {
sd = start_ip_conflict_mon();
if (sd != NULL)
break;
}
} else if (g_strcmp0(property, "online") == 0) {
- // do nothing
+ if (g_strcmp0(path, netconfig_get_default_profile()) == 0)
+ netconfig_set_default_is_internet(TRUE);
} else {
stop_ip_conflict_mon();
}
builder = g_variant_builder_new(G_VARIANT_TYPE("a{sv}"));
netconfig_set_default_proxy(value);
- vconf_set_str(VCONFKEY_NETWORK_PROXY, value);
+ netconfig_set_vconf_str(VCONFKEY_NETWORK_PROXY, value, TRUE);
g_variant_builder_add(builder, "{sv}", "ProxyAddress",
g_variant_new_string(value));
builder = g_variant_builder_new(G_VARIANT_TYPE("a{sv}"));
netconfig_set_default_proxy("");
- vconf_set_str(VCONFKEY_NETWORK_PROXY, "");
+ netconfig_set_vconf_str(VCONFKEY_NETWORK_PROXY, "", TRUE);
g_variant_builder_add(builder, "{sv}", "ProxyAddress",
g_variant_new_string(""));
|| g_strcmp0(property, "connect-failed") == 0
|| g_strcmp0(property, "login-failed") == 0
|| g_strcmp0(property, "auth-failed") == 0
+ || g_strcmp0(property, "assoc-failed") == 0
|| g_strcmp0(property, "invalid-key") == 0) {
INFO("start dump");
/* If clatd is terminated unexpectedly, reset and enable clat service. */
if (NETCONFIG_CELLULAR_ONLINE == cellular_state_get_service_state())
netconfig_clatd_reset();
+ } else if (g_strcmp0(name, SUPPLICANT_SERVICE) == 0 && *new == '\0') {
+ DBG("Supplicant destroyed: name %s, old %s, new %s", name, old, new);
+ __mark_supplicant_stopped();
}
g_free(name);
g_free(old);
return;
}
+static void _dbus_vconf_changed_cb(GDBusConnection *conn,
+ const gchar *Name, const gchar *path, const gchar *interface,
+ const gchar *sig, GVariant *param, gpointer user_data)
+{
+ gchar *key = NULL;
+ gchar *type = NULL;
+ gchar *str_val = NULL;
+ int int_val = 0;
+
+ if (param == NULL)
+ return;
+
+ g_variant_get(param, "(sssi)", &key, &type, &str_val, &int_val);
+
+ if (!key || key[0] == '\0')
+ goto done;
+
+ DBG("VconfChanged key: %s, type: %s, str_val: %s, int_val: %d",
+ key, type, str_val, int_val);
+
+ if (g_strcmp0(type, "string") == 0 && str_val)
+ vconf_set_str(key, str_val);
+ else if (g_strcmp0(type, "int") == 0)
+ vconf_set_int(key, int_val);
+ else if (g_strcmp0(type, "bool") == 0)
+ vconf_set_bool(key, int_val);
+
+done:
+ g_free(key);
+ g_free(type);
+ g_free(str_val);
+}
+
static void _scan_changed_cb(GDBusConnection *conn,
const gchar *name, const gchar *path, const gchar *interface,
const gchar *sig, GVariant *param, gpointer user_data)
_supplicant_dpp_conf_obj,
};
+void register_gdbus_signal_container(void)
+{
+ GDBusConnection *connection = NULL;
+ connection = netdbus_get_connection();
+
+ if (connection == NULL) {
+ ERR("Failed to get GDbus Connection");
+ return;
+ }
+
+ netconfig_subscription_id = g_dbus_connection_signal_subscribe(
+ connection,
+ NETCONFIG_SERVICE,
+ NETCONFIG_NETWORK_INTERFACE,
+ NETCONFIG_SIGNAL_VCONF_CHANGED,
+ NETCONFIG_NETWORK_PATH,
+ NULL,
+ G_DBUS_SIGNAL_FLAGS_NONE,
+ _dbus_vconf_changed_cb,
+ NULL,
+ NULL);
+
+ INFO("Successfully register host net-config DBus signal filter");
+}
+
void register_gdbus_signal(void)
{
GDBusConnection *connection = NULL;
NULL,
NULL);
+ conn_subscription_ids[6] = g_dbus_connection_signal_subscribe(
+ connection,
+ DBUS_SERVICE_DBUS,
+ DBUS_INTERFACE_DBUS,
+ SIGNAL_NAME_OWNER_CHANGED,
+ NULL,
+ SUPPLICANT_SERVICE,
+ G_DBUS_SIGNAL_FLAGS_NONE,
+ _dbus_name_changed_cb,
+ NULL,
+ NULL);
+
INFO("Successfully register clat DBus signal filters");
for (sig = SIG_INTERFACE_REMOVED; sig < SIG_MAX; sig++) {
netconfig_update_default();
}
+void deregister_gdbus_signal_container(void)
+{
+ GDBusConnection *connection = NULL;
+
+ connection = netdbus_get_connection();
+ if (!connection) {
+ ERR("Already de-registered. Nothing to be done");
+ return;
+ }
+
+ if (netconfig_subscription_id)
+ g_dbus_connection_signal_unsubscribe(connection,
+ netconfig_subscription_id);
+}
+
void deregister_gdbus_signal(void)
{
GDBusConnection *connection = NULL;