openconnect: Save support for openconnect VPN
authorPatrik Flykt <patrik.flykt@linux.intel.com>
Mon, 31 Oct 2011 13:31:41 +0000 (15:31 +0200)
committerSamuel Ortiz <sameo@linux.intel.com>
Mon, 7 Nov 2011 16:40:08 +0000 (17:40 +0100)
Openconnect saves VPN MTU, Server and CA cert file paths.

plugins/openconnect.c

index 5c8db26..25060d0 100644 (file)
@@ -219,6 +219,31 @@ static int oc_connect(struct connman_provider *provider,
        return 0;
 }
 
+static int oc_save (struct connman_provider *provider, GKeyFile *keyfile)
+{
+       const char *setting;
+
+       setting = connman_provider_get_string(provider,
+                                       "OpenConnect.ServerCert");
+       g_key_file_set_string(keyfile,
+                       connman_provider_get_save_group(provider),
+                       "OpenConnect.ServerCert", setting);
+
+       setting = connman_provider_get_string(provider,
+                                       "OpenConnect.CACert");
+       g_key_file_set_string(keyfile,
+                       connman_provider_get_save_group(provider),
+                       "OpenConnect.CACert", setting);
+
+       setting = connman_provider_get_string(provider,
+                                       "VPN.MTU");
+       g_key_file_set_string(keyfile,
+                       connman_provider_get_save_group(provider),
+                       "VPN.MTU", setting);
+
+       return 0;
+}
+
 static int oc_error_code(int exit_code)
 {
 
@@ -236,6 +261,7 @@ static struct vpn_driver vpn_driver = {
        .notify         = oc_notify,
        .connect        = oc_connect,
        .error_code     = oc_error_code,
+       .save           = oc_save,
 };
 
 static int openconnect_init(void)