Hi Daniel,
On Mon, Dec 13, 2010 at 03:07:55PM +0100, Daniel Wagner wrote:
> From: Daniel Wagner <[email protected]>
>
> Pass into the OpenVPN plugin:
> - protocol
> - port
> - auth_user_pass
> - tls-remote
> - cipher
> - auth
> - comp-lzo
> ---
> plugins/openvpn.c | 39 +++++++++++++++++++++++++++++++++++++--
> 1 files changed, 37 insertions(+), 2 deletions(-)
Looks mostly fine to me, I just have one cosmetic comment:
> diff --git a/plugins/openvpn.c b/plugins/openvpn.c
> index 0da6c74..0a71f5d 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");
> @@ -141,11 +143,44 @@ static int ov_connect(struct connman_provider *provider,
> cafile = connman_provider_get_string(provider, "OpenVPN.CACert");
> 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)
> + mtu = connman_provider_get_string(provider, "VPN.MTU");
> + if (mtu != NULL)
> connman_task_add_argument(task, "--mtu", (char *)mtu);
>
> + proto = connman_provider_get_string(provider, "OpenVPN.Proto");
> + if (proto != NULL)
> + connman_task_add_argument(task, "--proto", (char *)proto);
> +
> + port = connman_provider_get_string(provider, "OpenVPN.Port");
> + if (port != NULL)
> + connman_task_add_argument(task, "--port", (char *)port);
> +
> + auth_user_pass = connman_provider_get_string(provider,
> + "OpenVPN.AuthUserPass");
> + if (auth_user_pass != NULL) {
> + connman_task_add_argument(task, "--auth-user-pass",
> + (char *)auth_user_pass);
> + }
> +
> + tls_remote = connman_provider_get_string(provider, "OpenVPN.TLSRemote");
> + if (tls_remote != NULL) {
> + connman_task_add_argument(task, "--tls-remote",
> + (char *)tls_remote);
> + }
> +
> + cipher = connman_provider_get_string(provider, "OpenVPN.Cipher");
> + if (cipher != NULL)
> + connman_task_add_argument(task, "--cipher", (char *)cipher);
> +
> + auth = connman_provider_get_string(provider, "OpenVPN.Auth");
> + if (auth != NULL)
> + connman_task_add_argument(task, "--auth", (char *)auth);
> +
> + comp_lzo = connman_provider_get_string(provider, "OpenVPN.CompLZO");
> + if (comp_lzo)
> + connman_task_add_argument(task, "--comp-lzo", (char *)comp_lzo);
> +
To stay consistent with the current ov_connect() code, could we group the
connman_provider_get_string() calls together ?
Cheers,
Samuel.
--
Intel Open Source Technology Centre
http://oss.intel.com/
_______________________________________________
connman mailing list
[email protected]
http://lists.connman.net/listinfo/connman