diff options
author | Jukka Rissanen <jukka.rissanen@linux.intel.com> | 2011-11-15 13:06:31 +0200 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2011-11-15 13:41:45 +0100 |
commit | c84e03f70330a9407c04f32b43daae2013f8420f (patch) | |
tree | 2cffa0688b40747eeeda621da9a38b002c234010 /plugins/l2tp.c | |
parent | 35afa7e08162c76c5660a9dc6626bb103b99c1ea (diff) | |
download | connman-c84e03f70330a9407c04f32b43daae2013f8420f.tar.gz connman-c84e03f70330a9407c04f32b43daae2013f8420f.tar.bz2 connman-c84e03f70330a9407c04f32b43daae2013f8420f.zip |
l2tp: Config save support added
Diffstat (limited to 'plugins/l2tp.c')
-rw-r--r-- | plugins/l2tp.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/plugins/l2tp.c b/plugins/l2tp.c index 78b8e373..2dd415a9 100644 --- a/plugins/l2tp.c +++ b/plugins/l2tp.c @@ -240,6 +240,23 @@ static int l2tp_notify(DBusMessage *msg, struct connman_provider *provider) return VPN_STATE_CONNECT; } +static int l2tp_save(struct connman_provider *provider, GKeyFile *keyfile) +{ + const char *option; + int i; + + for (i = 0; i < (int)ARRAY_SIZE(pppd_options); i++) { + if (strncmp(pppd_options[i].cm_opt, "L2TP.", 5) == 0) { + option = connman_provider_get_string(provider, + pppd_options[i].cm_opt); + g_key_file_set_string(keyfile, + connman_provider_get_save_group(provider), + pppd_options[i].cm_opt, option); + } + } + return 0; +} + static ssize_t full_write(int fd, const void *buf, size_t len) { ssize_t byte_write; @@ -489,6 +506,7 @@ static struct vpn_driver vpn_driver = { .notify = l2tp_notify, .connect = l2tp_connect, .error_code = l2tp_error_code, + .save = l2tp_save, }; static int l2tp_init(void) |