summaryrefslogtreecommitdiff
path: root/src/charon/control/interfaces/dbus_interface.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/charon/control/interfaces/dbus_interface.c')
-rw-r--r--src/charon/control/interfaces/dbus_interface.c55
1 files changed, 3 insertions, 52 deletions
diff --git a/src/charon/control/interfaces/dbus_interface.c b/src/charon/control/interfaces/dbus_interface.c
index d93a5d048..39226aaef 100644
--- a/src/charon/control/interfaces/dbus_interface.c
+++ b/src/charon/control/interfaces/dbus_interface.c
@@ -118,55 +118,6 @@ static child_cfg_t* get_child_from_peer(peer_cfg_t *peer_cfg, char *name)
return found;
}
-/**
- * get a peer configuration by its name, or a name of its children
- */
-static peer_cfg_t *get_peer_cfg_by_name(char *name)
-{
- iterator_t *i1, *i2;
- peer_cfg_t *current, *found = NULL;
- child_cfg_t *child;
-
- i1 = charon->backends->create_iterator(charon->backends);
- while (i1->iterate(i1, (void**)&current))
- {
- /* compare peer_cfgs name first */
- if (streq(current->get_name(current), name))
- {
- found = current;
- found->get_ref(found);
- break;
- }
- /* compare all child_cfg names otherwise */
- i2 = current->create_child_cfg_iterator(current);
- while (i2->iterate(i2, (void**)&child))
- {
- if (streq(child->get_name(child), name))
- {
- found = current;
- found->get_ref(found);
- break;
- }
- }
- i2->destroy(i2);
- if (found)
- {
- break;
- }
- }
- i1->destroy(i1);
- return found;
-}
-
-/**
- * logging dummy
- */
-static bool dbus_log(void *param, signal_t signal, level_t level,
- ike_sa_t *ike_sa, char *format, va_list args)
-{
- return TRUE;
-}
-
/**
* process NetworkManagers startConnection method call
@@ -197,7 +148,7 @@ static bool start_connection(private_dbus_interface_t *this, DBusMessage* msg)
}
set_state(this, NM_VPN_STATE_STARTING);
- peer_cfg = get_peer_cfg_by_name(name);
+ peer_cfg = charon->backends->get_peer_cfg_by_name(charon->backends, name);
if (peer_cfg)
{
free(this->name);
@@ -205,8 +156,8 @@ static bool start_connection(private_dbus_interface_t *this, DBusMessage* msg)
child_cfg = get_child_from_peer(peer_cfg, name);
if (child_cfg)
{
- status = charon->interfaces->initiate(charon->interfaces, peer_cfg,
- child_cfg, dbus_log, NULL);
+ status = charon->interfaces->initiate(charon->interfaces,
+ peer_cfg, child_cfg, interface_manager_cb_empty, NULL);
}
else
{