Re: agent, route questions with 1.25

2014-09-04 Thread Mike Purvis
Supplying a little more info here:

- When I connect to my wifi, it no longer creates a directory for it under
/var/lib/connman. Did this behaviour change? I'm assuming this is related
to the not-reconnecting behaviour.
- Running "config wifi__managed_psk  --autoconnect yes" tells me
"invalid service"
- connmand is being executed by upstart. The invocation is "connmand
--nobacktrace".

Is there a way for the daemon to tell me what its config is and where it
came from? Would be really helpful for debugging to know if it's using the
/var/lib/connman directory at all.

Thanks


On 4 September 2014 15:07, Mike Purvis 
wrote:

> I just upgraded my Ubuntu 14.04 system to 1.25, and I'm getting two
> oddities:
>
> First, what's up with the change to make the agent only work in
> interactive mode? Having to do the whole agent/scan/connect dance inside
> the connmanctl prompt, and away from my bash history, is a pretty big pain.
>
> Second, when I did get it connected, I had an issue where it left the
> default route on a class D ethernet port, rather than transferring it to
> the DHCP wifi. This seems very odd to me.
>
> Finally, it doesn't seem able to reconnect automatically on system
> startup, the way 1.24 used to do. Has something changed about that
> behaviour, or something I need to do to enable it?
>
___
connman mailing list
connman@connman.net
https://lists.connman.net/mailman/listinfo/connman


agent, route questions with 1.25

2014-09-04 Thread Mike Purvis
I just upgraded my Ubuntu 14.04 system to 1.25, and I'm getting two
oddities:

First, what's up with the change to make the agent only work in interactive
mode? Having to do the whole agent/scan/connect dance inside the connmanctl
prompt, and away from my bash history, is a pretty big pain.

Second, when I did get it connected, I had an issue where it left the
default route on a class D ethernet port, rather than transferring it to
the DHCP wifi. This seems very odd to me.

Finally, it doesn't seem able to reconnect automatically on system startup,
the way 1.24 used to do. Has something changed about that behaviour, or
something I need to do to enable it?
___
connman mailing list
connman@connman.net
https://lists.connman.net/mailman/listinfo/connman


Re: [PATCH] gsupplicant: Add property calls to property_calls list

2014-09-04 Thread Patrik Flykt


On 2014-09-03 06:54, Eduardo Abinader wrote:

Although the logic for handling property call list was
available, the property call list was not being populated.
---

Applied, thanks!

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


Re: [PATCH] service: Move dbg on service_schedule_removed after sanity check

2014-09-04 Thread Patrik Flykt


On 2014-09-03 06:07, Eduardo Abinader wrote:

Avoid an invalid read by moving debug message after
sanity check.


Applied, thanks!

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


Re: [PATCH 00/12] Peer Service (un)registration API

2014-09-04 Thread Patrik Flykt


On 2014-09-03 09:56, Tomasz Bursztyka wrote:

Hi,

Here is the patch-set which adds the support for the Peer Service 
(un)registration
part in Manager API. It required some changes on Peer API as well.

It is now possible to advertize about UPNP or Bonjour services. The device will
become discoverable and will reply to P2P scan or P2P SD frames.


All pathces applied, v2 for those applicable. Thanks!


Patrik

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


[PATCH v2] client: Adding a very basic support for (un)registering peer services

2014-09-04 Thread Tomasz Bursztyka
This is useful for testing only, since connmanctl does not really
serve anything. bjr_query/bjr_response are byte arrays, represented
as a string with every bytes as hexadecimals without any '0x'.
upnp_service takes the upnp URI string and upnp_version a positive
number.
---
 client/commands.c | 234 ++
 client/dbus_helpers.c |   3 +
 2 files changed, 237 insertions(+)

diff --git a/client/commands.c b/client/commands.c
index 7c53fb7..d7b76a6 100644
--- a/client/commands.c
+++ b/client/commands.c
@@ -31,6 +31,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -2096,6 +2097,234 @@ static char *lookup_session(const char *text, int state)
return lookup_options(session_options, text, state);
 }
 
+static int peer_service_cb(DBusMessageIter *iter, const char *error,
+   void *user_data)
+{
+   bool registration = GPOINTER_TO_INT(user_data);
+
+   if (error)
+   fprintf(stderr, "Error %s peer service: %s\n",
+   registration ? "registering" : "unregistering", error);
+   else
+   fprintf(stdout, "Peer service %s\n",
+   registration ? "registered" : "unregistered");
+
+   return 0;
+}
+
+struct _peer_service {
+   unsigned char *bjr_query;
+   int bjr_query_len;
+   unsigned char *bjr_response;
+   int bjr_response_len;
+   char *upnp_service;
+   int version;
+   int master;
+};
+
+static void append_dict_entry_fixed_array(DBusMessageIter *iter,
+   const char *property, void *value, int length)
+{
+   DBusMessageIter dict_entry, variant, array;
+
+   dbus_message_iter_open_container(iter, DBUS_TYPE_DICT_ENTRY,
+   NULL, &dict_entry);
+   dbus_message_iter_append_basic(&dict_entry, DBUS_TYPE_STRING,
+   &property);
+   dbus_message_iter_open_container(&dict_entry, DBUS_TYPE_VARIANT,
+   DBUS_TYPE_ARRAY_AS_STRING DBUS_TYPE_BYTE_AS_STRING,
+   &variant);
+   dbus_message_iter_open_container(&variant, DBUS_TYPE_ARRAY,
+   DBUS_TYPE_BYTE_AS_STRING, &array);
+   dbus_message_iter_append_fixed_array(&array, DBUS_TYPE_BYTE,
+   value, length);
+   dbus_message_iter_close_container(&variant, &array);
+   dbus_message_iter_close_container(&dict_entry, &variant);
+   dbus_message_iter_close_container(iter, &dict_entry);
+}
+
+static void append_peer_service_dict(DBusMessageIter *iter, void *user_data)
+{
+   struct _peer_service *service = user_data;
+
+   if (service->bjr_query && service->bjr_response) {
+   append_dict_entry_fixed_array(iter, "BonjourQuery",
+   &service->bjr_query, service->bjr_query_len);
+   append_dict_entry_fixed_array(iter, "BonjourResponse",
+   &service->bjr_response, service->bjr_response_len);
+   } else if (service->upnp_service && service->version) {
+   __connmanctl_dbus_append_dict_entry(iter, "UpnpVersion",
+   DBUS_TYPE_INT32, &service->version);
+   __connmanctl_dbus_append_dict_entry(iter, "UpnpService",
+   DBUS_TYPE_STRING, &service->upnp_service);
+   }
+}
+
+static void peer_service_append(DBusMessageIter *iter, void *user_data)
+{
+   struct _peer_service *service = user_data;
+   dbus_bool_t master;
+
+   __connmanctl_dbus_append_dict(iter, append_peer_service_dict, service);
+
+   if (service->master < 0)
+   return;
+
+   master = service->master == 1 ? TRUE : FALSE;
+   dbus_message_iter_append_basic(iter, DBUS_TYPE_BOOLEAN, &master);
+}
+
+static struct _peer_service *fill_in_peer_service(unsigned char *bjr_query,
+   int bjr_query_len, unsigned char *bjr_response,
+   int bjr_response_len, char *upnp_service,
+   int version)
+{
+   struct _peer_service *service;
+
+   service = dbus_malloc0(sizeof(*service));
+
+   if (bjr_query_len && bjr_response_len) {
+   service->bjr_query = dbus_malloc0(bjr_query_len);
+   memcpy(service->bjr_query, bjr_query, bjr_query_len);
+   service->bjr_query_len = bjr_query_len;
+
+   service->bjr_response = dbus_malloc0(bjr_response_len);
+   memcpy(service->bjr_response, bjr_response, bjr_response_len);
+   service->bjr_response_len = bjr_response_len;
+   } else if (upnp_service && version) {
+   service->upnp_service = strdup(upnp_service);
+   service->version = version;
+   }
+
+   return service;
+}
+
+sta