[PATCH] Dont call connman_device_set_powered on ethernet_newlink
From: Lucio Maciel Calling connman_device_set_powered() on ethernet plugin os causing a crash calling device->driver->scan since device->driver is NULL connmand[11583]: Aborting (signal 11) connmand[11583]: backtrace connmand[11583]: [0]: [0xb78a1400] connmand[11583]: [1]: /usr/lib/connman/plugins/ethernet.so(+0xe90) [0xb75c2e90] connmand[11583]: [2]: connmand(connman_rtnl_add_newlink_watch+0xde) [0x80858ae] connmand[11583]: [3]: /usr/lib/connman/plugins/ethernet.so(+0x1031) [0xb75c3031]connmand[11583]: [4]: connmand() [0x806caac] connmand[11583]: [5]: connmand() [0x806a1ae] connmand[11583]: [6]: connmand() [0x806a2f1] connmand[11583]: [7]: connmand(connman_element_register+0x10f) [0x806a4fc] connmand[11583]: [8]: connmand(connman_device_register+0x32) [0x806c95f] --- plugins/ethernet.c |7 ++- 1 files changed, 2 insertions(+), 5 deletions(-) diff --git a/plugins/ethernet.c b/plugins/ethernet.c index 797fc7c..a08ea1d 100644 --- a/plugins/ethernet.c +++ b/plugins/ethernet.c @@ -116,13 +116,10 @@ static void ethernet_newlink(unsigned flags, unsigned change, void *user_data) DBG("index %d flags %d change %d", ethernet->index, flags, change); if ((ethernet->flags & IFF_UP) != (flags & IFF_UP)) { - if (flags & IFF_UP) { + if (flags & IFF_UP) DBG("power on"); - connman_device_set_powered(device, TRUE); - } else { + else DBG("power off"); - connman_device_set_powered(device, FALSE); - } } if ((ethernet->flags & IFF_LOWER_UP) != (flags & IFF_LOWER_UP)) { -- 1.7.2.3 ___ 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
Hi Marcel On Fri, Oct 15, 2010 at 03:10, Marcel Holtmann 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
Service provisioning interface. Was: [PATCH] Add support for EAP configuration via service-api
Hello... Back to service provisioning (EAP configuration on the fly). So now I'll have some time to work on this. I think the easiest way to do this, is to add support for inotify for .config dir, and then add a Method to upload .config files that will be read on the fly. My plan is to: 1. Add support to inotify, to read provisioning files on the fly. 2. (What do you think???) Convert the provisioning file to XML?? 3. Add new methods to the Manager Interface to Upload and Export services configuration. 4. Add support for other service types as well (today only wifi is supported) for ipv4/6 configuration options, APN setting, etc. Sounds reasonable? Regards Lucio Maciel. ___ connman mailing list connman@connman.net http://lists.connman.net/listinfo/connman
[PATCH] Convert device->scan_interval to uint32.
From: Lucio Maciel Dbus-glib doesn't have a uint16 type, so a client written with it couldn't set the ScanInterval. --- doc/device-lowlevel-api.txt |2 +- include/types.h |1 + src/device.c|8 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/doc/device-lowlevel-api.txt b/doc/device-lowlevel-api.txt index f01751b..a025537 100644 --- a/doc/device-lowlevel-api.txt +++ b/doc/device-lowlevel-api.txt @@ -79,7 +79,7 @@ Propertiesstring Address [readonly] Once a device is blocked, enabling it will fail. - uint16 ScanInterval [readwrite] + uint32 ScanInterval [readwrite] The scan interval describes the time in seconds between automated scan attempts. Setting this diff --git a/include/types.h b/include/types.h index 70aff9e..d1d3abd 100644 --- a/include/types.h +++ b/include/types.h @@ -37,6 +37,7 @@ extern "C" { typedef intconnman_bool_t; typedef unsigned char connman_uint8_t; typedef unsigned short connman_uint16_t; +typedef unsigned int connman_uint32_t; #ifdef __cplusplus } diff --git a/src/device.c b/src/device.c index ad976b5..dc76f44 100644 --- a/src/device.c +++ b/src/device.c @@ -44,7 +44,7 @@ struct connman_device { connman_bool_t scanning; connman_bool_t disconnected; connman_bool_t reconnect; - connman_uint16_t scan_interval; + connman_uint32_t scan_interval; char *name; char *node; char *address; @@ -357,7 +357,7 @@ static DBusMessage *get_properties(DBusConnection *conn, case CONNMAN_DEVICE_MODE_NETWORK_MULTIPLE: if (device->scan_interval > 0) connman_dbus_dict_append_basic(&dict, "ScanInterval", - DBUS_TYPE_UINT16, &device->scan_interval); + DBUS_TYPE_UINT32, &device->scan_interval); connman_dbus_dict_append_array(&dict, "Networks", DBUS_TYPE_OBJECT_PATH, append_networks, device); @@ -442,7 +442,7 @@ static DBusMessage *set_property(DBusConnection *conn, return NULL; } } else if (g_str_equal(name, "ScanInterval") == TRUE) { - connman_uint16_t interval; + connman_uint32_t interval; switch (device->mode) { case CONNMAN_DEVICE_MODE_UNKNOWN: @@ -451,7 +451,7 @@ static DBusMessage *set_property(DBusConnection *conn, break; } - if (type != DBUS_TYPE_UINT16) + if (type != DBUS_TYPE_UINT32) return __connman_error_invalid_arguments(msg); dbus_message_iter_get_basic(&value, &interval); -- 1.7.2.3 ___ connman mailing list connman@connman.net http://lists.connman.net/listinfo/connman
[PATCH v2] Support multiple interfaces on -i and -I cmdline option.
From: Lucio Maciel Support multiple comma-separeted interfaces for -i and -I command line option. E.g.: -i eth*,wlan*,ppp* or -I virbr*,usb*,ppp* --- src/element.c | 33 + 1 files changed, 21 insertions(+), 12 deletions(-) diff --git a/src/element.c b/src/element.c index 3e745da..77b65e9 100644 --- a/src/element.c +++ b/src/element.c @@ -36,8 +36,8 @@ static DBusConnection *connection; static GNode *element_root = NULL; static GSList *driver_list = NULL; -static gchar *device_filter = NULL; -static gchar *nodevice_filter = NULL; +static gchar **device_filter = NULL; +static gchar **nodevice_filter = NULL; static gboolean started = FALSE; @@ -1063,21 +1063,27 @@ static void register_element(gpointer data, gpointer user_data) gboolean __connman_element_device_isfiltered(const char *devname) { + char **pattern; + if (device_filter == NULL) goto nodevice; - if (g_pattern_match_simple(device_filter, devname) == FALSE) { - DBG("ignoring device %s (match)", devname); - return TRUE; + for (pattern = device_filter; *pattern; pattern++) { + if (g_pattern_match_simple(*pattern, devname) == FALSE) { + DBG("ignoring device %s (match)", devname); + return TRUE; + } } nodevice: if (nodevice_filter == NULL) return FALSE; - if (g_pattern_match_simple(nodevice_filter, devname) == TRUE) { - DBG("ignoring device %s (no match)", devname); - return TRUE; + for (pattern = nodevice_filter; *pattern; pattern++) { + if (g_pattern_match_simple(*pattern, devname) == TRUE) { + DBG("ignoring device %s (no match)", devname); + return TRUE; + } } return FALSE; @@ -1326,8 +1332,11 @@ int __connman_element_init(const char *device, const char *nodevice) if (connection == NULL) return -EIO; - device_filter = g_strdup(device); - nodevice_filter = g_strdup(nodevice); + if (device) + device_filter = g_strsplit(device, ",", -1); + + if (nodevice) + nodevice_filter = g_strsplit(nodevice, ",", -1); element = connman_element_create("root"); @@ -1447,8 +1456,8 @@ void __connman_element_cleanup(void) g_node_destroy(element_root); element_root = NULL; - g_free(nodevice_filter); - g_free(device_filter); + g_strfreev(nodevice_filter); + g_strfreev(device_filter); if (connection == NULL) return; -- 1.7.2.3 ___ connman mailing list connman@connman.net http://lists.connman.net/listinfo/connman
Re: connmand scanning too much?
Hi, On Wed, Sep 22, 2010 at 10:24, Gustavo Sverzut Barbieri wrote: > > got some time to try it now and it does not help. > > As I just rebooted the machine I know i did not disconnect from the > service and the router did not change wpa<->wpa2 meanwhile. But my > router does provide wpa+wpa2 for the same service, maybe that's the > reason? Can you run wpa_supplicant with -dd -f /some_log_file and send the connman and supplicant logs so I can take a look? > > BR, > > -- > Gustavo Sverzut Barbieri > http://profusion.mobi embedded systems Lucio Maciel ___ connman mailing list connman@connman.net http://lists.connman.net/listinfo/connman
Re: [PATCH] Support multiple interfaces on -i and -I cmdline option.
Hi Samuel On Tue, Sep 21, 2010 at 19:42, Samuel Ortiz wrote: > Hi Lucio, > > We should keep the same logic as the curent one, which means: > > + for (pattern = device_filter; *pattern; pattern++) { > + if (g_pattern_match_simple(*pattern, devname) == FALSE) > + return TRUE; > + > > And then continue with the nodevice case. Ok, tomorrow I will send a new version... > > Cheers, > Samuel. > Regards, Lucio Maciel ___ connman mailing list connman@connman.net http://lists.connman.net/listinfo/connman
[PATCH] Update service security when changing from wpa -> wpa2.
From: Lucio Maciel If the user changes the security of the AP from wpa to wpa2 or vice-versa, connman correctly updates the network sctruct but don't reflect it on the service. This changes the service security and emits a Security PropertyChanged signal. --- src/service.c | 26 -- 1 files changed, 24 insertions(+), 2 deletions(-) diff --git a/src/service.c b/src/service.c index 25d0f9d..249c748 100644 --- a/src/service.c +++ b/src/service.c @@ -657,6 +657,19 @@ const char *__connman_service_default(void) return __connman_service_type2string(service->type); } +static void security_changed(struct connman_service *service) +{ + const char *str; + + str = security2string(service->security); + if (str == NULL) + return; + + connman_dbus_property_changed_basic(service->path, + CONNMAN_SERVICE_INTERFACE, "Security", + DBUS_TYPE_STRING, &str); +} + static void mode_changed(struct connman_service *service) { const char *str; @@ -3750,7 +3763,7 @@ void __connman_service_update_from_network(struct connman_network *network) connman_uint8_t strength, value; connman_bool_t roaming; GSequenceIter *iter; - const char *name; + const char *name, *security; connman_bool_t stats_enable; DBG("network %p", network); @@ -3782,7 +3795,7 @@ void __connman_service_update_from_network(struct connman_network *network) roaming: roaming = connman_network_get_bool(service->network, "Roaming"); if (roaming == service->roaming) - goto done; + goto security; stats_enable = stats_enabled(service); if (stats_enable == TRUE) @@ -3799,6 +3812,15 @@ roaming: if (iter != NULL) g_sequence_sort_changed(iter, service_compare, NULL); +security: + security = connman_network_get_string(service->network, "WiFi.Security"); + if (!security || service->security == convert_wifi_security(security)) + goto done; + + service->security = convert_wifi_security(security); + + security_changed(service); + done: if (service->type != CONNMAN_SERVICE_TYPE_CELLULAR) return; ___ connman mailing list connman@connman.net http://lists.connman.net/listinfo/connman
[PATCH] Support multiple interfaces on -i and -I cmdline option.
From: Lucio Maciel Support multiple comma-separeted interfaces for -i and -I command line option. E.g.: connmand -i eth*,wlan*,ppp* connmand -I virbr*,usb*,ppp* --- src/element.c | 34 ++ 1 files changed, 22 insertions(+), 12 deletions(-) diff --git a/src/element.c b/src/element.c index 3e745da..0bf72f6 100644 --- a/src/element.c +++ b/src/element.c @@ -36,8 +36,8 @@ static DBusConnection *connection; static GNode *element_root = NULL; static GSList *driver_list = NULL; -static gchar *device_filter = NULL; -static gchar *nodevice_filter = NULL; +static gchar **device_filter = NULL; +static gchar **nodevice_filter = NULL; static gboolean started = FALSE; @@ -1063,21 +1063,28 @@ static void register_element(gpointer data, gpointer user_data) gboolean __connman_element_device_isfiltered(const char *devname) { + char **pattern; + if (device_filter == NULL) goto nodevice; - if (g_pattern_match_simple(device_filter, devname) == FALSE) { - DBG("ignoring device %s (match)", devname); - return TRUE; + for (pattern = device_filter; *pattern; pattern++) { + if (g_pattern_match_simple(*pattern, devname) == TRUE) + return FALSE; } + DBG("ignoring device %s (match)", devname); + return TRUE; + nodevice: if (nodevice_filter == NULL) return FALSE; - if (g_pattern_match_simple(nodevice_filter, devname) == TRUE) { - DBG("ignoring device %s (no match)", devname); - return TRUE; + for (pattern = nodevice_filter; *pattern; pattern++) { + if (g_pattern_match_simple(*pattern, devname) == TRUE) { + DBG("ignoring device %s (no match)", devname); + return TRUE; + } } return FALSE; @@ -1326,8 +1333,11 @@ int __connman_element_init(const char *device, const char *nodevice) if (connection == NULL) return -EIO; - device_filter = g_strdup(device); - nodevice_filter = g_strdup(nodevice); + if (device) + device_filter = g_strsplit(device, ",", -1); + + if (nodevice) + nodevice_filter = g_strsplit(nodevice, ",", -1); element = connman_element_create("root"); @@ -1447,8 +1457,8 @@ void __connman_element_cleanup(void) g_node_destroy(element_root); element_root = NULL; - g_free(nodevice_filter); - g_free(device_filter); + g_strfreev(nodevice_filter); + g_strfreev(device_filter); if (connection == NULL) return; ___ connman mailing list connman@connman.net http://lists.connman.net/listinfo/connman
Re: connmand scanning too much?
Hi, On 09/20/2010 11:51 AM, Samuel Ortiz wrote: this repeats forever... and I'm already connected to wifi on eth1 (broadcom-sta, "wl" driver). That shouldn't happen, and I'm suspecting connmand is not triggering those scans. Could you please check if wifi_scan() is called before those scans. ? If wifi_scan() is not called, the next step would be to check what wpa_supplicant is doing and see if it's doing passive or active scans. This happens when you are connected to a wifi network and wpa_supplicant fires a disconnect event (for example if you turn of the AP). This also happens if you are connected to a wifi network that changes its security from wpa->wpa2 or wpa2->wpa while connected. As this disconnect is not triggered by connman, task->disconnecting is FALSE and connman will not call "removeNetwork" on supplicant and it will start scanning for the disconnected SSID every 5 seconds. I've sent a patch right now to solve this issue. [PATCH] Call remove_network() on unsolicited disconnect. Cheers, Samuel. Best regards, Lucio Maciel ___ connman mailing list connman@connman.net http://lists.connman.net/listinfo/connman
[PATCH] Call remove_network() on unsolicited disconnect.
From: Lucio Maciel When receiving an unsolicited disconnect (turn-off the AP) wpa_supplicant starts scanning every 5 seconds looking for the previously connected ssid. This causes the grow of the network list since connman will not remove the unavailable networks if it is not the initiator of the scan. --- plugins/supplicant.c |4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/plugins/supplicant.c b/plugins/supplicant.c index 6bfcd45..a81eb04 100644 --- a/plugins/supplicant.c +++ b/plugins/supplicant.c @@ -2319,7 +2319,9 @@ static void state_change(struct supplicant_task *task, DBusMessage *msg) task_connect(task); } else task->network = NULL; - } + } else + remove_network(task); + break; default: ___ connman mailing list connman@connman.net http://lists.connman.net/listinfo/connman
Re: [PATCH] Add support for EAP configuration via service-api
> Hi Lucio, Hi Marcel > > we don't really wanna do this and that is the reason why we never > exposed these information. Ok. got it. > > I prefer actually that loading configuration via D-Bus is implemented > than a bunch of WPA-Enterprise parameters that we can not expose to the > end user anyway. Since normal end users won't understand them. And the > service API is normal end user driven. Do you mean some new D-Bus call that would read some provisioning configuration file? What would be the right place for that, the Manager interface? Regards Lucio Maciel ___ connman mailing list connman@connman.net http://lists.connman.net/listinfo/connman
[PATCH] Add support for EAP configuration via service-api
From: Lucio Maciel Support configuration of EAP parameters via service-api DBus interface. Also save and load EAP parameters from connman storage. Provisioned EAP services are still immutable and can't be changed using the service-api --- doc/service-api.txt | 77 ++ src/config.c|2 +- src/connman.h |2 + src/service.c | 180 +++ 4 files changed, 260 insertions(+), 1 deletions(-) diff --git a/doc/service-api.txt b/doc/service-api.txt index c1dd541..40b6a01 100644 --- a/doc/service-api.txt +++ b/doc/service-api.txt @@ -204,6 +204,83 @@ Propertiesstring State [readonly] This property might also not always be included since it is protected by a different security policy. +string EAP [readwrite] + +If the service is ieee8021x Wifi, then this property +is used to store the EAP method. + +Possible values are "tls" and "peap" + +No PropertyChanged signals will be send for this +property. + +string CACertFile [readwrite] + +If the service is ieee8021x Wifi, then this property +is used to store the path to the CA certificate file. + +This property is valid for both "tls" and "peap" +EAP value. + +No PropertyChanged signals will be send for this +property. + +string ClientCertFile [readwrite] + +If the service is ieee8021x Wifi, then this property +is used to store the path to the client certificate +file + +This property is valid for "tls" EAP value + +No PropertyChanged signals will be send for this +property. + +string PrivateKeyFile [readwrite] + +If the service is ieee8021x Wifi, then this property +is used to store the path to the client private key +file + +This property is valid for "tls" EAP value + +No PropertyChanged signals will be send for this +property. + +string PrivateKeyPassphraseType [readwrite] + +If the service is ieee8021x Wifi, then this property +is used to store the passphrase type of the client +private key file + +This property is valid for "tls" EAP value, and the +only valid value for now is "fsid" + +No PropertyChanged signals will be send for this +property. + +string Phase2 [readwrite] + +If the service is ieee8021x Wifi, then this property +is used to store the phase2 (inner authentication with +TLS tunnel) parameters. + +This property is valid for "peap" EAP value + +No PropertyChanged signals will be send for this +property. + +string Identity [readwrite] + +If the service is ieee8021x Wifi, then this property +is used to store the Identity string for EAP. + +This property is valid for both "tls" and "peap" EAP +value + +No PropertyChanged signals will be send for this +property. + boolean PassphraseRequired [readonly] If the service type is WiFi, then this property diff --git a/src/config.c b/src/config.c index bdbb704..3b9a15a 100644 --- a/src/config.c +++ b/src/config.c @@ -350,7 +350,7 @@ void __connman_config_cleanup(void) config_table = NULL; } -static char *config_pem_fsid(const char *pem_file) +char *config_pem_fsid(const char *pem_file) { struct statfs buf; unsigned *fsid = (unsigned *) &buf.f_fsid; diff --git a/src/connman.h b/src/connman.h index b1502ad..acb4bd9 100644 --- a/src/connman.h +++ b/src/connman.h @@ -392,6 +392,8 @@ connman_bool_t __connman_network_get_connecting(struct connman_network *network) int __connman_config_init(); void __connman_config_cleanup(void); +char *config_pem_fsid(const char *pem_file); + int __connman_config_provision_service(struct connman_service *service); #include diff --git a/src/service.c b/src/service.c index cc77dd7..c70978b 100644 --- a/src/service.c +++ b/src/service.c @@ -991,6 +991,40 @@ static void proxy_changed(struct connman_service *service) append_proxy, service); } +static void append_eap_properties(DBusMessageIter *dict, +struct connman_service *service) +{ +static char *fsid = "fsid"; + +connman_dbus_dict_append_basic(dict, "EAP", +DBUS_TYPE_STRING, &service->eap); + +if (service->ca_cert_file) +connman_dbus_dict_append_basic(dict, "CACertFile", +DBUS_TYPE_STRING, &service->ca_cert_file); + +if (!g_strcmp0(service-&
Re: Ethernet service disappear when carrier off
Hi Marcel, On Tue, Jul 21, 2009 at 07:14, Marcel Holtmann wrote: > > We could do that. However we added some new properties to the manager > interface. They tell you about ConnectedTechnologies etc. This is not useful (for this situation) if you have more than one Ethernet interface powered on, as I have. If just one interface goes down, the other is still up and Ethernet will still shown as a ConnectedTechnologies. It would be very useful to have a way to monitor ethernet status changes, like carrier on, carrier off. > > Regards > > Marcel Thanks Lúcio Maciel luci...@gmail.com ___ connman mailing list connman@connman.net http://lists.connman.net/listinfo/connman
Re: 3G Support
Hi Marcel, Thanks for the answer, and i have one more. How is the oFono support for 3G? I'm planning to use connman in a project in a near future, and will need 3g, so maybe i'll be able to help with some testing and maybe some patches... Thanks in advance. Lúcio Maciel luci...@gmail.com On Tue, Jul 7, 2009 at 15:57, Marcel Holtmann wrote: > Hi Lucio, > >> I was looking for 3G support for connman and found a bug >> http://bugzilla.moblin.org/show_bug.cgi?id=4010 track the development. >> >> Are someone already working on this, or some beta support? > > our long term goal is handling 3G data via oFono. For the short term we > might enable a few modems directly. > > Regards > > Marcel > > > ___ > connman mailing list > connman@connman.net > http://lists.connman.net/listinfo/connman > ___ connman mailing list connman@connman.net http://lists.connman.net/listinfo/connman
3G Support
Hi, I was looking for 3G support for connman and found a bug http://bugzilla.moblin.org/show_bug.cgi?id=4010 track the development. Are someone already working on this, or some beta support? Lúcio Maciel luci...@gmail.com ___ connman mailing list connman@connman.net http://lists.connman.net/listinfo/connman