service: Add function to set identity
authorHenri Bragge <henri.bragge@ixonos.com>
Thu, 31 Mar 2011 12:49:30 +0000 (15:49 +0300)
committerSamuel Ortiz <sameo@linux.intel.com>
Fri, 1 Apr 2011 16:25:20 +0000 (18:25 +0200)
src/connman.h
src/service.c

index aa6d790..4d3711d 100644 (file)
@@ -547,6 +547,8 @@ const char *__connman_service_get_nameserver(struct connman_service *service);
 void __connman_service_set_proxy_autoconfig(struct connman_service *service,
                                                        const char *url);
 
+void __connman_service_set_identity(struct connman_service *service,
+                                       const char *identity);
 void __connman_service_set_passphrase(struct connman_service *service,
                                        const char* passphrase);
 
index 9243562..8abda39 100644 (file)
@@ -2011,6 +2011,21 @@ void __connman_service_set_pac(struct connman_service *service,
        service->pac = g_strdup(pac);
 }
 
+void __connman_service_set_identity(struct connman_service *service,
+                                       const char *identity)
+{
+       if (service->immutable)
+               return;
+
+       g_free(service->identity);
+       service->identity = g_strdup(identity);
+
+       if (service->network != NULL)
+               connman_network_set_string(service->network,
+                                       "WiFi.Identity",
+                                       service->identity);
+}
+
 void __connman_service_set_passphrase(struct connman_service *service,
                                        const char* passphrase)
 {