Re: [RFC 01/12] doc: Add method call and signal for tethering information

2013-03-01 Thread Marcel Holtmann
Hi Patrik, > --- > doc/manager-api.txt | 21 + > 1 file changed, 21 insertions(+) > > diff --git a/doc/manager-api.txt b/doc/manager-api.txt > index ed23c8d..ebbb8e0 100644 > --- a/doc/manager-api.txt > +++ b/doc/manager-api.txt > @@ -145,6 +145,10 @@ Methods dict G

Re: [RFC v1 07/16] netfilter: Add netlink basic infrastructure

2013-03-01 Thread Marcel Holtmann
Hi Daniel, Let's adapt (and fix if necessary) rtnl instead. In the near future there is a nicer netlink handling code which is coming also, so it will require a bit of work in rtnl anyway. You might want to wait for this maybe. Check this with Marcel. >>> is ACCT netfilt

[PATCH v1 5/5] iptables: Rename pre_load_table() to get_table()

2013-03-01 Thread Daniel Wagner
From: Daniel Wagner The second argument is not used anymore, let's remove it. The funciton name doesn't really match to its implementation, so it's also time to rename it. --- src/iptables.c | 20 +--- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/src/iptables.c

[PATCH v1 4/5] iptables: Use glib function for string operations

2013-03-01 Thread Daniel Wagner
From: Daniel Wagner Streamline this file with the rest of ConnMan's code base. --- src/iptables.c | 62 +- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/src/iptables.c b/src/iptables.c index 9880130..b5dad1a 100644 --- a/s

[PATCH v1 3/5] iptables: Improve debug log output

2013-03-01 Thread Daniel Wagner
From: Daniel Wagner We need to see a bit more in detail what happens when CONNMAN_IPTABLES_DEBUG is not set, for example the removing/flushing during bootup. Also remove the DBG() from parse_rule_spec() because all callers already have a DBG(). So not much additional information here. --- src/i

[PATCH v1 2/5] iptables: Drop support for xtables < 1.4.11

2013-03-01 Thread Daniel Wagner
From: Daniel Wagner The API changed between 1.4.10 (version code 5) and 1.4.11 (version code 6) and we needed to workaround with a bunch of ugly ifdefs. 1.4.11 was released on 26.05.2011 and even Debian testing ships 1.4.14 these days. --- configure.ac | 2 +- src/iptables.c | 71

[PATCH v1 1/5] test-iptables: Add debug option

2013-03-01 Thread Daniel Wagner
From: Daniel Wagner It is impossible to see the normal unit test output with all DBG() enabled by default. --- unit/test-iptables.c | 41 - 1 file changed, 40 insertions(+), 1 deletion(-) diff --git a/unit/test-iptables.c b/unit/test-iptables.c index 52aa

[PATCH v1 0/5] iptables refactoring

2013-03-01 Thread Daniel Wagner
From: Daniel Wagner Hi, This is a subset which contains the refactoring part from the series called '[PATCH v0 00/16] Managed iptables API'. The first patch is new. I was not really able to see which tests fails and which not if the default of the debug logout was enabled. I haven't found a w

[PATCH v2] iptables: Fix is_fallthrough() check

2013-03-01 Thread Daniel Wagner
From: Daniel Wagner A fallthrough rule is one which has the default target name, does not have a verdict and is not a jump rule. is_fallthrough() is called excluslive from the insert path, thus the value of verdict will be 0 for a fallthrough rule. --- src/iptables.c | 8 ++-- 1 file change

Re: [PATCH v1 1/4] iptables: Fix is_fallthrough() check

2013-03-01 Thread Daniel Wagner
On 01.03.2013 14:54, Tomasz Bursztyka wrote: Hi Daniel, target = ipt_get_target(e->entry); -if (!strcmp(target->u.user.name, "")) -return true; +if (!strcmp(target->u.user.name, IPT_STANDARD_TARGET)) { +struct xt_standard_target *t; +t = (struct xt_standard_

[RFC 11/12] tethering: Implement tethering info method call and signal

2013-03-01 Thread Patrik Flykt
--- src/connman.h |1 + src/tethering.c | 93 +-- 2 files changed, 91 insertions(+), 3 deletions(-) diff --git a/src/connman.h b/src/connman.h index ed06d6a..a5ab25a 100644 --- a/src/connman.h +++ b/src/connman.h @@ -544,6 +544,7 @@ cons

[RFC 10/12] dbus: Add helper function

2013-03-01 Thread Patrik Flykt
Add helper function for adding an 'a{s{sv}}'. --- src/connman.h |2 ++ src/dbus.c| 26 ++ 2 files changed, 28 insertions(+) diff --git a/src/connman.h b/src/connman.h index c26616f..ed06d6a 100644 --- a/src/connman.h +++ b/src/connman.h @@ -25,6 +25,8 @@ #incl

[RFC 09/12] tethering: Get DHCP lease information

2013-03-01 Thread Patrik Flykt
Update tethering information according to the DHCP server lease. --- src/tethering.c | 32 1 file changed, 32 insertions(+) diff --git a/src/tethering.c b/src/tethering.c index 0fe6dbc..da413b2 100644 --- a/src/tethering.c +++ b/src/tethering.c @@ -139,6 +139,37

[RFC 05/12] gdhcp: Make g_dhcp_server_stop() static

2013-03-01 Thread Patrik Flykt
The function should be used only via g_dhcp_server_unref(), otherwise the leases are never freed. --- gdhcp/gdhcp.h |1 - gdhcp/server.c |2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/gdhcp/gdhcp.h b/gdhcp/gdhcp.h index f011690..4f5e058 100644 --- a/gdhcp/gdhcp.h +++

[RFC 08/12] gdhcp: Add DHCP lease helper functions

2013-03-01 Thread Patrik Flykt
Add DHCP lease helper function for fetching MAC and IP addresses and the status of the lease. As a result move is_expired_lease() up. --- gdhcp/gdhcp.h |5 + gdhcp/server.c | 44 +++- 2 files changed, 40 insertions(+), 9 deletions(-) diff --git a

[RFC 01/12] doc: Add method call and signal for tethering information

2013-03-01 Thread Patrik Flykt
--- doc/manager-api.txt | 21 + 1 file changed, 21 insertions(+) diff --git a/doc/manager-api.txt b/doc/manager-api.txt index ed23c8d..ebbb8e0 100644 --- a/doc/manager-api.txt +++ b/doc/manager-api.txt @@ -145,6 +145,10 @@ Methodsdict GetProperties()

[RFC 07/12] gdhcp: Add DHCP server lease timeout notification support

2013-03-01 Thread Patrik Flykt
When the lease is updated in some way, notify the caller. --- gdhcp/gdhcp.h |8 ++ gdhcp/server.c | 84 2 files changed, 92 insertions(+) diff --git a/gdhcp/gdhcp.h b/gdhcp/gdhcp.h index 4f5e058..b1ccedf 100644 --- a/gdhcp/gdhcp.

[RFC 06/12] gdhcp: Lease lifetime is always relative

2013-03-01 Thread Patrik Flykt
The lease expire is stored as an absolute time in the future. --- gdhcp/server.c |8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/gdhcp/server.c b/gdhcp/server.c index 3042aba..dcf4ae7 100644 --- a/gdhcp/server.c +++ b/gdhcp/server.c @@ -191,7 +191,7 @@ static struct

[RFC 12/12] manager: Add tethering method call and signal to Manager API

2013-03-01 Thread Patrik Flykt
--- src/manager.c | 11 +++ 1 file changed, 11 insertions(+) diff --git a/src/manager.c b/src/manager.c index 1d09267..8e111b1 100644 --- a/src/manager.c +++ b/src/manager.c @@ -393,6 +393,12 @@ static DBusMessage *release_private_network(DBusConnection *conn, return g_dbus_cre

[RFC 00/12] Tethering information

2013-03-01 Thread Patrik Flykt
Hi, Here is a patch set providing tethering information. The location of the information is added to the Manager API, there didn't seem to be any better place for it either. The patch collects tethering information from the DHCP server and from Bluetooth devices added to the tethering br

[RFC 04/12] rtnl: Update tethering info with attached Bluetooth devices

2013-03-01 Thread Patrik Flykt
Remote Bluez bluetooth devices are mapped 1:1 to hciX network devices with the MAC address of the hciX interface being the one for the remote device. This enables tethered Bluetooth devices to be discovered easily. When a network device disappears from the bridge, update tethering info uncondition

[RFC 03/12] rtnl: Save bridge interface index

2013-03-01 Thread Patrik Flykt
If a device is part of a bridge, the RTNL newlink IFLA_MASTER attribute contains the bridge interface index. Save the bridge interface index for later use. --- src/rtnl.c | 23 --- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/src/rtnl.c b/src/rtnl.c index ef

[RFC 02/12] tethering: Create functions for storing and removing tethering information

2013-03-01 Thread Patrik Flykt
Index by MAC address, store type and MAC and IP addresses. --- src/connman.h |4 src/tethering.c | 52 2 files changed, 56 insertions(+) diff --git a/src/connman.h b/src/connman.h index fc6d528..c26616f 100644 --- a/src/connman.h +

Re: [PATCH v1 1/4] iptables: Fix is_fallthrough() check

2013-03-01 Thread Tomasz Bursztyka
Hi Daniel, target = ipt_get_target(e->entry); - if (!strcmp(target->u.user.name, "")) - return true; + if (!strcmp(target->u.user.name, IPT_STANDARD_TARGET)) { + struct xt_standard_target *t; + t = (struct xt_standard_target *)target; +

[PATCH v1 4/4] iptables: Always update options table

2013-03-01 Thread Daniel Wagner
From: Daniel Wagner The linked list is tracking all loading modules. Since we do not unload once they are loaded (xtables does not support this), we might up leaving prepare_matches() before we update the option table. Since we carefully reset the global xtable state after executing one rule, thi

[PATCH v1 3/4] iptables: Do not flush in the wrong order

2013-03-01 Thread Daniel Wagner
From: Daniel Wagner --- src/iptables.c | 8 1 file changed, 8 insertions(+) diff --git a/src/iptables.c b/src/iptables.c index 51e1150..274906c 100644 --- a/src/iptables.c +++ b/src/iptables.c @@ -2310,6 +2310,14 @@ void flush_table(const char *name) table->blob

[PATCH v1 2/4] iptables: Fix and refactor iterate_entries()

2013-03-01 Thread Daniel Wagner
From: Daniel Wagner Updating the builtin and hook index is more complex then one would expect. In order to be able to update them correctly we need also to pass in the underflow table to the iterate function. To improve the readability the valid_hook magic has been moved into next_hook_entry_inde

[PATCH v1 0/4] iptables bug fixes

2013-03-01 Thread Daniel Wagner
From: Daniel Wagner Hi, This is a subset which contains only bugfixes from the series called '[PATCH v0 00/16] Managed iptables API'. cheers, daniel Daniel Wagner (4): iptables: Fix is_fallthrough() check iptables: Fix and refactor iterate_entries() iptables: Do not flush in the wrong o

[PATCH v1 1/4] iptables: Fix is_fallthrough() check

2013-03-01 Thread Daniel Wagner
From: Daniel Wagner A fallthrough rule is one which has the default target name, does not have a verdict and is not a jump rule. is_fallthrough() is called excluslive from the insert path, thus the value of verdict will be 0 for a fallthrough rule. --- src/iptables.c | 8 ++-- 1 file change

Re: [PATCH v0 00/16] Managed iptables API

2013-03-01 Thread Daniel Wagner
On 01.03.2013 13:30, Tomasz Bursztyka wrote: Le 01/03/2013 14:19, Patrik Flykt a écrit : On Fri, 2013-03-01 at 11:19 +0100, Daniel Wagner wrote: I don't follow here. I have the managed_hooknames[] table for this (patch 13). The rest of the code should just use this table unless I missed somethi

Re: [PATCH v0 00/16] Managed iptables API

2013-03-01 Thread Daniel Wagner
On 01.03.2013 13:31, Daniel Wagner wrote: On 01.03.2013 11:35, Tomasz Bursztyka wrote: Hi Daniel, So this is almost two years ago. And there were more than 10 releases after this commit. Isn't it so it appeared in version 1.4.8? We could enforce the usage of this version or later when build

Re: [PATCH v0 00/16] Managed iptables API

2013-03-01 Thread Daniel Wagner
On 01.03.2013 13:19, Patrik Flykt wrote: On Fri, 2013-03-01 at 11:19 +0100, Daniel Wagner wrote: I don't follow here. I have the managed_hooknames[] table for this (patch 13). The rest of the code should just use this table unless I missed something. iptables.c needs to provide manipulation on

Re: [PATCH v0 00/16] Managed iptables API

2013-03-01 Thread Daniel Wagner
On 01.03.2013 11:35, Tomasz Bursztyka wrote: Hi Daniel, So this is almost two years ago. And there were more than 10 releases after this commit. Isn't it so it appeared in version 1.4.8? We could enforce the usage of this version or later when building connman then. If I read it correctly

Re: [PATCH v0 00/16] Managed iptables API

2013-03-01 Thread Tomasz Bursztyka
Le 01/03/2013 14:19, Patrik Flykt a écrit : On Fri, 2013-03-01 at 11:19 +0100, Daniel Wagner wrote: I don't follow here. I have the managed_hooknames[] table for this (patch 13). The rest of the code should just use this table unless I missed something. iptables.c needs to provide manipulation

Re: [RFC v1 13/16] session: Store creation related data into a struct

2013-03-01 Thread Daniel Wagner
Hi Tomasz, On 28.02.2013 10:06, Tomasz Bursztyka wrote: Hi Daniel, During the creation period we need to keep track of data which is only needed during this period. Let's rename user_config to create_data and store all the necessary data there. This includes the session pointer so that we don't

Re: [RFC v1 07/16] netfilter: Add netlink basic infrastructure

2013-03-01 Thread Daniel Wagner
On 28.02.2013 16:44, Tomasz Bursztyka wrote: Hi Marcel, Let's adapt (and fix if necessary) rtnl instead. In the near future there is a nicer netlink handling code which is coming also, so it will require a bit of work in rtnl anyway. You might want to wait for this maybe. Check this with Mar

Re: [PATCH v0 00/16] Managed iptables API

2013-03-01 Thread Patrik Flykt
On Fri, 2013-03-01 at 11:19 +0100, Daniel Wagner wrote: > I don't follow here. I have the managed_hooknames[] table for this > (patch 13). The rest of the code should just use this table unless I > missed something. iptables.c needs to provide manipulation only for the exact names given as is n

[PATCH v2] wifi: Preliminary fix for autoscanning known hidden SSIDs

2013-03-01 Thread Tomasz Bursztyka
Currently, it relies on max_ssids to know how many SSIDs it can provide as paremeters. However, patch 6af0579c434058536fb40480f40f5e9895cfe863, which fixes an issue about fast scanning, affects such feature. Therefore, as a default, it will fallback to 1 if given max_ssids is 0. There is still th

[PATCH] wifi: Preliminary fix for autoscanning known hidden SSIDs

2013-03-01 Thread Tomasz Bursztyka
Currently, it relies on max_ssids to know how many SSIDs it can provide as paremeters. However, patch 6af0579c434058536fb40480f40f5e9895cfe863, which fixes an issue about fast scanning, affects such feature. Therefore, as a default, it will fallback to 1 if given max_ssids is 0. There is still th

Re: [PATCH v0 00/16] Managed iptables API

2013-03-01 Thread Tomasz Bursztyka
Hi Daniel, So this is almost two years ago. And there were more than 10 releases after this commit. Isn't it so it appeared in version 1.4.8? We could enforce the usage of this version or later when building connman then. Cheers, Tomasz ___ co

Re: Autoconnect to a hidden wifi service.

2013-03-01 Thread Tomasz Bursztyka
Hi Sameer, I am looking into the connman plugin/wifi.c to figure out the issue. so far i have found that in scan_callback_hidden function, g_supplicant_interface_get_max_scan_ssids(wifi->interface), returns 0 and therefore no attempt to connect to provisioned hidden wifi networks is performed.

Re: [PATCH v0 00/16] Managed iptables API

2013-03-01 Thread Daniel Wagner
Hi Tomasz, On 28.02.2013 08:05, Tomasz Bursztyka wrote: Hi Daniel, then what's happening isL iptables -t filter -N connman-OUTPUT iptables -t filter -A OUTPUT -j connman-OUTPUT iptables -t filter -A connman-OUTPUT -j LOG Obviously, the secound rule should not append but insert at fi

Re: [PATCH v0 00/16] Managed iptables API

2013-03-01 Thread Daniel Wagner
Hi Patrik, On 28.02.2013 09:07, Patrik Flykt wrote: Hi, On Wed, 2013-02-27 at 16:55 +0100, Daniel Wagner wrote: From: Daniel Wagner Hi, This series starts with a few fixes for pretty nasty bugs which are hiddin in the iptables code. The mrore interesting part is the managed iptabl

Re: Autoconnect to a hidden wifi service.

2013-03-01 Thread Sameer Naik
I am looking into the connman plugin/wifi.c to figure out the issue. so far i have found that in scan_callback_hidden function, g_supplicant_interface_get_max_scan_ssids(wifi->interface), returns 0 and therefore no attempt to connect to provisioned hidden wifi networks is performed. Will trace t