[PATCH v3] gdbus: Fix crash error when calling g_dbus_remove_all_watches

2012-10-04 Thread Tomasz Bursztyka
--- Hi, While using gdbus on some other code, I found out that bug around g_dbus_remove_all_watches() usage. I guess it should be fixed in all projects using gdbus. It could be fixed also via removing "g_free(cb);" in the previous for() loop instead, but I preferred not, since it would then r

[PATCH 09/34] provider: Add more driver interface functions needed by vpnd plugin

2012-10-04 Thread Jukka Rissanen
--- include/provider.h | 5 + 1 file changed, 5 insertions(+) diff --git a/include/provider.h b/include/provider.h index cd059a8..dc86bca 100644 --- a/include/provider.h +++ b/include/provider.h @@ -111,6 +111,11 @@ struct connman_provider_driver { int (*connect) (struct connman_provi

[PATCH 00/34] VPN re-design/factoring

2012-10-04 Thread Jukka Rissanen
Hi, After a couple of RFC rounds, the VPN patches are more or less usable. This patchset provides drop-in replacement for current VPN functionality, so the ConnectProvider and RemoveProvider APIs in net.connman.Manager object still work but are marked as deprecated (could be removed at ConnMan 2.0

[PATCH 10/34] provider: Remove obsolete stuff

2012-10-04 Thread Jukka Rissanen
--- include/provider.h | 3 + src/provider.c | 958 - 2 files changed, 71 insertions(+), 890 deletions(-) diff --git a/include/provider.h b/include/provider.h index dc86bca..67df67a 100644 --- a/include/provider.h +++ b/include/provider.h

[PATCH 01/34] doc: VPN daemon API descriptions

2012-10-04 Thread Jukka Rissanen
--- doc/vpn-connection-api.txt | 140 + doc/vpn-manager-api.txt| 50 doc/vpn-overview.txt | 60 +++ 3 files changed, 250 insertions(+) create mode 100644 doc/vpn-connection-api.txt create mode 100644 doc/vpn

[PATCH 04/34] log: Give program name and version in log init

2012-10-04 Thread Jukka Rissanen
This allows the correct output when the log functions are used from separate vpn daemon. --- src/connman.h | 3 ++- src/log.c | 5 +++-- src/main.c | 2 +- unit/test-nat.c | 2 +- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/connman.h b/src/connman.h index cd8ee1

[PATCH 02/34] ipconfig: Move IP address API into separate ipaddress.c file

2012-10-04 Thread Jukka Rissanen
Done so that connman_ipaddress_* functions can be used from separate vpn daemon. --- Makefile.am | 4 +- include/ipaddress.h | 56 +++ include/ipconfig.h | 19 + src/connman.h | 2 +- src/dhcp.c | 4 +- src/ipaddress.c | 200 +

[PATCH 03/34] device: Move device creation func into device.c

2012-10-04 Thread Jukka Rissanen
The device creation function should be part of device.c and not inet.c. After this change the inet.c can be used by separate vpn daemon. --- include/device.h | 1 + include/inet.h| 1 - plugins/iwmxsdk.c | 4 +- src/detect.c | 2 +- src/device.c | 178 +++

[PATCH 07/34] test: New VPN test script that connect to connman-vpnd

2012-10-04 Thread Jukka Rissanen
--- Makefile.am | 4 test/vpn-connect| 24 test/vpn-disconnect | 24 test/vpn-get| 43 +++ 4 files changed, 95 insertions(+) create mode 100755 test/vpn-connect create mode 100755

[PATCH 06/34] test: Renamed old VPN scripts

2012-10-04 Thread Jukka Rissanen
Renamed connect-vpn to connect-provider and disconnect-vpn to remove-provider In order to not confuse the user, change the name of the old vpn connect/disconnect script. Now the name of the script reflects the name of the manager dbus api. The connect-provider will use the old ConnectProvider mana

[PATCH 08/34] provider: Provider disconnect function made available to plugin

2012-10-04 Thread Jukka Rissanen
The VPN needs to be able to call the provider disconnect. --- include/provider.h | 2 ++ src/connman.h | 1 - src/provider.c | 4 ++-- src/service.c | 8 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/include/provider.h b/include/provider.h index 2a71b95..cd0

[PATCH 12/34] plugin: Add VPN plugin that will interact with vpnd

2012-10-04 Thread Jukka Rissanen
--- Makefile.plugins |3 + plugins/vpn.c| 1158 ++ 2 files changed, 1161 insertions(+) create mode 100644 plugins/vpn.c diff --git a/Makefile.plugins b/Makefile.plugins index 2c5d66d..1ab0543 100644 --- a/Makefile.plugins +++ b/Makefile

[PATCH 11/34] provider: Support functions added

2012-10-04 Thread Jukka Rissanen
--- include/provider.h | 2 ++ src/provider.c | 65 ++ 2 files changed, 67 insertions(+) diff --git a/include/provider.h b/include/provider.h index 67df67a..b663f37 100644 --- a/include/provider.h +++ b/include/provider.h @@ -94,6 +94,8 @@

[PATCH 13/34] provider: Initially provider ipconfigs are now OFF

2012-10-04 Thread Jukka Rissanen
The ipconfig is marked as fixed when IP address is set to that ipconfig. --- src/provider.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/provider.c b/src/provider.c index 696ed87..64a871b 100644 --- a/src/provider.c +++ b/src/provider.c @@ -439,10 +439,9 @@ void con

[PATCH 14/34] provider: Move around server and user route handling

2012-10-04 Thread Jukka Rissanen
--- include/provider.h | 10 ++ plugins/vpn.c | 292 +++- src/provider.c | 42 +-- vpn/vpn-provider.c | 352 ++--- 4 files changed, 556 insertions(+), 140 deletions(-) diff --git a/include/provi

[PATCH 15/34] vpn: Resolve vpn hostname if necessary

2012-10-04 Thread Jukka Rissanen
--- plugins/vpn.c | 106 - vpn/vpn-provider.c | 8 +++- 2 files changed, 112 insertions(+), 2 deletions(-) diff --git a/plugins/vpn.c b/plugins/vpn.c index aff821b..92dc0f0 100644 --- a/plugins/vpn.c +++ b/plugins/vpn.c @@ -40,6 +40,7 @@

[PATCH 16/34] vpnd: Add -r option which enables route handling in vpnd

2012-10-04 Thread Jukka Rissanen
By default routes are handled by connman daemon. --- vpn/main.c | 5 - vpn/vpn-provider.c | 26 ++ vpn/vpn.h | 2 +- 3 files changed, 27 insertions(+), 6 deletions(-) diff --git a/vpn/main.c b/vpn/main.c index e89d29b..e22a46c 100644 --- a/vpn/main.c

[PATCH 17/34] vpn: Hash provider data using the ident instead of path

2012-10-04 Thread Jukka Rissanen
Needed as sometimes we do not know the path but know the ident. --- plugins/vpn.c | 118 +++--- 1 file changed, 79 insertions(+), 39 deletions(-) diff --git a/plugins/vpn.c b/plugins/vpn.c index 92dc0f0..22ed946 100644 --- a/plugins/vpn.c +++ b/

[PATCH 18/34] doc: Example configuration file for vpnd

2012-10-04 Thread Jukka Rissanen
--- vpn/connman-vpn.conf | 8 1 file changed, 8 insertions(+) create mode 100644 vpn/connman-vpn.conf diff --git a/vpn/connman-vpn.conf b/vpn/connman-vpn.conf new file mode 100644 index 000..99a96ce --- /dev/null +++ b/vpn/connman-vpn.conf @@ -0,0 +1,8 @@ +[General] + +# Set input r

[PATCH 20/34] agent: Split agent code into generic and service specific parts

2012-10-04 Thread Jukka Rissanen
--- Makefile.am | 6 +- include/agent.h | 73 + src/agent-connman.c | 627 +++ src/agent.c | 838 +++- src/connman.h | 9 - src/main.c | 4 +- src/manager.c | 6

[PATCH 19/34] vpn: Introduce config file for vpnd

2012-10-04 Thread Jukka Rissanen
--- vpn/main.c | 82 ++ 1 file changed, 82 insertions(+) diff --git a/vpn/main.c b/vpn/main.c index e22a46c..1decbec 100644 --- a/vpn/main.c +++ b/vpn/main.c @@ -42,10 +42,73 @@ #include "vpn-dbus.h" +#define CONFIGMAINFILE CONFIGDI

[PATCH 21/34] vpn: Add preliminary agent support

2012-10-04 Thread Jukka Rissanen
--- include/vpn-dbus.h | 1 + vpn/main.c | 2 ++ vpn/vpn-manager.c | 47 +++ 3 files changed, 50 insertions(+) diff --git a/include/vpn-dbus.h b/include/vpn-dbus.h index fec925b..01780cb 100644 --- a/include/vpn-dbus.h +++ b/include/vpn-dbus.

[PATCH 22/34] manager: Deprecating connect/remove provider API

2012-10-04 Thread Jukka Rissanen
The VPN configuration API is provided by connman-vpnd instead of connmand. --- doc/manager-api.txt | 6 +- src/manager.c | 4 ++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/doc/manager-api.txt b/doc/manager-api.txt index ca193aa..ed23c8d 100644 --- a/doc/manager-api.

[PATCH 23/34] ipconfig: Add ipconfig unref function

2012-10-04 Thread Jukka Rissanen
--- vpn/vpn-ipconfig.c | 17 + vpn/vpn.h | 4 2 files changed, 21 insertions(+) diff --git a/vpn/vpn-ipconfig.c b/vpn/vpn-ipconfig.c index cb5167f..7e1d77e 100644 --- a/vpn/vpn-ipconfig.c +++ b/vpn/vpn-ipconfig.c @@ -257,6 +257,23 @@ int __vpn_ipconfig_gateway_add(s

[PATCH 24/34] vpn: Free allocated ipconfig struct

2012-10-04 Thread Jukka Rissanen
--- vpn/vpn-provider.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/vpn/vpn-provider.c b/vpn/vpn-provider.c index 41d7e87..1f39116 100644 --- a/vpn/vpn-provider.c +++ b/vpn/vpn-provider.c @@ -673,6 +673,9 @@ static void provider_destruct(struct vpn_provider *provider) g_r

[PATCH 25/34] provider: Removed the connect part from the create() function

2012-10-04 Thread Jukka Rissanen
The connect operation is done separately from create operation in connman-vpnd so change the function to reflect that. --- vpn/vpn-manager.c | 2 +- vpn/vpn-provider.c | 32 +++- vpn/vpn.h | 2 +- 3 files changed, 13 insertions(+), 23 deletions(-) diff --gi

[PATCH 26/34] vpn-provider: Send ConnectionAdded signal when needed

2012-10-04 Thread Jukka Rissanen
--- vpn/vpn-provider.c | 21 + 1 file changed, 21 insertions(+) diff --git a/vpn/vpn-provider.c b/vpn/vpn-provider.c index 98b76e6..c1d718f 100644 --- a/vpn/vpn-provider.c +++ b/vpn/vpn-provider.c @@ -974,6 +974,25 @@ static void append_properties(DBusMessageIter *iter,

[PATCH 27/34] provider: Add callback when creating vpn provider

2012-10-04 Thread Jukka Rissanen
Because the vpnd Create() in manager API only creates and does not connect the vpn, we must do the connect part after the vpn is created. This requires a callback which is called when the connection is established. Eventually this patch becomes obsolete because the CreateProvider() connman API is d

[PATCH 28/34] storage: Add function to remove provider files

2012-10-04 Thread Jukka Rissanen
--- src/connman.h | 1 + src/storage.c | 47 +++ 2 files changed, 48 insertions(+) diff --git a/src/connman.h b/src/connman.h index 8a33ba7..8a1a62c 100644 --- a/src/connman.h +++ b/src/connman.h @@ -212,6 +212,7 @@ GKeyFile *__connman_storage_open_ser

[PATCH 29/34] provider: Do not remove the provider as it would remove it from storage

2012-10-04 Thread Jukka Rissanen
--- src/provider.c | 16 +--- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/src/provider.c b/src/provider.c index ab8ced4..dc5399d 100644 --- a/src/provider.c +++ b/src/provider.c @@ -110,8 +110,6 @@ void connman_provider_unref_debug(struct connman_provider *provider,

[PATCH 30/34] vpn-provider: Send ConnectionRemoved signal when needed

2012-10-04 Thread Jukka Rissanen
--- vpn/vpn-provider.c | 38 +- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/vpn/vpn-provider.c b/vpn/vpn-provider.c index c1d718f..6b45367 100644 --- a/vpn/vpn-provider.c +++ b/vpn/vpn-provider.c @@ -746,16 +746,52 @@ int __vpn_provider_connect

[PATCH 31/34] vpn-provider: Remove vpn provider from storage when needed

2012-10-04 Thread Jukka Rissanen
--- vpn/vpn-provider.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/vpn/vpn-provider.c b/vpn/vpn-provider.c index 6b45367..804c2c2 100644 --- a/vpn/vpn-provider.c +++ b/vpn/vpn-provider.c @@ -794,6 +794,8 @@ int __vpn_provider_remove(const char *path) provider_unregister

[PATCH 33/34] pptp: Remember the connection password

2012-10-04 Thread Jukka Rissanen
--- vpn/plugins/pptp.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/vpn/plugins/pptp.c b/vpn/plugins/pptp.c index f737c31..6843793 100644 --- a/vpn/plugins/pptp.c +++ b/vpn/plugins/pptp.c @@ -219,6 +219,13 @@ static int pptp_save(struct vpn_provider *provider, GKeyFile *keyfile)

[PATCH 32/34] l2tp: Remember the connection password

2012-10-04 Thread Jukka Rissanen
--- vpn/plugins/l2tp.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/vpn/plugins/l2tp.c b/vpn/plugins/l2tp.c index 5a11e52..4cb4b6a 100644 --- a/vpn/plugins/l2tp.c +++ b/vpn/plugins/l2tp.c @@ -258,6 +258,13 @@ static int l2tp_save(struct vpn_provider *provider, GKeyFile *keyfile)

[PATCH 34/34] vpnd: Make sure provider is taken to ready state

2012-10-04 Thread Jukka Rissanen
If the connman_inet_ifup() says the interface is already UP, then it is possible that we might not get a call to vpn_newlink(). That would be really bad as the provider would then never go to ready state. So in this case we manually call vpn_newlink() to take the interface UP. If the newlink was ca

[PATCH] log: Do not print to syslog with -n option

2012-10-04 Thread Jukka Rissanen
If we are not detached (option -n is used), then print only to stdout. This is useful if connman is run by systemd which would duplicate the log entries if the program outputs both to syslog and stdout. --- Hi, Lucas sent a patch in July that removed the syslog prints in order to avoid double prin

Re: [PATCH v0 1/6] coding-style: Add static variable initialization entry

2012-10-04 Thread Daniel Wagner
Hi Patrik, On 03.10.2012 09:17, Patrik Flykt wrote: On tis, 2012-10-02 at 17:02 +0200, Daniel Wagner wrote: +M17: Always explicitly initialize static variables +== +Any static declared value need to be assign the initial value. + +Exmaple: + +stat

Re: [PATCH 00/34] VPN re-design/factoring

2012-10-04 Thread Daniel Wagner
Hi Jukka, On 04.10.2012 11:56, Jukka Rissanen wrote: Hi, After a couple of RFC rounds, the VPN patches are more or less usable. This patchset provides drop-in replacement for current VPN functionality, so the ConnectProvider and RemoveProvider APIs in net.connman.Manager object still work but a

Re: [PATCH 00/34] VPN re-design/factoring

2012-10-04 Thread Jukka Rissanen
Hi Daniel, On 05.10.2012 08:59, Daniel Wagner wrote: Hi Jukka, On 04.10.2012 11:56, Jukka Rissanen wrote: Hi, After a couple of RFC rounds, the VPN patches are more or less usable. This patchset provides drop-in replacement for current VPN functionality, so the ConnectProvider and RemoveProvi