-static void __libnet_set_reset_profile_cb(connection_opened_cb user_cb, void *user_data)
-{
- if (user_cb != NULL) {
- libnet.reset_profile_cb = user_cb;
- libnet.reset_profile_user_data = user_data;
- }
-}
-
-static gboolean __libnet_reset_profile_cb_idle(gpointer data)
-{
- connection_error_e result = (connection_error_e)data;
-
- if (libnet.reset_profile_cb != NULL)
- libnet.reset_profile_cb(result, libnet.reset_profile_user_data);
-
- libnet.reset_profile_cb = NULL;
- libnet.reset_profile_user_data = NULL;
-
- return FALSE;
-}
-
-static void __libnet_reset_profile_cb(connection_error_e result)
-{
- if (_connection_is_created() != true) {
- CONNECTION_LOG(CONNECTION_ERROR, "Application is not registered"
- "If multi-threaded, thread integrity be broken.");
- return;
- }
-
- if (libnet.reset_profile_cb != NULL)
- _connection_callback_add(__libnet_reset_profile_cb_idle, (gpointer)result);
-}
-
-static void __libnet_set_opened_cb(connection_opened_cb user_cb, void *user_data)
-{
- if (user_cb != NULL) {
- libnet.opened_cb = user_cb;
- libnet.opened_user_data = user_data;
- }
-}
-
-static gboolean __libnet_opened_cb_idle(gpointer data)
-{
- connection_error_e result = (connection_error_e)data;
-
- if (libnet.opened_cb != NULL)
- libnet.opened_cb(result, libnet.opened_user_data);
-
- libnet.opened_cb = NULL;
- libnet.opened_user_data = NULL;
-
- return FALSE;
-}
-
-static void __libnet_opened_cb(connection_error_e result)
-{
- if (_connection_is_created() != true) {
- CONNECTION_LOG(CONNECTION_ERROR, "Application is not registered"
- "If multi-threaded, thread integrity be broken.");
- return;
- }
-
- if (libnet.opened_cb != NULL)
- _connection_callback_add(__libnet_opened_cb_idle, (gpointer)result);
-}
-
-static void __libnet_set_closed_cb(connection_closed_cb user_cb, void *user_data)
-{
- if (user_cb != NULL) {
- libnet.closed_cb = user_cb;
- libnet.closed_user_data = user_data;
- }
-}
-
-static gboolean __libnet_closed_cb_idle(gpointer data)
-{
- connection_error_e result = (connection_error_e)data;
-
- if (libnet.closed_cb != NULL)
- libnet.closed_cb(result, libnet.closed_user_data);
-
- libnet.closed_cb = NULL;
- libnet.closed_user_data = NULL;
-
- return FALSE;
-}
-
-static void __libnet_closed_cb(connection_error_e result)
-{
- if (_connection_is_created() != true) {
- CONNECTION_LOG(CONNECTION_ERROR, "Application is not registered"
- "If multi-threaded, thread integrity be broken.");
- return;
- }
-
- if (libnet.closed_cb != NULL)
- _connection_callback_add(__libnet_closed_cb_idle, (gpointer)result);
-}
-
-static void __libnet_set_default_cb(connection_set_default_cb user_cb, void *user_data)
-{
- if (user_cb != NULL) {
- libnet.set_default_cb = user_cb;
- libnet.set_default_user_data = user_data;
- }
-}
-
-static gboolean __libnet_default_cb_idle(gpointer data)
-{
- connection_error_e result = (connection_error_e)data;
-
- if (libnet.set_default_cb != NULL)
- libnet.set_default_cb(result, libnet.set_default_user_data);
-
- libnet.set_default_cb = NULL;
- libnet.set_default_user_data = NULL;
-
- return FALSE;
-}
-
-static void __libnet_default_cb(connection_error_e result)
-{
- if (_connection_is_created() != true) {
- CONNECTION_LOG(CONNECTION_ERROR, "Application is not registered"
- "If multi-threaded, thread integrity be broken.");
- return;
- }
-
- if (libnet.set_default_cb != NULL)
- _connection_callback_add(__libnet_default_cb_idle, (gpointer)result);
-}
-
-static void __libnet_set_ethernet_cable_state_changed_cb(
- libnet_ethernet_cable_state_changed_cb user_cb)
-{
- libnet.ethernet_cable_state_changed_cb = user_cb;
-}
-
-static void __libnet_ethernet_cable_state_changed_cb(
- connection_ethernet_cable_state_e state)
-{
- if (libnet.ethernet_cable_state_changed_cb)
- libnet.ethernet_cable_state_changed_cb(state);
-}
-
-static void __libnet_type_changed_cb(int type)
-{
- if (libnet.type_changed_cb)
- libnet.type_changed_cb(type);
-}
-
-static void __libnet_ip_changed_cb(connection_address_family_e addr_family,
- char *ip_addr)
-{
- if (libnet.ip_changed_cb)
- libnet.ip_changed_cb(addr_family, ip_addr);
-}
-
-static void __libnet_proxy_changed_cb(char *proxy_addr)
-{
- if (libnet.proxy_changed_cb)
- libnet.proxy_changed_cb(proxy_addr);
-}
-
-static gboolean __libnet_state_changed_cb_idle(gpointer data)
-{
- struct _state_notify *notify = (struct _state_notify *)data;
-
- if (notify == NULL)
- return FALSE;
-
- if (notify->callback != NULL)
- notify->callback(notify->state, notify->user_data);
-
- g_free(notify);
-
- return FALSE;
-}
-