summaryrefslogtreecommitdiff
path: root/plugins/openvpn.c
diff options
context:
space:
mode:
authorDaniel Wagner <daniel.wagner@bmw-carit.de>2010-12-17 15:52:01 +0100
committerSamuel Ortiz <sameo@linux.intel.com>2010-12-21 01:31:02 +0100
commit756ac7134faf93c05b1d4b639123d785cddfa164 (patch)
tree5bb6e560b457cd6677904baf5beaf4531590732f /plugins/openvpn.c
parentc6dc58620400f2f21e157144253b9ed20e49539f (diff)
downloadconnman-756ac7134faf93c05b1d4b639123d785cddfa164.tar.gz
connman-756ac7134faf93c05b1d4b639123d785cddfa164.tar.bz2
connman-756ac7134faf93c05b1d4b639123d785cddfa164.zip
openvpn: Pass in additional arguments
Pass into the OpenVPN plugin: - protocol - port - auth_user_pass - tls-remote - cipher - auth - comp-lzo
Diffstat (limited to 'plugins/openvpn.c')
-rw-r--r--plugins/openvpn.c39
1 files changed, 37 insertions, 2 deletions
diff --git a/plugins/openvpn.c b/plugins/openvpn.c
index 0da6c740..15169bde 100644
--- a/plugins/openvpn.c
+++ b/plugins/openvpn.c
@@ -130,6 +130,8 @@ static int ov_connect(struct connman_provider *provider,
struct connman_task *task, const char *if_name)
{
const char *vpnhost, *cafile, *mtu, *certfile, *keyfile;
+ const char *proto, *port, *auth_user_pass;
+ const char *tls_remote, *cipher, *auth, *comp_lzo;
int err, fd;
vpnhost = connman_provider_get_string(provider, "Host");
@@ -142,10 +144,43 @@ static int ov_connect(struct connman_provider *provider,
certfile = connman_provider_get_string(provider, "OpenVPN.Cert");
keyfile = connman_provider_get_string(provider, "OpenVPN.Key");
mtu = connman_provider_get_string(provider, "VPN.MTU");
-
- if (mtu)
+ proto = connman_provider_get_string(provider, "OpenVPN.Proto");
+ port = connman_provider_get_string(provider, "OpenVPN.Port");
+ auth_user_pass = connman_provider_get_string(provider,
+ "OpenVPN.AuthUserPass");
+ tls_remote = connman_provider_get_string(provider, "OpenVPN.TLSRemote");
+ cipher = connman_provider_get_string(provider, "OpenVPN.Cipher");
+ auth = connman_provider_get_string(provider, "OpenVPN.Auth");
+ comp_lzo = connman_provider_get_string(provider, "OpenVPN.CompLZO");
+
+ if (mtu != NULL)
connman_task_add_argument(task, "--mtu", (char *)mtu);
+ if (proto != NULL)
+ connman_task_add_argument(task, "--proto", (char *)proto);
+
+ if (port != NULL)
+ connman_task_add_argument(task, "--port", (char *)port);
+
+ if (auth_user_pass != NULL) {
+ connman_task_add_argument(task, "--auth-user-pass",
+ (char *)auth_user_pass);
+ }
+
+ if (tls_remote != NULL) {
+ connman_task_add_argument(task, "--tls-remote",
+ (char *)tls_remote);
+ }
+
+ if (cipher != NULL)
+ connman_task_add_argument(task, "--cipher", (char *)cipher);
+
+ if (auth != NULL)
+ connman_task_add_argument(task, "--auth", (char *)auth);
+
+ if (comp_lzo)
+ connman_task_add_argument(task, "--comp-lzo", (char *)comp_lzo);
+
connman_task_add_argument(task, "--syslog", NULL);
connman_task_add_argument(task, "--script-security", "2");