char *config_entry;
};
+static void append_properties(DBusMessageIter *iter,
+ struct vpn_provider *provider);
+
static void free_route(gpointer data)
{
struct vpn_route *route = data;
provider);
}
+static DBusMessage *get_properties(DBusConnection *conn,
+ DBusMessage *msg, void *data)
+{
+ struct vpn_provider *provider = data;
+ DBusMessage *reply;
+ DBusMessageIter array;
+
+ DBG("provider %p", provider);
+
+ reply = dbus_message_new_method_return(msg);
+ if (reply == NULL)
+ return NULL;
+
+ dbus_message_iter_init_append(reply, &array);
+
+ append_properties(&array, provider);
+
+ return reply;
+}
+
static DBusMessage *set_property(DBusConnection *conn, DBusMessage *msg,
void *data)
{
}
static const GDBusMethodTable connection_methods[] = {
+ { GDBUS_METHOD("GetProperties",
+ NULL, GDBUS_ARGS({ "properties", "a{sv}" }),
+ get_properties) },
{ GDBUS_METHOD("SetProperty",
GDBUS_ARGS({ "name", "s" }, { "value", "v" }),
NULL, set_property) },
struct vpn_provider *provider)
{
DBusMessageIter dict;
+ GHashTableIter hash;
+ gpointer value, key;
connman_dbus_dict_open(iter, &dict);
DBUS_TYPE_DICT_ENTRY, append_routes,
provider->routes);
+ if (provider->setting_strings != NULL) {
+ g_hash_table_iter_init(&hash, provider->setting_strings);
+
+ while (g_hash_table_iter_next(&hash, &key, &value) == TRUE) {
+ struct vpn_setting *setting = value;
+
+ if (setting->hide_value == FALSE &&
+ setting->value != NULL)
+ connman_dbus_dict_append_basic(&dict, key,
+ DBUS_TYPE_STRING,
+ &setting->value);
+ }
+ }
+
connman_dbus_dict_close(iter, &dict);
}