provider: Check if there are any routes for the provider
authorJukka Rissanen <jukka.rissanen@linux.intel.com>
Thu, 5 Apr 2012 09:00:47 +0000 (12:00 +0300)
committerPatrik Flykt <patrik.flykt@linux.intel.com>
Thu, 5 Apr 2012 11:17:38 +0000 (14:17 +0300)
src/connman.h
src/provider.c

index 556b9e1..e97f856 100644 (file)
@@ -498,6 +498,7 @@ int __connman_private_network_release(const char *path);
 
 #include <connman/provider.h>
 
+connman_bool_t __connman_provider_check_routes(struct connman_provider *provider);
 int __connman_provider_append_user_route(struct connman_provider *provider,
                        int family, const char *network, const char *netmask);
 void __connman_provider_append_properties(struct connman_provider *provider, DBusMessageIter *iter);
index b893e20..42fd112 100644 (file)
@@ -970,6 +970,23 @@ const char *connman_provider_get_string(struct connman_provider *provider,
        return g_hash_table_lookup(provider->setting_strings, key);
 }
 
+connman_bool_t
+__connman_provider_check_routes(struct connman_provider *provider)
+{
+       if (provider == NULL)
+               return FALSE;
+
+       if (provider->user_routes != NULL &&
+                       g_hash_table_size(provider->user_routes) > 0)
+               return TRUE;
+
+       if (provider->routes != NULL &&
+                       g_hash_table_size(provider->routes) > 0)
+               return TRUE;
+
+       return FALSE;
+}
+
 void *connman_provider_get_data(struct connman_provider *provider)
 {
        return provider->driver_data;