Add function for retrieving index value from service
authorMarcel Holtmann <marcel@holtmann.org>
Fri, 30 Jul 2010 02:34:54 +0000 (19:34 -0700)
committerMarcel Holtmann <marcel@holtmann.org>
Fri, 30 Jul 2010 02:34:54 +0000 (19:34 -0700)
src/connman.h
src/service.c

index 11fdc64..b58d264 100644 (file)
@@ -476,6 +476,7 @@ void __connman_service_nameserver_add_routes(struct connman_service *service,
                                                const char *gw);
 void __connman_service_nameserver_del_routes(struct connman_service *service);
 
+int __connman_service_get_index(struct connman_service *service);
 void __connman_service_set_domainname(struct connman_service *service,
                                                const char *domainname);
 const char *__connman_service_get_domainname(struct connman_service *service);
index b913db1..c2c6913 100644 (file)
@@ -429,6 +429,17 @@ void __connman_service_nameserver_del_routes(struct connman_service *service)
        }
 }
 
+int __connman_service_get_index(struct connman_service *service)
+{
+       if (service == NULL)
+               return -1;
+
+       if (service->network == NULL)
+               return -1;
+
+       return connman_network_get_index(service->network);
+}
+
 void __connman_service_set_domainname(struct connman_service *service,
                                                const char *domainname)
 {