extern "C" {
#endif
+#define CLATD_SERVICE "com.samsung.clatd"
+#define CLATD_PATH "/com/samsung/clatd"
+#define CLATD_INTERFACE "com.samsung.clatd.Control"
+
int netconfig_clatd_enable(void);
int netconfig_clatd_disable(void);
+void netconfig_clatd_reset(void);
#ifdef __cplusplus
}
#include "netdbus.h"
#include "clatd-handler.h"
-#define CLATD_SERVICE "com.samsung.clatd"
-#define CLATD_PATH "/com/samsung/clatd"
-#define CLATD_INTERFACE "com.samsung.clatd.Control"
-
static gboolean g_is_running = FALSE;
static void __netconfig_clatd_async_callback(GObject *source_object,
return 0;
}
+
+void netconfig_clatd_reset()
+{
+ DBG("");
+ g_is_running = FALSE;
+ netconfig_clatd_enable();
+}
#define CONNMAN_SIGNAL_SERVICES_CHANGED "ServicesChanged"
#define CONNMAN_SIGNAL_PROPERTY_CHANGED "PropertyChanged"
-#define CONNMAN_SIGNAL_NAME_CHANGED "NameOwnerChanged"
+#define SIGNAL_NAME_OWNER_CHANGED "NameOwnerChanged"
#define MAX_SIG_LEN 64
-#define TOTAL_CONN_SIGNALS 5
+#define TOTAL_CONN_SIGNALS 6
#define MAX_SOCKET_OPEN_RETRY 5
typedef enum {
DBG("ConnMan destroyed: name %s, old %s, new %s", name, old, new);
connman_register_agent();
+ } else if (g_strcmp0(name, CLATD_SERVICE) == 0 && *new == '\0') {
+ DBG("Clat destroyed: name %s, old %s, new %s", name, old, new);
+
+ /* If clatd is terminated unexpectedly, reset and enable clat service. */
+ if (NETCONFIG_CELLULAR_ONLINE == cellular_state_get_service_state())
+ netconfig_clatd_reset();
}
g_free(name);
g_free(old);
connection,
DBUS_SERVICE_DBUS,
DBUS_INTERFACE_DBUS,
- CONNMAN_SIGNAL_NAME_CHANGED,
+ SIGNAL_NAME_OWNER_CHANGED,
NULL,
CONNMAN_SERVICE,
G_DBUS_SIGNAL_FLAGS_NONE,
INFO("Successfully register Supplicant WPS DBus signal filters");
+ conn_subscription_ids[5] = g_dbus_connection_signal_subscribe(
+ connection,
+ DBUS_SERVICE_DBUS,
+ DBUS_INTERFACE_DBUS,
+ SIGNAL_NAME_OWNER_CHANGED,
+ NULL,
+ CLATD_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++) {
/*
* For SIG_INTERFACE_REMOVED INTERFACE_ADDED