diff --git a/src/agent.c b/src/agent.c
index b7d506c..ea2f7e5 100644
--- a/src/agent.c
+++ b/src/agent.c
g_free(agent);
}
+struct agent *agent_get(const char *owner)
+{
+ struct agent *agent;
+
+ agent = g_hash_table_lookup(agent_list, owner);
+ if (!agent)
+ agent = g_hash_table_lookup(agent_list, NULL);
+
+ if (!agent)
+ return NULL;
+
+ return agent_ref(agent);
+}
+
struct agent *agent_create(struct btd_adapter *adapter, const char *name,
const char *path, uint8_t capability,
agent_remove_cb cb, void *remove_cb_data)
diff --git a/src/agent.h b/src/agent.h
index 769cd82..9e70aa8 100644
--- a/src/agent.h
+++ b/src/agent.h
struct agent *agent_ref(struct agent *agent);
void agent_unref(struct agent *agent);
+struct agent *agent_get(const char *owner);
+
int agent_authorize_service(struct agent *agent, const char *path,
const char *uuid, agent_cb cb,
void *user_data, GDestroyNotify destroy);