Re: [PATCH 1/1] pacrunner: Protect shared data between pacrunner threads.

2010-10-15 Thread Marcel Holtmann
Hi Mohamed,

 This more to start discussion on protect shared data. I am
 not really familiar with js data so what this patch tried
 to protect is the js object, if thread is running hold
 the main thread to wait until the js thread finish. mean thread
 only block once want to destroy and create new js object.

I looked at this and I don't think we need it. I am protecting the proxy
configuration with a reference count. And the locking inside D-Bus
library is enough for sending out the pending D-Bus result when the JS
execution finished.

Regards

Marcel


___
connman mailing list
connman@connman.net
http://lists.connman.net/listinfo/connman


Re: Suspend/Resume indications

2010-10-15 Thread Marcel Holtmann
Hi,

   As you might be aware modem, supports suspend/resume indications in case
 of cellular networks.
 
   Whether connman supports these?

that is something that needs to be done inside oFono first.

Regards

Marcel



___
connman mailing list
connman@connman.net
http://lists.connman.net/listinfo/connman


Re: Broadcom's proprietary wl driver detected as ethernet

2010-10-15 Thread Kalle Valo
Raghavendra. S raghavendra.akkas...@gmail.com writes:

 [Raghu]: I too met with this some time back. Assuming you enbled wifi
 during compilation, following was the issue in my case. When I killed
 connman. for some reason plugins directory (/usr/lib/connman/
 plugins/*) was getting deleted. So next time when I started connman it
 started without throwing any error. Because of this connman detected
 wifi interface as ethernet interface and all wifi functionalities were
 disabled for the interface.

 So you better check once whether you have /usr/lib/connman/plugins/*.
 Otherwise reinstall and try.

Thanks but this wasn't the issue because wifi was working with an usb
stick using ar9170.

-- 
Kalle Valo
___
connman mailing list
connman@connman.net
http://lists.connman.net/listinfo/connman

Re: Broadcom's proprietary wl driver detected as ethernet

2010-10-15 Thread Marcel Holtmann
Hi Samuel,

  I noticed that with the latest connman git version Broadcom's
  proprietary wl driver is detected as an ethernet device, not a wifi
  device. This was working few weeks back and my main suspect is the udev
  removal.
 Could you please pull the latest ConnMan bits and check if it's working with
 the wl crap^Wdriver ?

the wireless directory inside the network sysfs object can be not
compiled in btw. Just some funny side notes here.

However can you please add a big connman_error() in the code if the
uevent DEVTYPE=wlan is missing and wireless directory is present. I
wanna warn about this stupid binary only drivers.

Regards

Marcel


___
connman mailing list
connman@connman.net
http://lists.connman.net/listinfo/connman


Re: Broadcom's proprietary wl driver detected as ethernet

2010-10-15 Thread Samuel Ortiz
Hi Marcel,

On Fri, Oct 15, 2010 at 10:17:24AM +0300, Marcel Holtmann wrote:
 Hi Samuel,
 
   I noticed that with the latest connman git version Broadcom's
   proprietary wl driver is detected as an ethernet device, not a wifi
   device. This was working few weeks back and my main suspect is the udev
   removal.
  Could you please pull the latest ConnMan bits and check if it's working with
  the wl crap^Wdriver ?
 
 the wireless directory inside the network sysfs object can be not
 compiled in btw. Just some funny side notes here.
Yes, I'm aware of that. If DEVTYPE is not set, I also thought about checking
for SIOCGIWNAME in order to check for wext support. Would you prefer that
solution ?

Cheers,
Samuel.

-- 
Intel Open Source Technology Centre
http://oss.intel.com/
___
connman mailing list
connman@connman.net
http://lists.connman.net/listinfo/connman


[PATCH 1/1] Updated pacrunner plugin to take care of all proxy methods.

2010-10-15 Thread Tomasz Bursztyka
Hi,

Here is a patch for pacrunner plugin. I tested it (against patched pacrunner 
which handles manual config - the previous patch I sent for pacrunner daemon) 
and it works fine.
So now it handles direct/manual/auto as specified.

However, pacrunner advertises proxy configuration only when service change 
occurs, would be better if it also does this when proxy has changed on this 
same service. Have to investigate for this.

Best regards,

Tomasz

---
 include/service.h   |4 ++
 plugins/pacrunner.c |   77 ++
 src/service.c   |   30 +++-
 3 files changed, 97 insertions(+), 14 deletions(-)

diff --git a/include/service.h b/include/service.h
index 8c0e892..16d10f2 100644
--- a/include/service.h
+++ b/include/service.h
@@ -102,6 +102,10 @@ char *connman_service_get_interface(struct connman_service 
*service);
 
 const char *connman_service_get_domainname(struct connman_service *service);
 const char *connman_service_get_nameserver(struct connman_service *service);
+enum connman_service_proxy_method connman_service_get_proxy_method(struct 
connman_service *service);
+char **connman_service_get_proxy_servers(struct connman_service *service);
+char **connman_service_get_proxy_excludes(struct connman_service *service);
+const char *connman_service_get_proxy_url(struct connman_service *service);
 const char *connman_service_get_proxy_autoconfig(struct connman_service 
*service);
 
 #ifdef __cplusplus
diff --git a/plugins/pacrunner.c b/plugins/pacrunner.c
index 3a21011..c9bb119 100644
--- a/plugins/pacrunner.c
+++ b/plugins/pacrunner.c
@@ -73,6 +73,16 @@ static void append_string(DBusMessageIter *iter, void 
*user_data)
dbus_message_iter_append_basic(iter, DBUS_TYPE_STRING, user_data);
 }
 
+static void append_string_list(DBusMessageIter *iter, void *user_data)
+{
+   int i;
+   char **list = user_data;
+
+   for (i = 0; list[i] != NULL; i++)
+   dbus_message_iter_append_basic(iter,
+   DBUS_TYPE_STRING, list[i]);
+}
+
 static void create_proxy_configuration(void)
 {
DBusMessage *msg;
@@ -80,7 +90,9 @@ static void create_proxy_configuration(void)
DBusPendingCall *call;
dbus_bool_t result;
char *interface;
+   const char *method;
const char *str;
+   char **str_list;
 
if (default_service == NULL)
return;
@@ -97,6 +109,58 @@ static void create_proxy_configuration(void)
dbus_message_iter_init_append(msg, iter);
connman_dbus_dict_open(iter, dict);
 
+   switch(connman_service_get_proxy_method(default_service)) {
+   case CONNMAN_SERVICE_PROXY_METHOD_UNKNOWN:
+   /* fall through */
+   case CONNMAN_SERVICE_PROXY_METHOD_DIRECT:
+   method= direct;
+   break;
+   case CONNMAN_SERVICE_PROXY_METHOD_MANUAL:
+   method = manual;
+
+   str_list = connman_service_get_proxy_servers(default_service);
+   if (str_list != NULL) {
+   connman_dbus_dict_append_array(dict, Servers,
+   DBUS_TYPE_STRING, append_string_list,
+   str_list);
+
+   g_strfreev(str_list);
+   }
+   else {
+   method = direct;
+   break;
+   }
+
+   str_list = connman_service_get_proxy_excludes(default_service);
+   if (str_list != NULL) {
+   connman_dbus_dict_append_array(dict, Excludes,
+   DBUS_TYPE_STRING, append_string_list,
+   str_list);
+
+   g_strfreev(str_list);
+   }
+
+   break;
+   case CONNMAN_SERVICE_PROXY_METHOD_AUTO:
+   method = auto;
+
+   str = connman_service_get_proxy_url(default_service);
+   if (str == NULL)
+   str = connman_service_get_proxy_autoconfig(
+   default_service);
+
+   if (str != NULL)
+   connman_dbus_dict_append_basic(dict, URL,
+   DBUS_TYPE_STRING, str);
+   else
+   method = direct;
+
+   break;
+   }
+
+   connman_dbus_dict_append_basic(dict, Method,
+   DBUS_TYPE_STRING, method);
+
interface = connman_service_get_interface(default_service);
if (interface != NULL) {
connman_dbus_dict_append_basic(dict, Interface,
@@ -104,19 +168,6 @@ static void create_proxy_configuration(void)
g_free(interface);
}
 
-   str = connman_service_get_proxy_autoconfig(default_service);
-   if (str != NULL) {
-   const char *method = auto;
-  

Re: Broadcom's proprietary wl driver detected as ethernet

2010-10-15 Thread Marcel Holtmann
Hi Samuel,

I noticed that with the latest connman git version Broadcom's
proprietary wl driver is detected as an ethernet device, not a wifi
device. This was working few weeks back and my main suspect is the udev
removal.
   Could you please pull the latest ConnMan bits and check if it's working 
   with
   the wl crap^Wdriver ?
  
  the wireless directory inside the network sysfs object can be not
  compiled in btw. Just some funny side notes here.
 Yes, I'm aware of that. If DEVTYPE is not set, I also thought about checking
 for SIOCGIWNAME in order to check for wext support. Would you prefer that
 solution ?

I am fine either way. I just want ConnMan complaining if wireless
directory exists and no DEVTYPE. So we have an error in the logs.

Regards

Marcel


___
connman mailing list
connman@connman.net
http://lists.connman.net/listinfo/connman


Re: Service provisioning interface. Was: [PATCH] Add support for EAP configuration via service-api

2010-10-15 Thread Lucio Maciel
Hi Marcel

On Fri, Oct 15, 2010 at 03:10, Marcel Holtmann mar...@holtmann.org wrote:
 2. (What do you think???) Convert the provisioning file to XML??

 Don't think this is a good idea since the INI style keyfiles are so
 simple that it is pretty nice.

 What benefit would XML give over key files.

This was just because of the older thread (about exporting EAP
configuration via Services API), that was talked about XML.
Thats ok to me to use INI style files.

 3. Add new methods to the Manager Interface to Upload and Export
 services configuration.

 Yes, please send a proposal that can be discussed in a separate thread
 when you are starting this.

Any naming conventions for Methods and Parameters?


 Also adding TODO items with your owner to the TODO file is a good idea.
 Please send a patch for it.
Will do it.


Regards,
Lucio Maciel
___
connman mailing list
connman@connman.net
http://lists.connman.net/listinfo/connman


[PATCH 1/1] fix a crash when using vpn.

2010-10-15 Thread Mohamed Abbas
VPN services dont have network, so we need to make sure not
to use service-network while in vpn services.
---
 src/service.c |   16 +---
 1 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/src/service.c b/src/service.c
index 1cb292f..4ad46ec 100644
--- a/src/service.c
+++ b/src/service.c
@@ -407,7 +407,10 @@ void __connman_service_nameserver_add_routes(struct 
connman_service *service,
if (service == NULL)
return;
 
-   index = connman_network_get_index(service-network);
+   if (service-type == CONNMAN_SERVICE_TYPE_VPN)
+   index = connman_ipconfig_get_index(service-ipconfig);
+   else
+   index = connman_network_get_index(service-network);
 
if (service-nameservers != NULL) {
int i;
@@ -442,7 +445,10 @@ void __connman_service_nameserver_del_routes(struct 
connman_service *service)
if (service == NULL)
return;
 
-   index = connman_network_get_index(service-network);
+   if (service-type == CONNMAN_SERVICE_TYPE_VPN)
+   index = connman_ipconfig_get_index(service-ipconfig);
+   else
+   index = connman_network_get_index(service-network);
 
if (service-nameservers != NULL) {
int i;
@@ -1893,7 +1899,11 @@ static DBusMessage *set_property(DBusConnection *conn,
if (str == NULL)
return __connman_error_invalid_arguments(msg);
 
-   index = connman_network_get_index(service-network);
+   if (service-type == CONNMAN_SERVICE_TYPE_VPN)
+   index = connman_ipconfig_get_index(service-ipconfig);
+   else
+   index = connman_network_get_index(service-network);
+
gw = __connman_ipconfig_get_gateway(index);
 
if (gw  strlen(gw))
-- 
1.7.2.3

___
connman mailing list
connman@connman.net
http://lists.connman.net/listinfo/connman