ethernet: Fix small whitespace issue
[framework/connectivity/connman.git] / plugins / pptp.c
index 814be99..40f95ed 100644 (file)
@@ -56,7 +56,6 @@ struct {
        int type;
 } pptp_options[] = {
        { "PPTP.User", "user", NULL, OPT_STRING },
-       { "PPTP.Password", "password", NULL, OPT_STRING },
        { "PPTP.EchoFailure", "lcp-echo-failure", "0", OPT_STRING },
        { "PPTP.EchoInterval", "lcp-echo-interval", "0", OPT_STRING },
        { "PPTP.Debug", "debug", NULL, OPT_STRING },
@@ -202,6 +201,26 @@ static int pptp_notify(DBusMessage *msg, struct connman_provider *provider)
        return VPN_STATE_CONNECT;
 }
 
+static int pptp_save(struct connman_provider *provider, GKeyFile *keyfile)
+{
+       const char *option;
+       int i;
+
+       for (i = 0; i < (int)ARRAY_SIZE(pptp_options); i++) {
+               if (strncmp(pptp_options[i].cm_opt, "PPTP.", 5) == 0) {
+                       option = connman_provider_get_string(provider,
+                                                       pptp_options[i].cm_opt);
+                       if (option == NULL)
+                               continue;
+
+                       g_key_file_set_string(keyfile,
+                                       connman_provider_get_save_group(provider),
+                                       pptp_options[i].cm_opt, option);
+               }
+       }
+       return 0;
+}
+
 static void pptp_write_bool_option(struct connman_task *task,
                                const char *key, const char *value)
 {
@@ -296,6 +315,7 @@ static struct vpn_driver vpn_driver = {
        .notify         = pptp_notify,
        .connect        = pptp_connect,
        .error_code     = pptp_error_code,
+       .save           = pptp_save,
 };
 
 static int pptp_init(void)