void connman_provider_unref(struct connman_provider *provider);
int connman_provider_set_string(struct connman_provider *provider,
- const char *key, const char *value);
+ const char *key, const char *value);
const char *connman_provider_get_string(struct connman_provider *provider,
- const char *key);
+ const char *key);
int connman_provider_set_connected(struct connman_provider *provider,
- connman_bool_t connected);
+ connman_bool_t connected);
void connman_provider_set_index(struct connman_provider *provider, int index);
int connman_provider_get_index(struct connman_provider *provider);
void *connman_provider_get_data(struct connman_provider *provider);
void connman_provider_set_gateway(struct connman_provider *provider,
- const char *gateway);
+ const char *gateway);
void connman_provider_set_address(struct connman_provider *provider,
- const char *address);
+ const char *address);
void connman_provider_set_netmask(struct connman_provider *provider,
- const char *netmask);
+ const char *netmask);
void connman_provider_set_dns(struct connman_provider *provider,
- const char *dns);
+ const char *dns);
void connman_provider_set_domain(struct connman_provider *provider,
- const char *domain);
+ const char *domain);
struct connman_provider_driver {
const char *name;
}
static void connman_provider_setup_vpn_ipv4(struct connman_provider *provider,
- struct connman_element *element)
+ struct connman_element *element)
{
if (element == NULL || provider == NULL)
return;
}
static gboolean match_driver(struct connman_provider *provider,
- struct connman_provider_driver *driver)
+ struct connman_provider_driver *driver)
{
if (g_strcmp0(driver->name, provider->type) == 0)
return TRUE;
reply_pending(provider, ECONNABORTED);
- if (provider->driver != NULL &&
- provider->driver->disconnect != NULL)
+ if (provider->driver != NULL && provider->driver->disconnect != NULL)
err = provider->driver->disconnect(provider);
else
return -EOPNOTSUPP;
__connman_provider_indicate_state(provider,
- CONNMAN_PROVIDER_STATE_DISCONNECT);
+ CONNMAN_PROVIDER_STATE_DISCONNECT);
if (err < 0) {
if (err != -EINPROGRESS)
return err;
}
int __connman_provider_indicate_state(struct connman_provider *provider,
- enum connman_provider_state state)
+ enum connman_provider_state state)
{
DBG("provider %p state %d", provider, state);
return -EINVAL;
if (state == CONNMAN_PROVIDER_STATE_IDLE &&
- provider->state != CONNMAN_PROVIDER_STATE_DISCONNECT) {
+ provider->state != CONNMAN_PROVIDER_STATE_DISCONNECT) {
provider->state = CONNMAN_PROVIDER_STATE_DISCONNECT;
state_changed(provider);
}
static DBusMessage *get_properties(DBusConnection *conn,
- DBusMessage *msg, void *user_data)
+ DBusMessage *msg, void *user_data)
{
struct connman_provider *provider = user_data;
DBusMessage *reply;
}
static GDBusMethodTable provider_methods[] = {
- { "GetProperties", "", "a{sv}", get_properties },
+ { "GetProperties", "", "a{sv}", get_properties },
{ },
};
};
int connman_provider_set_connected(struct connman_provider *provider,
- connman_bool_t connected)
+ connman_bool_t connected)
{
if (connected == TRUE) {
enum connman_element_type type = CONNMAN_ELEMENT_TYPE_UNKNOWN;
{
DBG("provider %p", provider);
- provider->state = CONNMAN_PROVIDER_STATE_UNKNOWN;
+ provider->state = CONNMAN_PROVIDER_STATE_UNKNOWN;
+
__connman_element_initialize(&provider->element);
+
provider->element.private = provider;
provider->element.destruct = provider_destruct;
DBG("path %s", provider->path);
g_dbus_register_interface(connection, provider->path,
- CONNMAN_PROVIDER_INTERFACE,
- provider_methods, provider_signals,
- NULL, provider, NULL);
+ CONNMAN_PROVIDER_INTERFACE,
+ provider_methods, provider_signals,
+ NULL, provider, NULL);
return 0;
}
goto failed;
}
- ident = g_strdup_printf("%s_%s",
- type, name);
+ ident = g_strdup_printf("%s_%s", type, name);
provider = connman_provider_lookup(ident);
goto failed;
g_dbus_send_reply(connection, msg,
- DBUS_TYPE_OBJECT_PATH, &provider->path,
- DBUS_TYPE_INVALID);
+ DBUS_TYPE_OBJECT_PATH, &provider->path,
+ DBUS_TYPE_INVALID);
return 0;
+
failed:
if (provider != NULL && created == TRUE) {
DBG("can not connect delete provider");
}
int connman_provider_set_string(struct connman_provider *provider,
- const char *key, const char *value)
+ const char *key, const char *value)
{
DBG("provider %p key %s value %s", provider, key, value);
}
const char *connman_provider_get_string(struct connman_provider *provider,
- const char *key)
+ const char *key)
{
DBG("provider %p key %s", provider, key);
DBG("driver %p name %s", driver, driver->name);
driver_list = g_slist_insert_sorted(driver_list, driver,
- compare_priority);
+ compare_priority);
return 0;
}