From 0dec9ae6d61c72ed04a7b6c817f315769c70b673 Mon Sep 17 00:00:00 2001 From: Patrik Flykt Date: Mon, 31 Oct 2011 15:31:43 +0200 Subject: [PATCH] vpnc: Save support for vpnc Vpnc saves all settings with prefix 'VPNC.' --- plugins/vpnc.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/plugins/vpnc.c b/plugins/vpnc.c index e769e38..fceed6b 100644 --- a/plugins/vpnc.c +++ b/plugins/vpnc.c @@ -229,6 +229,23 @@ static int vc_write_config_data(struct connman_provider *provider, int fd) return 0; } +static int vc_save(struct connman_provider *provider, GKeyFile *keyfile) +{ + char *option; + int i; + + for (i = 0; i < (int)ARRAY_SIZE(vpnc_options); i++) { + if (strncmp(vpnc_options[i].cm_opt, "VPNC.", 5) == 0) { + option = connman_provider_get_string(provider, + vpnc_options[i].cm_opt); + g_key_file_set_string(keyfile, + connman_provider_get_save_group(provider), + vpnc_options[i].cm_opt, option); + } + } + return 0; +} + static int vc_connect(struct connman_provider *provider, struct connman_task *task, const char *if_name) { @@ -291,6 +308,7 @@ static struct vpn_driver vpn_driver = { .notify = vc_notify, .connect = vc_connect, .error_code = vc_error_code, + .save = vc_save, }; static int vpnc_init(void) -- 2.7.4