Send connman mailing list submissions to
        [email protected]

To subscribe or unsubscribe via email, send a message with subject or
body 'help' to
        [email protected]

You can reach the person managing the list at
        [email protected]

When replying, please edit your Subject line so it is more specific
than "Re: Contents of connman digest..."

Today's Topics:

   1. [PATCH] pptp: Support --idle-wait and --max-echo-wait options
      (Jussi Laakkonen)
   2. [PATCH v2] openvpn: Add support for --ping, --ping-exit and --remap-usr1
      (Jussi Laakkonen)
   3. Use math assignment help when you find it tough to write
      ([email protected])


----------------------------------------------------------------------

Date: Thu, 22 Oct 2020 14:38:27 +0300
From: Jussi Laakkonen <[email protected]>
Subject: [PATCH] pptp: Support --idle-wait and --max-echo-wait options
To: [email protected]
Message-ID: <[email protected]>

Implement support for --idle-wait and --max-echo-wait options. By
default these are set to 60 if omitted.

Added OPT_PPTP_ONLY to be able to separate these from the PPPD options.
All PPTP options need to be added with "pty" as one option in order for
them to work.
---
 vpn/plugins/pptp.c | 31 +++++++++++++++++++------------
 1 file changed, 19 insertions(+), 12 deletions(-)

diff --git a/vpn/plugins/pptp.c b/vpn/plugins/pptp.c
index 5fc861e4..0ede6f8b 100644
--- a/vpn/plugins/pptp.c
+++ b/vpn/plugins/pptp.c
@@ -54,15 +54,18 @@
 enum {
        OPT_STRING = 1,
        OPT_BOOL = 2,
+       OPT_PPTP_ONLY = 3,
 };
 
 struct {
        const char *cm_opt;
        const char *pptp_opt;
-       const char *vpnc_default;
+       const char *pptp_default;
        int type;
 } pptp_options[] = {
        { "PPTP.User", "user", NULL, OPT_STRING },
+       { "PPTP.IdleWait", "--idle-wait", NULL, OPT_PPTP_ONLY},
+       { "PPTP.MaxEchoWait", "--max-echo-wait", NULL, OPT_PPTP_ONLY},
        { "PPPD.EchoFailure", "lcp-echo-failure", "0", OPT_STRING },
        { "PPPD.EchoInterval", "lcp-echo-interval", "0", OPT_STRING },
        { "PPPD.Debug", "debug", NULL, OPT_STRING },
@@ -436,7 +439,9 @@ static int run_connect(struct vpn_provider *provider,
                        vpn_provider_connect_cb_t cb, void *user_data,
                        const char *username, const char *password)
 {
-       const char *opt_s, *host;
+       GString *pptp_opt_s;
+       const char *opt_s;
+       const char *host;
        char *str;
        int err, i;
 
@@ -450,16 +455,11 @@ static int run_connect(struct vpn_provider *provider,
        DBG("username %s password %p", username, password);
 
        host = vpn_provider_get_string(provider, "Host");
-       str = g_strdup_printf("%s %s --nolaunchpppd --loglevel 2",
-                               PPTP, host);
-       if (!str) {
-               connman_error("can not allocate memory");
-               err = -ENOMEM;
-               goto done;
-       }
 
-       connman_task_add_argument(task, "pty", str);
-       g_free(str);
+       /* Create PPTP options for pppd "pty" */
+       pptp_opt_s = g_string_new(NULL);
+       g_string_append_printf(pptp_opt_s, "%s %s --nolaunchpppd --loglevel 2",
+                               PPTP, host);
 
        connman_task_add_argument(task, "nodetach", NULL);
        connman_task_add_argument(task, "lock", NULL);
@@ -474,7 +474,7 @@ static int run_connect(struct vpn_provider *provider,
                opt_s = vpn_provider_get_string(provider,
                                        pptp_options[i].cm_opt);
                if (!opt_s)
-                       opt_s = pptp_options[i].vpnc_default;
+                       opt_s = pptp_options[i].pptp_default;
 
                if (!opt_s)
                        continue;
@@ -485,8 +485,15 @@ static int run_connect(struct vpn_provider *provider,
                else if (pptp_options[i].type == OPT_BOOL)
                        pptp_write_bool_option(task,
                                        pptp_options[i].pptp_opt, opt_s);
+               else if (pptp_options[i].type == OPT_PPTP_ONLY)
+                       g_string_append_printf(pptp_opt_s, " %s %s",
+                                       pptp_options[i].pptp_opt, opt_s);
        }
 
+       str = g_string_free(pptp_opt_s, FALSE);
+       connman_task_add_argument(task, "pty", str);
+       g_free(str);
+
        connman_task_add_argument(task, "plugin",
                                SCRIPTDIR "/libppp-plugin.so");
 
-- 
2.20.1

------------------------------

Date: Thu, 22 Oct 2020 14:45:25 +0300
From: Jussi Laakkonen <[email protected]>
Subject: [PATCH v2] openvpn: Add support for --ping, --ping-exit and
        --remap-usr1
To: [email protected]
Message-ID: <[email protected]>

Add support for --ping (OpenVPN.Ping) and --ping-exit (OpenVPN.PingExit)
configuration values. Set defaults of 10 for ping and 60 for ping exit
from https://community.openvpn.net/openvpn/wiki/Openvpn24ManPage

Set --ping-restart only with TCP since with UDP it is more feasible to
use --ping and --ping-exit with the default values if the values are
unset. If with TCP --ping-exit is set ignore --ping-restart as the values
are mutually exclusive.

Add --remap-usr1 option which remaps SIGUSR1 as SIGHUP/SIGTERM in order
to restart the process when errors are detected. OpenVPN does handle
some errors internally and it may not always be good with ConnMan
monitoring it.
---

Changes since v2:
 * Remove [openvpn] tag line from the commit message. 

 vpn/plugins/openvpn.c | 30 +++++++++++++++++++++++-------
 1 file changed, 23 insertions(+), 7 deletions(-)

diff --git a/vpn/plugins/openvpn.c b/vpn/plugins/openvpn.c
index abbf20d4..f11750f5 100644
--- a/vpn/plugins/openvpn.c
+++ b/vpn/plugins/openvpn.c
@@ -83,6 +83,9 @@ struct {
        { "OpenVPN.ConfigFile", "--config", 1 },
        { "OpenVPN.DeviceType", NULL, 1 },
        { "OpenVPN.Verb", "--verb", 1 },
+       { "OpenVPN.Ping", "--ping", 1},
+       { "OpenVPN.PingExit", "--ping-exit", 1},
+       { "OpenVPN.RemapUsr1", "--remap-usr1", 1},
 };
 
 struct ov_private_data {
@@ -496,16 +499,13 @@ static int run_connect(struct ov_private_data *data,
        connman_task_add_argument(task, "--ifconfig-noexec", NULL);
 
        /*
-        * Disable client restarts because we can't handle this at the
-        * moment. The problem is that when OpenVPN decides to switch
+        * Disable client restarts with TCP because we can't handle this at
+        * the moment. The problem is that when OpenVPN decides to switch
         * from CONNECTED state to RECONNECTING and then to RESOLVE,
         * it is not possible to do a DNS lookup. The DNS server is
         * not accessible through the tunnel anymore and so we end up
         * trying to resolve the OpenVPN servers address.
-        */
-       connman_task_add_argument(task, "--ping-restart", "0");
-
-       /*
+        *
         * Disable connetion retrying when OpenVPN is connected over TCP.
         * With TCP OpenVPN attempts to handle reconnection silently without
         * reporting the error back when establishing a connection or
@@ -515,8 +515,24 @@ static int run_connect(struct ov_private_data *data,
         * including DNS.
        */
        option = vpn_provider_get_string(provider, "OpenVPN.Proto");
-       if (option && g_str_has_prefix(option, "tcp"))
+       if (option && g_str_has_prefix(option, "tcp")) {
+               option = vpn_provider_get_string(provider, "OpenVPN.PingExit");
+               if (!option)
+                       connman_task_add_argument(task, "--ping-restart", "0");
+
                connman_task_add_argument(task, "--connect-retry-max", "1");
+       /* Apply defaults for --ping and --ping-exit only with UDP protocol. */
+       } else {
+               /* Apply default of 10 second interval for ping if omitted. */
+               option = vpn_provider_get_string(provider, "OpenVPN.Ping");
+               if (!option)
+                       connman_task_add_argument(task, "--ping", "10");
+
+               /* Apply default of 60 seconds for ping exit if omitted. */
+               option = vpn_provider_get_string(provider, "OpenVPN.PingExit");
+               if (!option)
+                       connman_task_add_argument(task, "--ping-exit", "60");
+       }
 
        err = connman_task_run(task, ov_died, data, NULL, NULL, NULL);
        if (err < 0) {
-- 
2.20.1

------------------------------

Date: Thu, 22 Oct 2020 17:55:23 -0000
From: [email protected]
Subject: Use math assignment help when you find it tough to write
To: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset="utf-8"

Use the best solution to handle all academic requirements effortlessly if you 
don’t want to your marks. Likewise, you can borrow experts’ assistance via math 
assignment help when you want to complete the assignment within the given date. 
These online writing services allow students to pay attention to their studies 
even having a workload of assignments. Working with professional and 
experienced writers, students can enhance their level of understanding and 
clear their doubts about different topics such as algebra, calculus, 
differentiation, and many more. As we know, mathematics doesn’t find it easy 
for many students. They find it tough to solve their questions and get exact 
answers. When you have less time or don’t have a proper understanding, you 
can’t submit your papers on time. Thus, you can choose a reliable service and 
receive effective academic papers on time. 
https://www.greatassignmenthelp.com/blog/what-is-the-best-way-to-solve-math-assignments-faster/

------------------------------

Subject: Digest Footer

_______________________________________________
connman mailing list -- [email protected]
To unsubscribe send an email to [email protected]


------------------------------

End of connman Digest, Vol 60, Issue 22
***************************************

Reply via email to