path: root/src/connman.h
diff options
authorDaniel Wagner <>2013-06-07 13:41:10 +0200
committerPatrik Flykt <>2013-06-10 09:48:22 +0300
commit934226962d3caaa538e1424eba9364915bbe7278 (patch)
tree6071f8ac7e5808976dc4e66e23766b16df4b3325 /src/connman.h
parent2386b677cb7223094b3348d852514df06d39b16b (diff)
session: Use service iterator instead of match/creation callbacks
When a new session is created we need to get the initial list of services which match the session AllowedBearers criteria. As soon the session is running add or removed services are tracked via the notifier interface. We concluded that exposing all the services is not really necessary and therefore we are using currently two callbacks to get the initial list. That exposes implementation details from session to service, that is GSequence. We also need to expose the type 'struct service_entry'. Instead doing so we are using an iterator and keep all the implementation details in session.c.
Diffstat (limited to 'src/connman.h')
1 files changed, 4 insertions, 11 deletions
diff --git a/src/connman.h b/src/connman.h
index f4de8877..75f136fb 100644
--- a/src/connman.h
+++ b/src/connman.h
@@ -710,19 +710,12 @@ void __connman_service_counter_unregister(const char *counter);
#include <connman/session.h>
-struct service_entry;
-typedef connman_bool_t (* service_match_cb) (struct connman_session *session,
- struct connman_service *service);
-typedef struct service_entry* (* create_service_entry_cb) (
- struct connman_session *session,
- struct connman_service *service,
+typedef void (* service_iterate_cb) (struct connman_service *service,
const char *name,
- enum connman_service_state state);
+ enum connman_service_state state,
+ void *user_data);
-GSequence *__connman_service_get_list(struct connman_session *session,
- service_match_cb service_match,
- create_service_entry_cb create_service_entry,
- GDestroyNotify destroy_service_entry);
+int __connman_service_iterate_services(service_iterate_cb cb, void *user_data);
void __connman_service_session_inc(struct connman_service *service);
connman_bool_t __connman_service_session_dec(struct connman_service *service);