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,
const char *name,
enum connman_service_state state);
service = g_sequence_get(iter);
if (service_match(session, service) == TRUE) {
- entry = create_service_entry(service, service->name,
- service->state);
+ entry = create_service_entry(session, service,
+ service->name, service->state);
if (entry == NULL)
return list;
};
struct service_entry {
+ struct connman_session *session;
/* track why this service was selected */
enum connman_session_reason reason;
enum connman_service_state state;
}
}
-static struct service_entry *create_service_entry(struct connman_service *service,
+static struct service_entry *create_service_entry(struct connman_session * session,
+ struct connman_service *service,
const char *name,
enum connman_service_state state)
{
type = connman_service_get_type(entry->service);
entry->bearer = service2bearer(type);
+ entry->session = session;
+
return entry;
}
if (service_match(session, service) == FALSE)
continue;
- entry = create_service_entry(service, name,
+ entry = create_service_entry(session, service, name,
CONNMAN_SERVICE_STATE_IDLE);
if (entry == NULL)
continue;