+static struct network_context *get_context_with_path(GSList *context_list,
+ const gchar *path)
+{
+ GSList *list;
+
+ DBG("path %s", path);
+
+ for (list = context_list; list; list = list->next) {
+ struct network_context *context = list->data;
+
+ if (g_strcmp0(context->path, path) == 0)
+ return context;
+ }
+
+ return NULL;
+}
+
+static struct network_context *get_context_with_network(GSList *context_list,
+ const struct connman_network *network)
+{
+ GSList *list;
+
+ DBG("network %p", network);
+
+ for (list = context_list; list; list = list->next) {
+ struct network_context *context = list->data;
+
+ if (context->network == network)
+ return context;
+ }
+
+ return NULL;
+}
+