static void server_unregister_reply(DBusPendingCall *call, void *user_data) { struct connman_technology *technology = user_data; DBusError error; DBusMessage *reply; DBG(""); reply = dbus_pending_call_steal_reply(call); dbus_error_init(&error); if (dbus_set_error_from_message(&error, reply) == TRUE) { connman_error("%s", error.message); dbus_error_free(&error); dbus_message_unref(reply); dbus_pending_call_unref(call); return; } dbus_message_unref(reply); dbus_pending_call_unref(call); connman_technology_tethering_notify(technology, FALSE); }
static void disable_tethering(struct connman_technology *technology, const char *bridge) { GList *list; for (list = cdc_interface_list; list; list = list->next) { int index = GPOINTER_TO_INT(list->data); connman_inet_remove_from_bridge(index, bridge); connman_inet_ifdown(index); connman_technology_tethering_notify(technology, FALSE); } }
static void enable_tethering(struct connman_technology *technology, const char *bridge) { GList *list; for (list = cdc_interface_list; list; list = list->next) { int index = GPOINTER_TO_INT(list->data); connman_technology_tethering_notify(technology, TRUE); connman_inet_ifup(index); connman_inet_add_to_bridge(index, bridge); } }
static void tethering_create_cb(DBusMessage *message, void *user_data) { struct tethering_info *tethering = user_data; if (dbus_message_get_type(message) == DBUS_MESSAGE_TYPE_ERROR) { const char *dbus_error = dbus_message_get_error_name(message); DBG("%s tethering failed: %s", tethering->enable ? "enable" : "disable", dbus_error); return; } DBG("bridge %s %s", tethering->bridge, tethering->enable ? "enabled": "disabled"); if (tethering->technology) connman_technology_tethering_notify(tethering->technology, tethering->enable); }