framework/connectivity/connman.git
12 years agobuild: Include unit/test-connman.h into source list
Marcel Holtmann [Wed, 15 Jun 2011 17:12:34 +0000 (10:12 -0700)]
build: Include unit/test-connman.h into source list

12 years agogsupplicant: Fix how raw key as psk are provided.
Tomasz Bursztyka [Sat, 11 Jun 2011 08:07:39 +0000 (11:07 +0300)]
gsupplicant: Fix how raw key as psk are provided.

12 years agoservice: Add timeout event only the first time
Yu A Wang [Thu, 9 Jun 2011 09:06:15 +0000 (05:06 -0400)]
service: Add timeout event only the first time

When connect to a 3G service with weak signal, it may connect
several times. When connman suspend to S3 and resume several
times, function remove_timeout only remove the last timeout event.
This will lead connman crash when connect_timeout invoked by other
timeout event to access previous already freed service.

12 years agodhcp: Cancel old renewal timeout prior to adding a new one
Grant Erickson [Thu, 2 Jun 2011 04:16:13 +0000 (21:16 -0700)]
dhcp: Cancel old renewal timeout prior to adding a new one

Given the following reproduction steps:

    1) Set up an access point with a Class B IP address, say
       10.2.40.254.
    2) Set up the access point to provide DHCP leases over a range
       10.2.40.2 through 10.2.40.253.
    3) Set up a short lease renewal period of 5-10 minutes.
    4) Allow the device to associate, connect and receive an IP
       address.
    5) Midway through the lease interval, change the access point to a
       different IP address, say, 10.2.41.254.
    6) Change the access point to issue DHCP leases over a new range,
       10.2.41.2 through 10.2.41.253.
    7) Watch as the access point resets, the connection is lost, the
       connection is regained and as connman tries to get a new DHCP
       lease.

Prior to commit 39825846, connman could receive a new but different
DHCP lease but connman would not program the confirmed lease to the
interface.

However, following that commit, it now programs the new, changed DHCP
lease to the interface but still believes the old lease is valid and
attempts to keep servicing the old renewal timeout for the prior but
now stale lease.

This patch cancels any existing, pending DHCP lease renewal timeout
following a DHCP lease configuration change.

12 years agoinet: Standardize error codes and messages
Grant Erickson [Fri, 10 Jun 2011 13:54:23 +0000 (15:54 +0200)]
inet: Standardize error codes and messages

Return and pass a consistent set of informative error codes and
display a consistent set of error messages for
connman_inet_modify_address and connman_{clear,set}_*_address.

12 years agogweb: Make debug for write simpler
Marcel Holtmann [Mon, 13 Jun 2011 20:12:44 +0000 (22:12 +0200)]
gweb: Make debug for write simpler

12 years agobuild: Add alg-test to ignore list
Marcel Holtmann [Mon, 13 Jun 2011 20:12:24 +0000 (22:12 +0200)]
build: Add alg-test to ignore list

12 years agobuild: Check for linux/if_alg.h if tools are enabled
Marcel Holtmann [Wed, 8 Jun 2011 08:29:01 +0000 (10:29 +0200)]
build: Check for linux/if_alg.h if tools are enabled

12 years agotools: Use sendfile() instead of mmap() for AF_ALG test utility
Marcel Holtmann [Wed, 8 Jun 2011 05:43:05 +0000 (07:43 +0200)]
tools: Use sendfile() instead of mmap() for AF_ALG test utility

12 years agotools: Add utility for testing AF_ALG kernel interface
Marcel Holtmann [Wed, 8 Jun 2011 05:28:16 +0000 (07:28 +0200)]
tools: Add utility for testing AF_ALG kernel interface

12 years agounit: Add free-ride test
Daniel Wagner [Tue, 7 Jun 2011 13:42:22 +0000 (15:42 +0200)]
unit: Add free-ride test

12 years agounit: Add session connect disconnect test
Daniel Wagner [Tue, 7 Jun 2011 13:42:22 +0000 (15:42 +0200)]
unit: Add session connect disconnect test

12 years agounit: Add session disconnect test
Daniel Wagner [Tue, 7 Jun 2011 13:42:22 +0000 (15:42 +0200)]
unit: Add session disconnect test

12 years agounit: Add session connect test
Daniel Wagner [Tue, 7 Jun 2011 13:42:22 +0000 (15:42 +0200)]
unit: Add session connect test

12 years agounit: Add create many session test
Daniel Wagner [Tue, 7 Jun 2011 13:42:22 +0000 (15:42 +0200)]
unit: Add create many session test

12 years agounit: Add create already exists test case
Daniel Wagner [Tue, 7 Jun 2011 13:42:22 +0000 (15:42 +0200)]
unit: Add create already exists test case

12 years agounit: Add create and destroy test case
Daniel Wagner [Tue, 7 Jun 2011 13:42:22 +0000 (15:42 +0200)]
unit: Add create and destroy test case

12 years agounit: Add init/cleanup util function
Daniel Wagner [Tue, 7 Jun 2011 13:42:22 +0000 (15:42 +0200)]
unit: Add init/cleanup util function

12 years agounit: Add create session test
Daniel Wagner [Tue, 7 Jun 2011 13:42:22 +0000 (15:42 +0200)]
unit: Add create session test

Create a complete session, that is with proper notification object.

12 years agounit: Add Session API binding
Daniel Wagner [Tue, 7 Jun 2011 13:42:22 +0000 (15:42 +0200)]
unit: Add Session API binding

12 years agounit: Add manager create/destroy tests
Daniel Wagner [Tue, 7 Jun 2011 13:42:22 +0000 (15:42 +0200)]
unit: Add manager create/destroy tests

Also add util function for creating the test fixture data structure.

12 years agounit: Toggle SessionMode for each test case
Daniel Wagner [Tue, 7 Jun 2011 13:42:21 +0000 (15:42 +0200)]
unit: Toggle SessionMode for each test case

12 years agounit: Add Manager API binding
Daniel Wagner [Tue, 7 Jun 2011 13:42:21 +0000 (15:42 +0200)]
unit: Add Manager API binding

12 years agounit: Add util function for unit tests
Daniel Wagner [Tue, 7 Jun 2011 13:42:21 +0000 (15:42 +0200)]
unit: Add util function for unit tests

12 years agounit: Add test-session
Daniel Wagner [Tue, 7 Jun 2011 13:42:21 +0000 (15:42 +0200)]
unit: Add test-session

12 years agoelement: Remove device code
Daniel Wagner [Thu, 2 Jun 2011 17:29:08 +0000 (19:29 +0200)]
element: Remove device code

12 years agoelement: Remove left overs from clean
Daniel Wagner [Thu, 2 Jun 2011 17:30:44 +0000 (19:30 +0200)]
element: Remove left overs from clean

12 years agodhcp: Fix dhcp_invalidate NULL pointer access
Daniel Wagner [Tue, 7 Jun 2011 07:54:25 +0000 (09:54 +0200)]
dhcp: Fix dhcp_invalidate NULL pointer access

dhcp->nameservers can be NULL. This can be triggered with toggling
the technologies switches fast enough.

12 years agoRelease 0.74
Marcel Holtmann [Thu, 2 Jun 2011 01:29:59 +0000 (03:29 +0200)]
Release 0.74

12 years agotethering: Fix small typo
Marcel Holtmann [Thu, 2 Jun 2011 00:40:21 +0000 (02:40 +0200)]
tethering: Fix small typo

12 years agotethering: Fix handling of undefined DBUS_TYPE_UNIX_FD
Marcel Holtmann [Thu, 2 Jun 2011 00:39:30 +0000 (02:39 +0200)]
tethering: Fix handling of undefined DBUS_TYPE_UNIX_FD

12 years agoAUTHORS: Mention Thierry's contributions
Samuel Ortiz [Tue, 31 May 2011 22:21:08 +0000 (00:21 +0200)]
AUTHORS: Mention Thierry's contributions

12 years agoTODO: D-Bus provisioning, private networks and v6v4 oFono support are done
Samuel Ortiz [Tue, 31 May 2011 22:19:22 +0000 (00:19 +0200)]
TODO: D-Bus provisioning, private networks and v6v4 oFono support are done

12 years agodhcp: Call ipconfig_address_remove from dhcp_invalidate
Samuel Ortiz [Tue, 31 May 2011 22:16:26 +0000 (00:16 +0200)]
dhcp: Call ipconfig_address_remove from dhcp_invalidate

Clearing the ipconfig fields is not enough, the actual rntl command needs
to be sent for the IP to be cleared.

12 years agonotifier: Limit Counter Underflow
Grant Erickson [Tue, 31 May 2011 20:01:24 +0000 (22:01 +0200)]
notifier: Limit Counter Underflow

When network and service events occur from the bottom up
(e.g. supplicant, link state, etc.) that also incur IP configuration
changes, it is possible for one or more of the notifier counters to
underflow, leaving connman in a state from which it can never recover
without a process restart.

By limiting underflow of the three notifier counters, these non-
recoverable states are prevented.

12 years agodhcp: Invalidate and Release on Network Removal
Grant Erickson [Tue, 31 May 2011 19:55:28 +0000 (21:55 +0200)]
dhcp: Invalidate and Release on Network Removal

When removing a network DHCP configuration, invalidate the DHCP
configuration in addition to releasing it.

This addresses a case in which a lower-level network event (e.g. Wi-Fi
disassociation triggered by the driver due to low signal strength)
causes a service disconnect not triggered by connman but then is
recovered BY connman to reuse the prior DHCP lease configuration but
not actually assign it by simply invalidating the old lease
configuration when connman removes the prior network.

12 years agoservice: Indicate IP Configuration Ready Event
Grant Erickson [Wed, 25 May 2011 17:10:17 +0000 (10:10 -0700)]
service: Indicate IP Configuration Ready Event

In the Connection Manager, completion of a valid IP configuration
excites the service state machine to move from the "configuration" to
the "ready" state.

However, the existing implementation of IP configuration completion
explicitly attempts to directly manipulate service state, rather than
hinting at an excitation event.

As a consequence, a late IP configuration completion after the service
state machine has transitioned from "ready" to "online" can lead to an
incorrect transition back to the "ready" state. This causes the
connection count for the technology associated with that service to
increment again, unnecessarily.

This patch avoids this issue by providing a service object interface
that simply hints that an IP configuration is complete for a given IP
type, allowing the service object and its state machine to either hold
fast in the present state, returning an advisory error or advancing,
as before.

All prior invocations of __connman_service_indicate_state outside of
the service module for the CONNMAN_SERVICE_STATE_READY are replaced
with calls to this new interface.

Thanks to Daniel Wagner and Marcel Holtmann for offline IRC discussion
that helped motivate this fix.

  * v2: Incorporated feedback from Samuel Ortiz about combining IPv4
        and IPv6 states before checking state readiness.

12 years agoipconfig: Add Function to Stringify ipconfig Type
Grant Erickson [Tue, 3 May 2011 16:15:16 +0000 (09:15 -0700)]
ipconfig: Add Function to Stringify ipconfig Type

12 years agodevice: Include Reason in Disconnect Skip Warning
Grant Erickson [Wed, 25 May 2011 06:39:55 +0000 (23:39 -0700)]
device: Include Reason in Disconnect Skip Warning

Include the reason for skipping the requested network disconnect in
the warning message.

12 years agodhcp: Remove extra dhcp_release call
Thierry Boureille [Mon, 30 May 2011 09:43:26 +0000 (11:43 +0200)]
dhcp: Remove extra dhcp_release call

dhcp_release will be called from the hash table remove callback, if the
network is found.

12 years agodevice: Do not use connman_element_set/get_string()
Daniel Wagner [Tue, 31 May 2011 15:43:49 +0000 (17:43 +0200)]
device: Do not use connman_element_set/get_string()

12 years agodevice: Handle connman_device_set/get_string(dev, "Path", ...) directly
Daniel Wagner [Tue, 31 May 2011 15:43:49 +0000 (17:43 +0200)]
device: Handle connman_device_set/get_string(dev, "Path", ...) directly

and don't rely on the element code.

12 years agoofono: Store Operator string in struct modem
Daniel Wagner [Tue, 31 May 2011 15:43:49 +0000 (17:43 +0200)]
ofono: Store Operator string in struct modem

So we don't rely on the connman_device_set/get_string().

12 years agoproperty: Remove CONNMAN_PROPERTY_ID_IPV6_*
Daniel Wagner [Tue, 31 May 2011 15:43:48 +0000 (17:43 +0200)]
property: Remove CONNMAN_PROPERTY_ID_IPV6_*

12 years agoproperty: Remove HOSTNAME and DOMAINNAME
Daniel Wagner [Tue, 31 May 2011 15:43:48 +0000 (17:43 +0200)]
property: Remove HOSTNAME and DOMAINNAME

12 years agoproperty: Remove unused CONNMAN_PROPERTY_ID_IPV4_*
Daniel Wagner [Tue, 31 May 2011 15:43:48 +0000 (17:43 +0200)]
property: Remove unused CONNMAN_PROPERTY_ID_IPV4_*

12 years agoelement: Remove IPv6
Daniel Wagner [Tue, 31 May 2011 15:43:48 +0000 (17:43 +0200)]
element: Remove IPv6

12 years agoelement: Remove IPv4
Daniel Wagner [Tue, 31 May 2011 15:43:48 +0000 (17:43 +0200)]
element: Remove IPv4

12 years agoelement: Remove connected failed code
Daniel Wagner [Tue, 31 May 2011 15:43:48 +0000 (17:43 +0200)]
element: Remove connected failed code

12 years agonetwork: Use __connman_service_indicate_error for connetion failed
Daniel Wagner [Tue, 31 May 2011 15:43:48 +0000 (17:43 +0200)]
network: Use __connman_service_indicate_error for connetion failed

12 years agoelement: Remove unused CONNMAN_ELEMENT_ERROR_DHCP_FAILED
Daniel Wagner [Tue, 31 May 2011 15:43:48 +0000 (17:43 +0200)]
element: Remove unused CONNMAN_ELEMENT_ERROR_DHCP_FAILED

12 years agoelement: Remove service code
Daniel Wagner [Tue, 31 May 2011 15:43:48 +0000 (17:43 +0200)]
element: Remove service code

12 years agoelement: Remove vendor code
Daniel Wagner [Tue, 31 May 2011 15:43:48 +0000 (17:43 +0200)]
element: Remove vendor code

12 years agoelement: Remove zeroconf code
Daniel Wagner [Tue, 31 May 2011 15:43:48 +0000 (17:43 +0200)]
element: Remove zeroconf code

12 years agoelement: Remove bootp code
Daniel Wagner [Tue, 31 May 2011 15:43:48 +0000 (17:43 +0200)]
element: Remove bootp code

12 years agoelement: Remove profile code
Daniel Wagner [Tue, 31 May 2011 15:43:48 +0000 (17:43 +0200)]
element: Remove profile code

12 years agoelement: Remove IPv6 element code
Daniel Wagner [Tue, 31 May 2011 15:43:47 +0000 (17:43 +0200)]
element: Remove IPv6 element code

12 years ago6to4: Remove unused variables
Marcel Holtmann [Fri, 27 May 2011 17:44:56 +0000 (10:44 -0700)]
6to4: Remove unused variables

12 years agodnsproxy: Fix unused variable warnings
Marcel Holtmann [Fri, 27 May 2011 17:44:01 +0000 (10:44 -0700)]
dnsproxy: Fix unused variable warnings

12 years agortnl: Fix debug handling to not cause false positives
Marcel Holtmann [Fri, 27 May 2011 17:41:41 +0000 (10:41 -0700)]
rtnl: Fix debug handling to not cause false positives

12 years agotimezone: Fix error handling of inotify function
Marcel Holtmann [Fri, 27 May 2011 17:38:25 +0000 (10:38 -0700)]
timezone: Fix error handling of inotify function

12 years agonetwork: Remove unused variables
Marcel Holtmann [Fri, 27 May 2011 17:37:23 +0000 (10:37 -0700)]
network: Remove unused variables

12 years agotask: Remove unused variable
Marcel Holtmann [Fri, 27 May 2011 17:36:42 +0000 (10:36 -0700)]
task: Remove unused variable

12 years agomain: Remove unused variable old_umask
Marcel Holtmann [Fri, 27 May 2011 17:35:08 +0000 (10:35 -0700)]
main: Remove unused variable old_umask

12 years agoopenvpn: Remove unused variable for VPN domain
Marcel Holtmann [Fri, 27 May 2011 17:33:41 +0000 (10:33 -0700)]
openvpn: Remove unused variable for VPN domain

12 years agoofono: Remove unused code for online support check
Marcel Holtmann [Fri, 27 May 2011 17:33:01 +0000 (10:33 -0700)]
ofono: Remove unused code for online support check

12 years agowifi: Remove unused variable
Marcel Holtmann [Fri, 27 May 2011 17:31:51 +0000 (10:31 -0700)]
wifi: Remove unused variable

12 years agogdhcp: Remove unused variable
Marcel Holtmann [Fri, 27 May 2011 17:31:06 +0000 (10:31 -0700)]
gdhcp: Remove unused variable

12 years agotools: Fix unused variable warnings for WISPr client
Marcel Holtmann [Fri, 27 May 2011 17:29:47 +0000 (10:29 -0700)]
tools: Fix unused variable warnings for WISPr client

12 years agogweb: Remove usage of unused variables
Marcel Holtmann [Fri, 27 May 2011 17:26:44 +0000 (10:26 -0700)]
gweb: Remove usage of unused variables

12 years agogdbus: Remove unused result variable from g_dbus_pending_success
Szymon Janc [Tue, 10 May 2011 13:58:04 +0000 (15:58 +0200)]
gdbus: Remove unused result variable from g_dbus_pending_success

13 years agoopenvpn: Add remote-cert-tls
Daniel Wagner [Mon, 16 May 2011 20:54:51 +0000 (22:54 +0200)]
openvpn: Add remote-cert-tls

13 years agosession: Fix error path __connman_session_creat()
Daniel Wagner [Fri, 13 May 2011 14:09:54 +0000 (16:09 +0200)]
session: Fix error path __connman_session_creat()

Don't free the session if it exists already.

13 years agosession: Fix RoamingPolicy parsing
Daniel Wagner [Fri, 13 May 2011 14:09:54 +0000 (16:09 +0200)]
session: Fix RoamingPolicy parsing

If the session has an invalid roaming policy and appending a NULL to
the D-Bus message leads to a crash.

13 years agosession: Use pointer for service_info
Daniel Wagner [Fri, 13 May 2011 13:57:47 +0000 (15:57 +0200)]
session: Use pointer for service_info

Reduce the size of struct connman_session so that we don't have to
load the whole data structure and increase the likeklihood that the
data structure can stay in cache.

13 years agoservice: Remove unused __connman_service_*() functions
Daniel Wagner [Mon, 9 May 2011 15:50:10 +0000 (17:50 +0200)]
service: Remove unused __connman_service_*() functions

These were only used in session.c which does not depend on them
anymore.

13 years agosession: Remove update_info()
Daniel Wagner [Mon, 9 May 2011 15:50:10 +0000 (17:50 +0200)]
session: Remove update_info()

13 years agosession: Update bearer in create_service_entry
Daniel Wagner [Mon, 9 May 2011 15:50:10 +0000 (17:50 +0200)]
session: Update bearer in create_service_entry

13 years agosession: Update ifname in create_service_entry
Daniel Wagner [Mon, 9 May 2011 15:50:10 +0000 (17:50 +0200)]
session: Update ifname in create_service_entry

13 years agosession: Remove use of __connman_service_get_name()
Daniel Wagner [Mon, 9 May 2011 15:50:10 +0000 (17:50 +0200)]
session: Remove use of __connman_service_get_name()

13 years agosession: Track service changes through notifier
Daniel Wagner [Mon, 9 May 2011 15:50:09 +0000 (17:50 +0200)]
session: Track service changes through notifier

13 years agosession: Move reason into service_entry
Daniel Wagner [Mon, 9 May 2011 15:50:09 +0000 (17:50 +0200)]
session: Move reason into service_entry

13 years agoservice: Add create callback for __connman_service_get_list()
Daniel Wagner [Mon, 9 May 2011 15:50:09 +0000 (17:50 +0200)]
service: Add create callback for __connman_service_get_list()

13 years agosession: Add hash table to track service list
Daniel Wagner [Mon, 9 May 2011 15:50:09 +0000 (17:50 +0200)]
session: Add hash table to track service list

Instead of having our own code for finding the iterator pointers in
the service list we are using the same approach as in service.c. Store
the iterator in a service hash with the service as key and the service
list iterator as value. With this we can get rid of
service_remove_from_session and lookup_service.

13 years agosession: Use service session usage counting
Daniel Wagner [Mon, 9 May 2011 15:50:09 +0000 (17:50 +0200)]
session: Use service session usage counting

And introduce a new disconnect function which takes care if a service
has to be disconnected if no other session is using this service.

13 years agoservice: Add __connman_service_session_inc()/dec()
Daniel Wagner [Mon, 9 May 2011 15:50:09 +0000 (17:50 +0200)]
service: Add __connman_service_session_inc()/dec()

13 years agosession: Track connect reason
Daniel Wagner [Mon, 9 May 2011 15:50:09 +0000 (17:50 +0200)]
session: Track connect reason

13 years agosession: Pass on all service state changes
Daniel Wagner [Mon, 9 May 2011 15:50:09 +0000 (17:50 +0200)]
session: Pass on all service state changes

All session should be informed that when there is service state change.

For example, if one session calls Session.Connect() and the other
session is only wants to free ride then it also needs to be informed
(call session_changed).

13 years agosession: Fix indention
Daniel Wagner [Mon, 9 May 2011 15:50:09 +0000 (17:50 +0200)]
session: Fix indention

13 years agoservice: Fix forwared decleration
Daniel Wagner [Mon, 9 May 2011 15:50:09 +0000 (17:50 +0200)]
service: Fix forwared decleration

13 years agotools: Add support for broken WISPr responses
Marcel Holtmann [Mon, 9 May 2011 00:51:39 +0000 (17:51 -0700)]
tools: Add support for broken WISPr responses

Some hotspots answer with 404 or 200 responses, but are still in login
stage. If the WISPr XML strings are found, treat all status results the
same to trigger login procedure.

13 years agotools: Add support for WISPr authentication polling
Marcel Holtmann [Mon, 9 May 2011 00:38:40 +0000 (17:38 -0700)]
tools: Add support for WISPr authentication polling

To log into a FON access point, the redirect site needs to be requested
since it contains the 2nd stage authentication challenge.

13 years agonetwork: Return an Error Appropriate for Function Signature
Grant Erickson [Mon, 2 May 2011 23:50:22 +0000 (16:50 -0700)]
network: Return an Error Appropriate for Function Signature

Currently, one of the return paths in __connman_network_set_ipconfig
returns FALSE, inconsistently with its function signature return type
of 'int'.

This patch returns the error code specified in 'ret'.

13 years agosession: Call update_info() if service changes
Daniel Wagner [Thu, 28 Apr 2011 16:05:06 +0000 (18:05 +0200)]
session: Call update_info() if service changes

Instead of trying to figure out when to call update_info() at various
places, just call update_info() at the end of session_changed when the
selected service has been changed.

Another noteworthy change is the remove of g_timeout_add_seconds(...,
session_notify(), ...). It was introduced to 'fix' a problem where
sometimes the notification message was not send. The source of this
problem seemed to be that session_notify() couldn't be called if the
current context was called from a incoming D-Bus call
(e.g. Session.Connect()). Though without g_timeout_add_seconds it
still works now. So it's properly better to remove it again since it's
seems not necessary.

13 years agosession: Fix NULL pointer name append
Daniel Wagner [Fri, 29 Apr 2011 12:34:27 +0000 (14:34 +0200)]
session: Fix NULL pointer name append

A network name can be NULL, for example for a wifi network.

13 years agosession: Refactor session_changed
Daniel Wagner [Thu, 28 Apr 2011 06:46:50 +0000 (08:46 +0200)]
session: Refactor session_changed

Pass the type of the trigger into session_changed. With this
additional information it's simpler to decide what to do and it allows
calling session_notify inside session_changed either directly or via
g_timeout_add_seconds.

13 years agosession: Factor out select code from session_changed
Daniel Wagner [Thu, 28 Apr 2011 12:51:29 +0000 (14:51 +0200)]
session: Factor out select code from session_changed

13 years agosession: Split service_remove_from_session()
Daniel Wagner [Thu, 28 Apr 2011 12:45:01 +0000 (14:45 +0200)]
session: Split service_remove_from_session()

The lookup can be reused later again.

13 years agosession: Update documenation
Daniel Wagner [Thu, 28 Apr 2011 12:41:46 +0000 (14:41 +0200)]
session: Update documenation

13 years agotest-session: Print more user friendly messages
Daniel Wagner [Thu, 28 Apr 2011 06:46:50 +0000 (08:46 +0200)]
test-session: Print more user friendly messages