Send connman mailing list submissions to
[email protected]
To subscribe or unsubscribe via the World Wide Web, visit
https://lists.01.org/mailman/listinfo/connman
or, 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. Re: [PATCH v4 0/6] [PATCH v3 0/6] Add nftables support
(Daniel Wagner)
2. [PATCH] config: Make storage directory configurable from the
command line (Slava Monich)
3. Re: [PATCH] config: Make storage directory configurable from
the command line (Marcel Holtmann)
4. Re: [PATCH] config: Make storage directory configurable from
the command line (Slava Monich)
5. Re: [PATCH] config: Make storage directory configurable from
the command line (Marcel Holtmann)
----------------------------------------------------------------------
Message: 1
Date: Mon, 5 Sep 2016 07:43:00 +0200
From: Daniel Wagner <[email protected]>
To: Patrik Flykt <[email protected]>, Daniel Wagner
<[email protected]>, <[email protected]>
Subject: Re: [PATCH v4 0/6] [PATCH v3 0/6] Add nftables support
Message-ID: <[email protected]>
Content-Type: text/plain; charset="utf-8"; format=flowed
Hi Patrik,
On 09/02/2016 03:29 PM, Patrik Flykt wrote:
> On Thu, 2016-08-18 at 11:06 +0200, Daniel Wagner wrote:
>> From: Daniel Wagner <[email protected]>
>>
>> Thanks Dragos for testing and feedback. I tested NAT so far which
>> works nicely for me.
>>
>> changes v4:
>> - fixed nat rule (routing)
>> - rebased on current HEAD
>
> Applied. Doesn't eat my non-tethering non-session use cases and favors
> xtables over nftables.
Glad to hear. So I'll try to get my session setup running again and see
if we can get this lose end also fixed up.
cheers,
daniel
------------------------------
Message: 2
Date: Mon, 5 Sep 2016 13:58:24 +0300
From: Slava Monich <[email protected]>
To: [email protected]
Subject: [PATCH] config: Make storage directory configurable from the
command line
Message-ID: <[email protected]>
---
Makefile.am | 6 +++---
src/connman.h | 3 +++
src/main.c | 9 +++++++++
tools/session-test.c | 2 +-
vpn/main.c | 9 +++++++++
5 files changed, 25 insertions(+), 4 deletions(-)
diff --git a/Makefile.am b/Makefile.am
index 9c13630..3f4ea5e 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -223,7 +223,7 @@ AM_CFLAGS = @DBUS_CFLAGS@ @GLIB_CFLAGS@ \
-DVPN_STATEDIR=\""$(vpn_statedir)"\" \
-DPLUGINDIR=\""$(build_plugindir)"\" \
-DSCRIPTDIR=\""$(build_scriptdir)"\" \
- -DSTORAGEDIR=\""$(storagedir)\"" \
+ -DDEFAULT_STORAGEDIR=\""$(storagedir)\"" \
-DVPN_STORAGEDIR=\""$(vpn_storagedir)\"" \
-DCONFIGDIR=\""$(configdir)\""
@@ -239,7 +239,7 @@ src_connmand_CFLAGS = @DBUS_CFLAGS@ @GLIB_CFLAGS@ \
-DSTATEDIR=\""$(statedir)"\" \
-DPLUGINDIR=\""$(build_plugindir)"\" \
-DSCRIPTDIR=\""$(build_scriptdir)"\" \
- -DSTORAGEDIR=\""$(storagedir)\"" \
+ -DDEFAULT_STORAGEDIR=\""$(storagedir)\"" \
-DVPN_STORAGEDIR=\""$(vpn_storagedir)\"" \
-DCONFIGDIR=\""$(configdir)\"" \
-I$(builddir)/src
@@ -255,7 +255,7 @@ vpn_connman_vpnd_CFLAGS = @DBUS_CFLAGS@ @GLIB_CFLAGS@ \
-DVPN_STATEDIR=\""$(vpn_statedir)"\" \
-DPLUGINDIR=\""$(build_vpn_plugindir)"\" \
-DSCRIPTDIR=\""$(build_scriptdir)"\" \
- -DSTORAGEDIR=\""$(storagedir)\"" \
+ -DDEFAULT_STORAGEDIR=\""$(storagedir)\"" \
-DVPN_STORAGEDIR=\""$(vpn_storagedir)\"" \
-DCONFIGDIR=\""$(configdir)\"" \
-I$(builddir)/vpn
diff --git a/src/connman.h b/src/connman.h
index 401e3d7..b743678 100644
--- a/src/connman.h
+++ b/src/connman.h
@@ -253,6 +253,9 @@ int __connman_resolvfile_append(int index, const char
*domain, const char *serve
int __connman_resolvfile_remove(int index, const char *domain, const char
*server);
int __connman_resolver_redo_servers(int index);
+#define STORAGEDIR __connman_storage_dir()
+
+const char *__connman_storage_dir(void);
GKeyFile *__connman_storage_open_global(void);
GKeyFile *__connman_storage_load_global(void);
int __connman_storage_save_global(GKeyFile *keyfile);
diff --git a/src/main.c b/src/main.c
index fdb4f72..45bdddd 100644
--- a/src/main.c
+++ b/src/main.c
@@ -462,6 +462,7 @@ static void disconnect_callback(DBusConnection *conn, void
*user_data)
}
static gchar *option_config = NULL;
+static gchar *option_storagedir = NULL;
static gchar *option_debug = NULL;
static gchar *option_device = NULL;
static gchar *option_plugin = NULL;
@@ -473,6 +474,11 @@ static gboolean option_dnsproxy = TRUE;
static gboolean option_backtrace = TRUE;
static gboolean option_version = FALSE;
+const char *__connman_storage_dir(void)
+{
+ return option_storagedir ? option_storagedir : DEFAULT_STORAGEDIR;
+}
+
static bool parse_debug(const char *key, const char *value,
gpointer user_data, GError **error)
{
@@ -488,6 +494,9 @@ static GOptionEntry options[] = {
{ "config", 'c', 0, G_OPTION_ARG_STRING, &option_config,
"Load the specified configuration file "
"instead of " CONFIGMAINFILE, "FILE" },
+ { "storage", 's', 0, G_OPTION_ARG_STRING, &option_storagedir,
+ "Use the specified storage directory "
+ "instead of " DEFAULT_STORAGEDIR, "DIR" },
{ "debug", 'd', G_OPTION_FLAG_OPTIONAL_ARG,
G_OPTION_ARG_CALLBACK, parse_debug,
"Specify debug options to enable", "DEBUG" },
diff --git a/tools/session-test.c b/tools/session-test.c
index 4319e5a..855bfb6 100644
--- a/tools/session-test.c
+++ b/tools/session-test.c
@@ -32,7 +32,7 @@
#include "session-test.h"
-#define POLICYDIR STORAGEDIR "/session_policy_local"
+#define POLICYDIR DEFAULT_STORAGEDIR "/session_policy_local"
enum test_session_state {
TEST_SESSION_STATE_0 = 0,
diff --git a/vpn/main.c b/vpn/main.c
index ee88aac..3d0c8e8 100644
--- a/vpn/main.c
+++ b/vpn/main.c
@@ -185,6 +185,7 @@ static void disconnect_callback(DBusConnection *conn, void
*user_data)
}
static gchar *option_config = NULL;
+static gchar *option_storagedir = NULL;
static gchar *option_debug = NULL;
static gchar *option_plugin = NULL;
static gchar *option_noplugin = NULL;
@@ -192,6 +193,11 @@ static bool option_detach = true;
static bool option_version = false;
static bool option_routes = false;
+const char *__connman_storage_dir(void)
+{
+ return option_storagedir ? option_storagedir : DEFAULT_STORAGEDIR;
+}
+
static bool parse_debug(const char *key, const char *value,
gpointer user_data, GError **error)
{
@@ -207,6 +213,9 @@ static GOptionEntry options[] = {
{ "config", 'c', 0, G_OPTION_ARG_STRING, &option_config,
"Load the specified configuration file "
"instead of " CONFIGMAINFILE, "FILE" },
+ { "storage", 's', 0, G_OPTION_ARG_STRING, &option_storagedir,
+ "Use the specified storage directory "
+ "instead of " DEFAULT_STORAGEDIR, "DIR" },
{ "debug", 'd', G_OPTION_FLAG_OPTIONAL_ARG,
G_OPTION_ARG_CALLBACK, parse_debug,
"Specify debug options to enable", "DEBUG" },
--
1.9.1
------------------------------
Message: 3
Date: Mon, 5 Sep 2016 06:14:57 -0700
From: Marcel Holtmann <[email protected]>
To: Slava Monich <[email protected]>
Cc: [email protected]
Subject: Re: [PATCH] config: Make storage directory configurable from
the command line
Message-ID: <[email protected]>
Content-Type: text/plain; charset=us-ascii
Hi Slava,
> ---
> Makefile.am | 6 +++---
> src/connman.h | 3 +++
> src/main.c | 9 +++++++++
> tools/session-test.c | 2 +-
> vpn/main.c | 9 +++++++++
> 5 files changed, 25 insertions(+), 4 deletions(-)
>
> diff --git a/Makefile.am b/Makefile.am
> index 9c13630..3f4ea5e 100644
> --- a/Makefile.am
> +++ b/Makefile.am
> @@ -223,7 +223,7 @@ AM_CFLAGS = @DBUS_CFLAGS@ @GLIB_CFLAGS@ \
> -DVPN_STATEDIR=\""$(vpn_statedir)"\" \
> -DPLUGINDIR=\""$(build_plugindir)"\" \
> -DSCRIPTDIR=\""$(build_scriptdir)"\" \
> - -DSTORAGEDIR=\""$(storagedir)\"" \
> + -DDEFAULT_STORAGEDIR=\""$(storagedir)\"" \
> -DVPN_STORAGEDIR=\""$(vpn_storagedir)\"" \
> -DCONFIGDIR=\""$(configdir)\""
>
> @@ -239,7 +239,7 @@ src_connmand_CFLAGS = @DBUS_CFLAGS@ @GLIB_CFLAGS@ \
> -DSTATEDIR=\""$(statedir)"\" \
> -DPLUGINDIR=\""$(build_plugindir)"\" \
> -DSCRIPTDIR=\""$(build_scriptdir)"\" \
> - -DSTORAGEDIR=\""$(storagedir)\"" \
> + -DDEFAULT_STORAGEDIR=\""$(storagedir)\"" \
> -DVPN_STORAGEDIR=\""$(vpn_storagedir)\"" \
> -DCONFIGDIR=\""$(configdir)\"" \
> -I$(builddir)/src
> @@ -255,7 +255,7 @@ vpn_connman_vpnd_CFLAGS = @DBUS_CFLAGS@ @GLIB_CFLAGS@ \
> -DVPN_STATEDIR=\""$(vpn_statedir)"\" \
> -DPLUGINDIR=\""$(build_vpn_plugindir)"\" \
> -DSCRIPTDIR=\""$(build_scriptdir)"\" \
> - -DSTORAGEDIR=\""$(storagedir)\"" \
> + -DDEFAULT_STORAGEDIR=\""$(storagedir)\"" \
> -DVPN_STORAGEDIR=\""$(vpn_storagedir)\"" \
> -DCONFIGDIR=\""$(configdir)\"" \
> -I$(builddir)/vpn
> diff --git a/src/connman.h b/src/connman.h
> index 401e3d7..b743678 100644
> --- a/src/connman.h
> +++ b/src/connman.h
> @@ -253,6 +253,9 @@ int __connman_resolvfile_append(int index, const char
> *domain, const char *serve
> int __connman_resolvfile_remove(int index, const char *domain, const char
> *server);
> int __connman_resolver_redo_servers(int index);
>
> +#define STORAGEDIR __connman_storage_dir()
> +
> +const char *__connman_storage_dir(void);
> GKeyFile *__connman_storage_open_global(void);
> GKeyFile *__connman_storage_load_global(void);
> int __connman_storage_save_global(GKeyFile *keyfile);
> diff --git a/src/main.c b/src/main.c
> index fdb4f72..45bdddd 100644
> --- a/src/main.c
> +++ b/src/main.c
> @@ -462,6 +462,7 @@ static void disconnect_callback(DBusConnection *conn,
> void *user_data)
> }
>
> static gchar *option_config = NULL;
> +static gchar *option_storagedir = NULL;
> static gchar *option_debug = NULL;
> static gchar *option_device = NULL;
> static gchar *option_plugin = NULL;
> @@ -473,6 +474,11 @@ static gboolean option_dnsproxy = TRUE;
> static gboolean option_backtrace = TRUE;
> static gboolean option_version = FALSE;
>
> +const char *__connman_storage_dir(void)
> +{
> + return option_storagedir ? option_storagedir : DEFAULT_STORAGEDIR;
> +}
> +
> static bool parse_debug(const char *key, const char *value,
> gpointer user_data, GError **error)
> {
> @@ -488,6 +494,9 @@ static GOptionEntry options[] = {
> { "config", 'c', 0, G_OPTION_ARG_STRING, &option_config,
> "Load the specified configuration file "
> "instead of " CONFIGMAINFILE, "FILE" },
> + { "storage", 's', 0, G_OPTION_ARG_STRING, &option_storagedir,
> + "Use the specified storage directory "
> + "instead of " DEFAULT_STORAGEDIR, "DIR" },
> { "debug", 'd', G_OPTION_FLAG_OPTIONAL_ARG,
> G_OPTION_ARG_CALLBACK, parse_debug,
> "Specify debug options to enable", "DEBUG" },
> diff --git a/tools/session-test.c b/tools/session-test.c
> index 4319e5a..855bfb6 100644
> --- a/tools/session-test.c
> +++ b/tools/session-test.c
> @@ -32,7 +32,7 @@
>
> #include "session-test.h"
>
> -#define POLICYDIR STORAGEDIR "/session_policy_local"
> +#define POLICYDIR DEFAULT_STORAGEDIR "/session_policy_local"
>
> enum test_session_state {
> TEST_SESSION_STATE_0 = 0,
> diff --git a/vpn/main.c b/vpn/main.c
> index ee88aac..3d0c8e8 100644
> --- a/vpn/main.c
> +++ b/vpn/main.c
> @@ -185,6 +185,7 @@ static void disconnect_callback(DBusConnection *conn,
> void *user_data)
> }
>
> static gchar *option_config = NULL;
> +static gchar *option_storagedir = NULL;
> static gchar *option_debug = NULL;
> static gchar *option_plugin = NULL;
> static gchar *option_noplugin = NULL;
> @@ -192,6 +193,11 @@ static bool option_detach = true;
> static bool option_version = false;
> static bool option_routes = false;
>
> +const char *__connman_storage_dir(void)
> +{
> + return option_storagedir ? option_storagedir : DEFAULT_STORAGEDIR;
> +}
> +
> static bool parse_debug(const char *key, const char *value,
> gpointer user_data, GError **error)
> {
> @@ -207,6 +213,9 @@ static GOptionEntry options[] = {
> { "config", 'c', 0, G_OPTION_ARG_STRING, &option_config,
> "Load the specified configuration file "
> "instead of " CONFIGMAINFILE, "FILE" },
> + { "storage", 's', 0, G_OPTION_ARG_STRING, &option_storagedir,
> + "Use the specified storage directory "
> + "instead of " DEFAULT_STORAGEDIR, "DIR" },
why would this be useful as runtime configuration? It is a compile time option
on purpose.
Regards
Marcel
------------------------------
Message: 4
Date: Mon, 5 Sep 2016 16:35:58 +0300
From: Slava Monich <[email protected]>
To: Marcel Holtmann <[email protected]>
Cc: [email protected]
Subject: Re: [PATCH] config: Make storage directory configurable from
the command line
Message-ID: <[email protected]>
Content-Type: text/plain; charset=windows-1252; format=flowed
On 05/09/16 16:14, Marcel Holtmann wrote:
> Hi Slava,
>
>> static bool parse_debug(const char *key, const char *value,
>> gpointer user_data, GError **error)
>> {
>> @@ -207,6 +213,9 @@ static GOptionEntry options[] = {
>> { "config", 'c', 0, G_OPTION_ARG_STRING, &option_config,
>> "Load the specified configuration file "
>> "instead of " CONFIGMAINFILE, "FILE" },
>> + { "storage", 's', 0, G_OPTION_ARG_STRING, &option_storagedir,
>> + "Use the specified storage directory "
>> + "instead of " DEFAULT_STORAGEDIR, "DIR" },
> why would this be useful as runtime configuration? It is a compile time
> option on purpose.
>
> Regards
>
> Marcel
I guess for pretty much the same reason why configuration file is
selectable. If you have different connman runtime configurations, you
most likely want to switch the storage directory too.
If it goes against connman design or something, forget it then.
Cheers,
-Slava
------------------------------
Message: 5
Date: Mon, 5 Sep 2016 06:40:58 -0700
From: Marcel Holtmann <[email protected]>
To: Slava Monich <[email protected]>
Cc: [email protected]
Subject: Re: [PATCH] config: Make storage directory configurable from
the command line
Message-ID: <[email protected]>
Content-Type: text/plain; charset=windows-1252
Hi Slave,
>>> static bool parse_debug(const char *key, const char *value,
>>> gpointer user_data, GError **error)
>>> {
>>> @@ -207,6 +213,9 @@ static GOptionEntry options[] = {
>>> { "config", 'c', 0, G_OPTION_ARG_STRING, &option_config,
>>> "Load the specified configuration file "
>>> "instead of " CONFIGMAINFILE, "FILE" },
>>> + { "storage", 's', 0, G_OPTION_ARG_STRING, &option_storagedir,
>>> + "Use the specified storage directory "
>>> + "instead of " DEFAULT_STORAGEDIR, "DIR" },
>> why would this be useful as runtime configuration? It is a compile time
>> option on purpose.
>>
>> Regards
>>
>> Marcel
>
>
> I guess for pretty much the same reason why configuration file is selectable.
> If you have different connman runtime configurations, you most likely want to
> switch the storage directory too.
>
> If it goes against connman design or something, forget it then.
I do not even know why we have the --config option. It is from Grant back in
2012 and they used it for testing purposes. Does not sound all to useful to me.
And it also sounds that if you do this for testing, then the storage directory
should be rather an option to main.conf. If at all. As I said, if there is no
clear use case, then I rather not add feature creep.
Regards
Marcel
------------------------------
Subject: Digest Footer
_______________________________________________
connman mailing list
[email protected]
https://lists.01.org/mailman/listinfo/connman
------------------------------
End of connman Digest, Vol 11, Issue 5
**************************************