RE: Does ConnMan API suport WiFi Active scan &passive scan?

2014-11-19 Thread Nakamura, Yusuke (ADITJ/SWG)
Hi, Tomasz

Thank you for your kind explanation.

Best Regards.
Yusuke Nakamura 中村 勇介
Advanced Driver Information Technology
Software Group (SWG)
Engineer
Tel: 0566-61-5117(ext:551-43641)
Fax:0566-25-4774
Email:ynakam...@jp.adit-jv.com



-Original Message-
From: connman [mailto:connman-boun...@connman.net] On Behalf Of Tomasz Bursztyka
Sent: Wednesday, November 19, 2014 10:46 PM
To: connman@connman.net
Subject: Re: Does ConnMan API suport WiFi Active scan &passive scan?

Hi,

> For our automotive embedded project , we are trying to use ConnMan to take 
> care of all the basic networking.
>
> Does ConnMan API support Active scan & Passive scan?
>
> Would that be possible to execute only Active scan?

ConnMan itself does not run any scan, it requests wpa_supplicant to do so.
And it actually requests active or passive scan depending on the context:

On the Scan() method it exposes through Technology API:

- if there is no known networks configured, it will do only passive scans
- if there is 1+ known networks configured, it will first do an active scan on 
the last connected one, and then a passive scan. Exception: if there is known 
hidden networks, it will do an active scan for those before the passive one.

There are also behaviors on automatic scans for which I don't give details here.

Afaik we don't plan to add parameters to Scan() to it would be possible for the 
user to do a specific active scan. Scanning policies are already quite 
complicated, to fit all uses-cases, proposing such feature would just bring a 
bit of this complexity above ConnMan. This would go against the idea, where 
ConnMan is here to simplify such things for the user and not just wrap wifi 
features in an API.

Br,

Tomasz
___
connman mailing list
connman@connman.net
https://lists.connman.net/mailman/listinfo/connman
___
connman mailing list
connman@connman.net
https://lists.connman.net/mailman/listinfo/connman


Re: Does ConnMan API suport WiFi Active scan &passive scan?

2014-11-19 Thread Tomasz Bursztyka
Hi,

> For our automotive embedded project , we are trying to use ConnMan to take 
> care of all the basic networking.
>
> Does ConnMan API support Active scan & Passive scan?
>
> Would that be possible to execute only Active scan?

ConnMan itself does not run any scan, it requests wpa_supplicant to do so.
And it actually requests active or passive scan depending on the context:

On the Scan() method it exposes through Technology API:

- if there is no known networks configured, it will do only passive scans
- if there is 1+ known networks configured, it will first do an active
scan on the last
connected one, and then a passive scan. Exception: if there is known hidden
networks, it will do an active scan for those before the passive one.

There are also behaviors on automatic scans for which I don't give
details here.

Afaik we don't plan to add parameters to Scan() to it would be possible
for the user
to do a specific active scan. Scanning policies are already quite
complicated, to fit
all uses-cases, proposing such feature would just bring a bit of this
complexity above
ConnMan. This would go against the idea, where ConnMan is here to
simplify such
things for the user and not just wrap wifi features in an API.

Br,

Tomasz
___
connman mailing list
connman@connman.net
https://lists.connman.net/mailman/listinfo/connman


Does ConnMan API suport WiFi Active scan &passive scan?

2014-11-19 Thread Nakamura, Yusuke (ADITJ/SWG)
Hello 

 

For our automotive embedded project , we are trying to use ConnMan to take care 
of all the basic networking.

Does ConnMan API support Active scan & Passive scan?

Would that be possible to execute only Active scan?

 

Best Regards,

 

Yusuke Nakamura 中村 勇介

Advanced Driver Information Technology

Software Group (SWG)

Engineer

Tel: 0566-61-5117(ext:551-43641)

Fax:0566-25-4774

Email:ynakam...@jp.adit-jv.com  

 

 

___
connman mailing list
connman@connman.net
https://lists.connman.net/mailman/listinfo/connman


Re: Connect to a wifi with password without connmanctl

2014-11-19 Thread Patrik Flykt
> Have a look at the test scripts in test directory (connman repo),
> these are in python and sort of easy to read so it should help you to
> do the same in node-js.

In order to solve this, you Stavros need to write the node-js app so
that it registers itself with the Agent API to ConnMan and pops up a
dialog (or does some other magic) when requested by ConnMan.

That means node-js needs to have native bindings to D-Bus and the
node-js app must not exit before it has done whatever task it was set up
to perform. As soon as the process exits, ConnMan notices this and
removes the agent from its data structures...

HTH,

Patrik

___
connman mailing list
connman@connman.net
https://lists.connman.net/mailman/listinfo/connman


[PATCH v2 5/7] gdhcp: Add a function to fetch random values

2014-11-19 Thread Patrik Flykt
Provide a function for fetching random values, either by reading
/dev/urandom or using libc. The caller is responsible for seeding
the libc random function prior to use, should a fallback to libc
function take place.
---
 gdhcp/common.c | 41 -
 gdhcp/gdhcp.h  |  4 
 2 files changed, 44 insertions(+), 1 deletion(-)

diff --git a/gdhcp/common.c b/gdhcp/common.c
index 45278a8..4a7270b 100644
--- a/gdhcp/common.c
+++ b/gdhcp/common.c
@@ -35,6 +35,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include "gdhcp.h"
 #include "common.h"
@@ -58,6 +59,42 @@ static const DHCPOption client_options[] = {
{ OPTION_UNKNOWN,   0x00 },
 };
 
+#define URANDOM "/dev/urandom"
+static int random_fd = -1;
+
+int dhcp_get_random(uint64_t *val)
+{
+   int r;
+
+   if (random_fd < 0) {
+   random_fd = open(URANDOM, O_RDONLY);
+   if (random_fd < 0) {
+   r = -errno;
+   *val = random();
+
+   return r;
+   }
+   }
+
+   if (read(random_fd, &val, sizeof(*val)) < 0) {
+   r = -errno;
+   *val = random();
+
+   return r;
+   }
+
+   return 0;
+}
+
+void dhcp_cleanup_random(void)
+{
+   if (random_fd < 0)
+   return;
+
+   close(random_fd);
+   random_fd = -1;
+}
+
 GDHCPOptionType dhcp_get_code_type(uint8_t code)
 {
int i;
@@ -356,12 +393,14 @@ void dhcp_init_header(struct dhcp_packet *packet, char 
type)
 void dhcpv6_init_header(struct dhcpv6_packet *packet, uint8_t type)
 {
int id;
+   uint64_t rand;
 
memset(packet, 0, sizeof(*packet));
 
packet->message = type;
 
-   id = random();
+   dhcp_get_random(&rand);
+   id = rand;
 
packet->transaction_id[0] = (id >> 16) & 0xff;
packet->transaction_id[1] = (id >> 8) & 0xff;
diff --git a/gdhcp/gdhcp.h b/gdhcp/gdhcp.h
index f3e47bf..ac24454 100644
--- a/gdhcp/gdhcp.h
+++ b/gdhcp/gdhcp.h
@@ -223,6 +223,10 @@ void g_dhcp_server_set_lease_time(GDHCPServer *dhcp_server,
unsigned int lease_time);
 void g_dhcp_server_set_save_lease(GDHCPServer *dhcp_server,
GDHCPSaveLeaseFunc func, gpointer user_data);
+
+int dhcp_get_random(uint64_t *val);
+void dhcp_cleanup_random(void);
+
 #ifdef __cplusplus
 }
 #endif
-- 
2.1.1

___
connman mailing list
connman@connman.net
https://lists.connman.net/mailman/listinfo/connman


[PATCH v2 0/7] Use /dev/urandom

2014-11-19 Thread Patrik Flykt

Hi,

Updated the patch set according to comments. If /dev/urandom is not found,
fall back to glibc functions. Therefore /dev/urandom is no longer needed
at compile time, and the README need not be updated with new requirements
on special files.

I also attacked gdbus and made a slimmer version of the same code for
random number usage for the dhcp part.

As more code might move under or created in util, I kept the explicit
initialization function.

Cheers,

Patrik


Patrik Flykt (7):
  util: Use proper source for random numbers
  dnsproxy: Use the newly provided function for getting random values
  dhcpv6: Use the newly provided function for getting random values
  config: Use the newly provided function for getting random values
  gdhcp: Add a function to fetch random values
  gdhcp: Use dhcp_get_random() where necessary
  dhcp: Clean up resources initialized by dhcp_get_random()

 Makefile.am|  2 +-
 gdhcp/client.c | 23 +--
 gdhcp/common.c | 41 ++-
 gdhcp/gdhcp.h  |  4 +++
 gdhcp/ipv4ll.c | 23 ++-
 gdhcp/ipv4ll.h |  2 +-
 src/config.c   |  4 ++-
 src/connman.h  |  4 +++
 src/dhcp.c |  2 ++
 src/dhcpv6.c   | 15 ++
 src/dnsproxy.c |  8 --
 src/main.c |  2 ++
 src/util.c | 88 ++
 13 files changed, 182 insertions(+), 36 deletions(-)
 create mode 100644 src/util.c

-- 
2.1.1

___
connman mailing list
connman@connman.net
https://lists.connman.net/mailman/listinfo/connman


[PATCH v2 2/7] dnsproxy: Use the newly provided function for getting random values

2014-11-19 Thread Patrik Flykt
---
 src/dnsproxy.c | 8 +---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/dnsproxy.c b/src/dnsproxy.c
index bdd7fd5..7562067 100644
--- a/src/dnsproxy.c
+++ b/src/dnsproxy.c
@@ -218,7 +218,11 @@ static GHashTable *partial_tcp_req_table;
 
 static guint16 get_id(void)
 {
-   return random();
+   uint64_t rand;
+
+   __connman_util_get_random(&rand);
+
+   return rand;
 }
 
 static int protocol_offset(int protocol)
@@ -3829,8 +3833,6 @@ int __connman_dnsproxy_init(void)
 
DBG("");
 
-   srandom(time(NULL));
-
listener_table = g_hash_table_new_full(g_direct_hash, g_direct_equal,
NULL, g_free);
 
-- 
2.1.1

___
connman mailing list
connman@connman.net
https://lists.connman.net/mailman/listinfo/connman


[PATCH v2 3/7] dhcpv6: Use the newly provided function for getting random values

2014-11-19 Thread Patrik Flykt
---
 src/dhcpv6.c | 15 ++-
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/src/dhcpv6.c b/src/dhcpv6.c
index 5f8029f..c311045 100644
--- a/src/dhcpv6.c
+++ b/src/dhcpv6.c
@@ -107,7 +107,10 @@ static void clear_timer(struct connman_dhcpv6 *dhcp)
 
 static inline float get_random(void)
 {
-   return (rand() % 200 - 100) / 1000.0;
+   uint64_t val;
+
+   __connman_util_get_random(&val);
+   return (val % 200 - 100) / 1000.0;
 }
 
 /* Calculate a random delay, RFC 3315 chapter 14 */
@@ -1601,6 +1604,7 @@ int __connman_dhcpv6_start_info(struct connman_network 
*network,
 {
struct connman_dhcpv6 *dhcp;
int delay;
+   uint64_t rand;
 
DBG("");
 
@@ -1626,7 +1630,8 @@ int __connman_dhcpv6_start_info(struct connman_network 
*network,
g_hash_table_replace(network_table, network, dhcp);
 
/* Initial timeout, RFC 3315, 18.1.5 */
-   delay = rand() % 1000;
+   __connman_util_get_random(&rand);
+   delay = rand % 1000;
 
dhcp->timeout = g_timeout_add(delay, start_info_req, dhcp);
 
@@ -1778,6 +1783,7 @@ int __connman_dhcpv6_start(struct connman_network 
*network,
struct connman_service *service;
struct connman_dhcpv6 *dhcp;
int delay;
+   uint64_t rand;
 
DBG("");
 
@@ -1807,7 +1813,8 @@ int __connman_dhcpv6_start(struct connman_network 
*network,
g_hash_table_replace(network_table, network, dhcp);
 
/* Initial timeout, RFC 3315, 17.1.2 */
-   delay = rand() % 1000;
+   __connman_util_get_random(&rand);
+   delay = rand % 1000;
 
/*
 * Start from scratch.
@@ -2640,8 +2647,6 @@ int __connman_dhcpv6_init(void)
 {
DBG("");
 
-   srand(time(NULL));
-
network_table = g_hash_table_new_full(g_direct_hash, g_direct_equal,
NULL, remove_network);
 
-- 
2.1.1

___
connman mailing list
connman@connman.net
https://lists.connman.net/mailman/listinfo/connman


[PATCH v2 7/7] dhcp: Clean up resources initialized by dhcp_get_random()

2014-11-19 Thread Patrik Flykt
---
 src/dhcp.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/dhcp.c b/src/dhcp.c
index 505d9f0..841b0c7 100644
--- a/src/dhcp.c
+++ b/src/dhcp.c
@@ -672,4 +672,6 @@ void __connman_dhcp_cleanup(void)
 
g_hash_table_destroy(ipconfig_table);
ipconfig_table = NULL;
+
+   dhcp_cleanup_random();
 }
-- 
2.1.1

___
connman mailing list
connman@connman.net
https://lists.connman.net/mailman/listinfo/connman


[PATCH v2 4/7] config: Use the newly provided function for getting random values

2014-11-19 Thread Patrik Flykt
---
 src/config.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/config.c b/src/config.c
index e7d1671..a4c117e 100644
--- a/src/config.c
+++ b/src/config.c
@@ -1435,12 +1435,14 @@ static void generate_random_string(char *str, int 
length)
 {
uint8_t val;
int i;
+   uint64_t rand;
 
memset(str, '\0', length);
 
for (i = 0; i < length-1; i++) {
do {
-   val = (uint8_t)(random() % 122);
+   __connman_util_get_random(&rand);
+   val = (uint8_t)(rand % 122);
if (val < 48)
val += 48;
} while((val > 57 && val < 65) || (val > 90 && val < 97));
-- 
2.1.1

___
connman mailing list
connman@connman.net
https://lists.connman.net/mailman/listinfo/connman


[PATCH v2 1/7] util: Use proper source for random numbers

2014-11-19 Thread Patrik Flykt
Use /dev/urandom as the proper source for random numbers. Verify the
existence of /dev/urandom at compile time and program startup.
---
 Makefile.am   |  2 +-
 src/connman.h |  4 +++
 src/main.c|  2 ++
 src/util.c| 88 +++
 4 files changed, 95 insertions(+), 1 deletion(-)
 create mode 100644 src/util.c

diff --git a/Makefile.am b/Makefile.am
index a574170..09a0d6b 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -106,7 +106,7 @@ src_connmand_SOURCES = $(gdhcp_sources) $(gweb_sources) \
src/stats.c src/iptables.c src/dnsproxy.c src/6to4.c \
src/ippool.c src/bridge.c src/nat.c src/ipaddress.c \
src/inotify.c src/firewall.c src/ipv6pd.c src/peer.c \
-   src/peer_service.c src/machine.c
+   src/peer_service.c src/machine.c src/util.c
 
 src_connmand_LDADD = gdbus/libgdbus-internal.la $(builtin_libadd) \
@GLIB_LIBS@ @DBUS_LIBS@ @XTABLES_LIBS@ @GNUTLS_LIBS@ \
diff --git a/src/connman.h b/src/connman.h
index da01215..2524f07 100644
--- a/src/connman.h
+++ b/src/connman.h
@@ -1034,3 +1034,7 @@ void __connman_nfacct_cleanup(void);
 
 int __connman_machine_init(void);
 void __connman_machine_cleanup(void);
+
+int __connman_util_get_random(uint64_t *val);
+int __connman_util_init(void);
+void __connman_util_cleanup(void);
diff --git a/src/main.c b/src/main.c
index 21d1e06..ba09eb6 100644
--- a/src/main.c
+++ b/src/main.c
@@ -639,6 +639,7 @@ int main(int argc, char *argv[])
else
config_init(option_config);
 
+   __connman_util_init();
__connman_inotify_init();
__connman_technology_init();
__connman_notifier_init();
@@ -729,6 +730,7 @@ int main(int argc, char *argv[])
__connman_technology_cleanup();
__connman_inotify_cleanup();
 
+   __connman_util_cleanup();
__connman_dbus_cleanup();
 
__connman_log_cleanup(option_backtrace);
diff --git a/src/util.c b/src/util.c
new file mode 100644
index 000..2d3a7f7
--- /dev/null
+++ b/src/util.c
@@ -0,0 +1,88 @@
+/*
+ *
+ *  Connection Manager
+ *
+ *  Copyright (C) 2014  Intel Corporation. All rights reserved.
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License version 2 as
+ *  published by the Free Software Foundation.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ *
+ */
+
+#ifdef HAVE_CONFIG_H
+#include 
+#endif
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include "connman.h"
+
+#define URANDOM "/dev/urandom"
+
+int f = -1;
+
+int __connman_util_get_random(uint64_t *val)
+{
+   int r = 0;
+
+   if (!val)
+   return -EINVAL;
+
+   if (read(f, val, sizeof(*val)) < 0) {
+   r = -errno;
+   connman_warn_once("Could not read from "URANDOM);
+   *val = random();
+   }
+
+   return r;
+}
+
+int __connman_util_init(void)
+{
+   int r = 0;
+
+   if (f > 0)
+   return 0;
+
+   f = open(URANDOM, O_RDONLY);
+   if (f < 0) {
+   r = -errno;
+   connman_warn("Could not open "URANDOM);
+   srandom(time(NULL));
+   } else {
+   uint64_t val;
+
+   r = __connman_util_get_random(&val);
+   if (r < 0)
+   srandom(time(NULL));
+   else
+   srandom(val);
+   }
+
+   return r;
+}
+
+void __connman_util_cleanup(void)
+{
+   if (f > 0)
+   close(f);
+
+   f = -1;
+}
-- 
2.1.1

___
connman mailing list
connman@connman.net
https://lists.connman.net/mailman/listinfo/connman


[PATCH v2 6/7] gdhcp: Use dhcp_get_random() where necessary

2014-11-19 Thread Patrik Flykt
Instead of always using the libc rand() function, use the function from
the gdhcp common code. With this change the seed value can be omitted
from IPv4 link-local code.
---
 gdhcp/client.c | 23 ++-
 gdhcp/ipv4ll.c | 23 ---
 gdhcp/ipv4ll.h |  2 +-
 3 files changed, 23 insertions(+), 25 deletions(-)

diff --git a/gdhcp/client.c b/gdhcp/client.c
index 66c3a90..ec61731 100644
--- a/gdhcp/client.c
+++ b/gdhcp/client.c
@@ -514,11 +514,13 @@ static int send_release(GDHCPClient *dhcp_client,
uint32_t server, uint32_t ciaddr)
 {
struct dhcp_packet packet;
+   uint64_t rand;
 
debug(dhcp_client, "sending DHCP release request");
 
init_packet(dhcp_client, &packet, DHCPRELEASE);
-   packet.xid = rand();
+   dhcp_get_random(&rand);
+   packet.xid = rand;
packet.ciaddr = htonl(ciaddr);
 
dhcp_add_option_uint32(&packet, DHCP_SERVER_ID, server);
@@ -540,7 +542,7 @@ static gboolean send_probe_packet(gpointer dhcp_data)
/* if requested_ip is not valid, pick a new address*/
if (dhcp_client->requested_ip == 0) {
debug(dhcp_client, "pick a new random address");
-   dhcp_client->requested_ip = ipv4ll_random_ip(0);
+   dhcp_client->requested_ip = ipv4ll_random_ip();
}
 
debug(dhcp_client, "sending IPV4LL probe request");
@@ -1361,7 +1363,6 @@ static int dhcp_recv_l2_packet(struct dhcp_packet 
*dhcp_pkt, int fd,
 static void ipv4ll_start(GDHCPClient *dhcp_client)
 {
guint timeout;
-   int seed;
 
remove_timeouts(dhcp_client);
 
@@ -1369,9 +1370,7 @@ static void ipv4ll_start(GDHCPClient *dhcp_client)
dhcp_client->retry_times = 0;
dhcp_client->requested_ip = 0;
 
-   /*try to start with a based mac address ip*/
-   seed = (dhcp_client->mac_address[4] << 8 | dhcp_client->mac_address[4]);
-   dhcp_client->requested_ip = ipv4ll_random_ip(seed);
+   dhcp_client->requested_ip = ipv4ll_random_ip();
 
/*first wait a random delay to avoid storm of arp request on boot*/
timeout = ipv4ll_random_delay_ms(PROBE_WAIT);
@@ -1670,6 +1669,7 @@ static gboolean start_expire(gpointer user_data)
 static gboolean continue_rebound(gpointer user_data)
 {
GDHCPClient *dhcp_client = user_data;
+   uint64_t rand;
 
switch_listening_mode(dhcp_client, L2);
send_request(dhcp_client);
@@ -1680,9 +1680,10 @@ static gboolean continue_rebound(gpointer user_data)
/*recalculate remaining rebind time*/
dhcp_client->T2 >>= 1;
if (dhcp_client->T2 > 60) {
+   dhcp_get_random(&rand);
dhcp_client->t2_timeout =
g_timeout_add_full(G_PRIORITY_HIGH,
-   dhcp_client->T2 * 1000 + (rand() % 
2000) - 1000,
+   dhcp_client->T2 * 1000 + (rand % 2000) 
- 1000,
continue_rebound,
dhcp_client,
NULL);
@@ -1714,6 +1715,7 @@ static gboolean start_rebound(gpointer user_data)
 static gboolean continue_renew (gpointer user_data)
 {
GDHCPClient *dhcp_client = user_data;
+   uint64_t rand;
 
switch_listening_mode(dhcp_client, L3);
send_request(dhcp_client);
@@ -1724,8 +1726,9 @@ static gboolean continue_renew (gpointer user_data)
dhcp_client->T1 >>= 1;
 
if (dhcp_client->T1 > 60) {
+   dhcp_get_random(&rand);
dhcp_client->t1_timeout = g_timeout_add_full(G_PRIORITY_HIGH,
-   dhcp_client->T1 * 1000 + (rand() % 2000) - 1000,
+   dhcp_client->T1 * 1000 + (rand % 2000) - 1000,
continue_renew,
dhcp_client,
NULL);
@@ -2707,6 +2710,7 @@ int g_dhcp_client_start(GDHCPClient *dhcp_client, const 
char *last_address)
 {
int re;
uint32_t addr;
+   uint64_t rand;
 
if (dhcp_client->type == G_DHCP_IPV6) {
if (dhcp_client->information_req_cb) {
@@ -2815,7 +2819,8 @@ int g_dhcp_client_start(GDHCPClient *dhcp_client, const 
char *last_address)
if (re != 0)
return re;
 
-   dhcp_client->xid = rand();
+   dhcp_get_random(&rand);
+   dhcp_client->xid = rand;
dhcp_client->start = time(NULL);
}
 
diff --git a/gdhcp/ipv4ll.c b/gdhcp/ipv4ll.c
index 9bf52b0..c43971f 100644
--- a/gdhcp/ipv4ll.c
+++ b/gdhcp/ipv4ll.c
@@ -34,23 +34,19 @@
 
 #include 
 #include "ipv4ll.h"
+#include "common.h"
 
 /**
  * Return a random link local IP (in host byte order)
  */
-uint32_t ipv4ll_random_ip(int seed)
+uint32_t ipv4ll_random_ip(void)
 {
unsigned tmp;
+   uint64_t rand;
 
-   if (seed)
-   srand(see

Re: How to Identify the chosen association type of Wifi AP

2014-11-19 Thread Tomasz Bursztyka

Hi Frederic,


Is there such information about WPS sequence initiated by user on the
remote AP ?


The theory:

In case of WPS PBC, ConnMan is supposed to handle that automatically, 
which means
if the AP - related to the service the user wants to connect to - has 
started a WPS PBC
sequence, ConnMan will detect it and silently go with it, without 
requesting anything

through the Agent.

In case of WPS PIN, we don't do anything but doing the usual Agent call, 
which lets the
user doing the right thing. We don't provide details. That's something 
we should/could fix

in a futur rewrite of the API (ConnMan 2.0?)

The practice:
It's unfortunately not unusual to get buggy AP on WPS. Like during the 
WPS process, some
tend to forget to advertize it - through the IEs - in all of their 
frames (so if we catch and analyze

a wrong one: our logic does not apply).
And of course, wpa_supplicant or ConnMan could have a bug. Depends on 
what you are

experiencing.

Tomasz
___
connman mailing list
connman@connman.net
https://lists.connman.net/mailman/listinfo/connman


Re: How to Identify the chosen association type of Wifi AP

2014-11-19 Thread Patrik Flykt

Hi,

On Wed, 2014-11-19 at 09:13 +0100,
frederic.wo...@continental-corporation.com wrote:
> Hi All
> 
> I would like to know if connman agent provides the information to identify 
> the association type of Wifi AP chosen by the user in particular with WPS.
> AFAIU when starting association to an AP proposing WPA2 and WPS, connman 
> agent requestInput function tells possible association types but not if 
> user already started a WPS sequence.
> 
> Is there such information about WPS sequence initiated by user on the 
> remote AP ?

No additional information about WPS is presented except the "Security"
attribute in the Service API.

If WPS is supported, Agent API adds an "WPS" attribute to the
RequestInput method call in addition to the "Passphrase" one. The agent
can then present this to the user.

If the WPS sequence has already been started on the AP, ConnMan will
connect using WPS without asking the Agent. For this to happen, ConnMan
needs to be explicitly instructed to connect to the service via the
Service API.

Cheers,

Patrik

___
connman mailing list
connman@connman.net
https://lists.connman.net/mailman/listinfo/connman


How to Identify the chosen association type of Wifi AP

2014-11-19 Thread Frederic . Wolff
Hi All

I would like to know if connman agent provides the information to identify 
the association type of Wifi AP chosen by the user in particular with WPS.
AFAIU when starting association to an AP proposing WPA2 and WPS, connman 
agent requestInput function tells possible association types but not if 
user already started a WPS sequence.

Is there such information about WPS sequence initiated by user on the 
remote AP ?

Fred
___
connman mailing list
connman@connman.net
https://lists.connman.net/mailman/listinfo/connman