History log of /system/connectivity/shill/service.h
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
15d5431798155cc83a3fcb8abe0d1a2d5128f7b6 09-Oct-2015 Rebecca Silberstein <silberst@google.com> RE-LAND: shill: use DhcpProperties for dhcpv4 config

In some deployments, DHCP properties need to be specified for DHCP
requests. These properties will be set via the PropertyStore and stored
in the user profile (per service) and the default profile.

To implement this, the manager and service classes will each have an
instance of DhcpProperties to track the property settings stored in the
applicable profile. When a device creates a dhcp_config object to
configure the dhcpcd options, it will merge any applicable
DhcpProperties values set in the default and user profiles.

Users were previously able to set the hostname for DHCP requests using
the Manager.Hostname property. This value is now included in the new
DhcpProperties object. Two options are currently supported:
DhcpProperties.Hostname and DhcpProperties.VendorClass.

This change also includes new tests for the new object and the
affiliated functions. Existing tests were also updated to cover this
new functionality.

Bug: 24162121
TEST="FEATURES=test emerge-daisy shill"
TEST=compiled for brillo

Change-Id: I045ab0dbf866ea0084a8f77b28bfff24970bb92c
/system/connectivity/shill/service.h
f95fe0f32645a56ba4a1dfb2dfbcaabf80b0b3f2 31-Oct-2015 Rebecca Silberstein <silberst@google.com> Revert "shill: use DhcpProperties for dhcpv4 config"

This reverts commit 5ac8c7b32241582e2e39469297de6b7cab2c7d19.

Change-Id: I7b8e747aca30a2d09dc474d2c5ef31ffcccf8032
/system/connectivity/shill/service.h
5ac8c7b32241582e2e39469297de6b7cab2c7d19 09-Oct-2015 Rebecca Silberstein <silberst@google.com> shill: use DhcpProperties for dhcpv4 config

In some deployments, DHCP properties need to be specified for DHCP
requests. These properties will be set via the PropertyStore and stored
in the user profile (per service) and the default profile.

To implement this, the manager and service classes will each have an
instance of DhcpProperties to track the property settings stored in the
applicable profile. When a device creates a dhcp_config object to
configure the dhcpcd options, it will merge any applicable
DhcpProperties values set in the default and user profiles.

Users were previously able to set the hostname for DHCP requests using
the Manager.Hostname property. This value is now included in the new
DhcpProperties object. Two options are currently supported:
DhcpProperties.Hostname and DhcpProperties.VendorClass.

This change also includes new tests for the new object and the
affiliated functions. Existing tests were also updated to cover this
new functionality.

Bug: 24162121
TEST="USE="asan clang" FEATURES=test emerge-samus shill"

Change-Id: I9e25ced863661cfd73164faf9032df25b208c6c2
/system/connectivity/shill/service.h
c0beca55d290fe0b1c96d78cbbcf94b05c23f5a5 03-Sep-2015 Peter Qiu <zqiu@google.com> License shill to Apache2

This patch automatically replaced the license on all text files from
Chromium OS (BSD style) to AOSP (Apache2), keeping the original year as
a reference.

The license header was added to .gyp and .gypi, the NOTICE was added with a copy
of the Apache2 license and MODULE_LICENSE_* file was added.

BUG=23587594
TEST=grep 'Chromium OS Authors' doesn't find anything.

Change-Id: If41ede586c2465f5831fb7fee270ff41dbfdb596
/system/connectivity/shill/service.h
a92b0a0438803ebb3432d7b42672fbb7fb6bccf4 13-Aug-2015 Peter Qiu <zqiu@chromium.org> shill: usage of EventDispatcherForTest and NullRPCIdentifier

Switch tests to use EventDispatcherForTest instead of EventDispatcher,
since EventDispatcher no longer owns a message loop.

Update references for DBusAdaptor::kNullPath to
ControlInterface::NullRPCIdentifier, since RPC identifier is specific
to control interface and opaque to the internal code.

BUG=chromium:517680
TEST=unittests

Change-Id: Ia932143e433b44c84bd176baac660d1fa75261d8
Reviewed-on: https://chromium-review.googlesource.com/293550
Commit-Ready: Zeping Qiu <zqiu@chromium.org>
Tested-by: Zeping Qiu <zqiu@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/service.h
8e60d61b13fedf9cb75f1d4f1762605375837d98 21-Aug-2015 Peter Qiu <zqiu@chromium.org> shill: include non-primary devices in the enumerated devices list

The devices are included in the enumerated devices list without being
persist to the profile storage.

This allows remote client to easily retrieve IP configurations for
such devices.

BUG=chromium:523416
TEST=USE=pppoe emerge-$BOARD shill

Change-Id: Ia6b5d225f75a8514102ca43e01f60a6decd293d1
Reviewed-on: https://chromium-review.googlesource.com/295042
Commit-Ready: Zeping Qiu <zqiu@chromium.org>
Tested-by: Zeping Qiu <zqiu@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/service.h
009e22157969c35957a6d9a5d9783a833b15245e 04-Aug-2015 Ningyuan Wang <nywang@chromium.org> shill: remove Service::SaveToCurrentProfile.

There are only declartion, defination and corresponding mock service of
Service::SaveToCurrentProfile. It is unused, so I remove it.

BUG=chromium:457352
TEST=Unit tests

Change-Id: I886ac7b6305e6481046ca77c10d279589fae02e9
Reviewed-on: https://chromium-review.googlesource.com/290465
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Commit-Queue: Ningyuan Wang <nywang@chromium.org>
Tested-by: Ningyuan Wang <nywang@chromium.org>
/system/connectivity/shill/service.h
778c986f85ffb3e91ccf3bf0382372853888fd07 30-Jul-2015 Paul Stewart <pstew@chromium.org> shill: Service: Prefer Online to Connected

This change allows services that are online but still executing
portal detection to remain non-default while portal detection is
still being executed. This eliminates network disruptions when
higher priority technologies are attached to networks that do
not supply upstream connectivity. For example, if connected to
a working WiFi, and Ethernet is attached, connectivity will not
be switched until portal detection completes successfully.

Before this change, Ethernet would become default temporarily
until it was discovered that we were in portal mode. The upside
of this change is large (due to the length of time it takes to
fail portal detection) and the downside is small (successful
portal detection usually does not take long).

BUG=chromium:515570
TEST=Unit tests + manual -- connect to WiFi, then attach
TEST=Ethernet to a router with no upstream connectivity.

Change-Id: I4a6eab276400e6e945cc8cba94b10425aefc2770
Reviewed-on: https://chromium-review.googlesource.com/289812
Reviewed-by: Paul Stewart <pstew@chromium.org>
Commit-Queue: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/service.h
1a212a6b98b22ad1d69652bb26a9e94138635476 16-Jun-2015 Paul Stewart <pstew@chromium.org> shill: Top-level files n-v: Switch pointer/ref spacing

Switch to Chrome style spacing.

BUG=chromium:501026
TEST=Unit tests

Change-Id: I8bd6f66ea185ca3a2687986f6f2fd99be957dffe
Reviewed-on: https://chromium-review.googlesource.com/278070
Reviewed-by: Rebecca Silberstein <silberst@chromium.org>
Commit-Queue: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/service.h
1a72f5444e077ed21b8e085b17d7f9f1bc44fa5e 15-Apr-2015 Peter Qiu <zqiu@chromium.org> shill: compiler option support for wifi and wired 802.1x

This allows shill to be compiled without wifi and wired 802.1x independently.
The supplicant related code will not be compiled when both wifi and wired
802.1x compiler option are disabled.

BUG=chromium:475665
TEST=USE="asan clang -wifi" FEATURES=test emerge-$BOARD shill
USE="asan clang -wired_8021x" FEATURES=test emerge-$BOARD shill
USE="asan clang -wifi -wired_8021x" FEATURES=test emerge-$BOARD shill
USE="asan clang" FEATURES=test emerge-$BOARD shill
Default shill (including both wifi and wired 802.1x):
Passes wifi_matfunc test suite
shill without wifi
No wifi connectivity
Have ethernet connectivity
Passes network_8021xWiredAuthentication test
shill without wired 802.1x
Have wifi and ethernet connectivity
Fail network_8021xWiredAuthentication test
shill without both wifi and wired 802.1x
No wifi connectivity
Have ethernet connectivity
Fail network_8021xWiredAuthentication test
CQ-DEPEND=CL:265614

Change-Id: I6abaa150657f6ca0f6d5c37229fde9a2c0bb36aa
Reviewed-on: https://chromium-review.googlesource.com/265774
Tested-by: Zeping Qiu <zqiu@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Commit-Queue: Zeping Qiu <zqiu@chromium.org>
/system/connectivity/shill/service.h
a388fdb2e74717ba2440a605f208647dd7cd3e06 03-Apr-2015 Peter Qiu <zqiu@chromium.org> shill: suppress reassociate attempt when network is unreliable

A network is considered unreliable when encountering multiple link
failures in a short period of time (currently set to 60 minutes). When
a network is unreliable, reassociate attempts will be skipped when link
failures are detected.

The unreliable status of the network will be reset when the device
resumes from suspend, or selected network changes, or after a period
of time without link failures after reconnection.

This will avoid unnecessary disconnect/reconnect attempts when the
network is unreliable due to other unforeseen factors.

BUG=chromium:472828
TEST=unittest

Change-Id: I2037d08692a9abec48afdb974a1e028c85eb2ad0
Reviewed-on: https://chromium-review.googlesource.com/263953
Trybot-Ready: Zeping Qiu <zqiu@chromium.org>
Tested-by: Zeping Qiu <zqiu@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Commit-Queue: Zeping Qiu <zqiu@chromium.org>
/system/connectivity/shill/service.h
d01b5cc35185e022b66e08832e12fe7f59b5aa24 12-Mar-2015 Garret Kelly <gdk@chromium.org> shill: don't override static nameservers

When using the prepend_dns_servers flag, do not override nameservers if
they have been provided as part of the static configuration.

BUG=chrome-os-partner:37737
TEST=FEATURES=test emerge-amd64-generic shill

Change-Id: I1166052470931818f51074f26688b1a47847fd1a
Reviewed-on: https://chromium-review.googlesource.com/260504
Commit-Queue: Garret Kelly <gdk@chromium.org>
Tested-by: Garret Kelly <gdk@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/service.h
07dfabcb55d74e254f4722926a997959dc4c6393 21-Jan-2015 Samuel Tan <samueltan@chromium.org> shill: create EventHistory class

Refactor deque<Timestamp> members from Service into a separate
EventHistory class that stores a monotonically increasing list of
timestamps represent the occurence of one or more events. This class
allows the number of event timestamps stored in the object at once to
be limited and stale event timestamps to be evicted. All timestamp
eviction is done in FIFO order.

BUG=chrome-os-partner:35518
TEST=Compile shill and run unit tests.

Change-Id: Ie53676c30444c2e2c60f39238f435968d68017fc
Reviewed-on: https://chromium-review.googlesource.com/242081
Tested-by: Samuel Tan <samueltan@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Commit-Queue: Samuel Tan <samueltan@chromium.org>
/system/connectivity/shill/service.h
d9c7cfc904504447c3478f42c1cffc768c772020 06-Jan-2015 Paul Stewart <pstew@chromium.org> shill: Implement PriorityWithinTechnology property

Implement a property which will be used to rank services relative
to others that are of the same technology type. This contrasts
with the "Priority" property transcends technology ordering. This
allows a caller to make one WiFi service preferred over another
without needing to make it preferred above all Ethernet services,
for example.

CQ-DEPEND=CL:238840
BUG=chromium:446621
TEST=Unit tests

Change-Id: I67f0170a7be3e938baf00ec188e2bfa6c577fb4e
Reviewed-on: https://chromium-review.googlesource.com/238851
Reviewed-by: Peter Qiu <zqiu@chromium.org>
Commit-Queue: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/service.h
3fee7e38845bc9512a84c311c7bfcc21e19cda19 16-Oct-2014 Paul Stewart <pstew@chromium.org> shill: Service: Rank HasEverConnected with Managed Credentials

Add a service property that specifies whether the credentials
for this service are managed outside of shill, and are
validated in some manner other than the user. As such, these
credentials need not be validated via an initial connection
attempt in order for the service to be considered of equal
priority to other services that have been connected before.

BUG=chromium:424036
TEST=Unit tests

Change-Id: I20f709b525a32400ae9b90797f8107c2f6446f2e
Reviewed-on: https://chromium-review.googlesource.com/223653
Reviewed-by: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Commit-Queue: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/service.h
8d6b59704591ba9fad57751858835dc332dbdd37 28-Oct-2014 Peter Qiu <zqiu@chromium.org> shill: export a shared library for RTNL interface.

Export a shared library "libshill-net-<(libbase-ver)" from shill, which
currently includes the RTNL interface and other codes that it depends on
(mainly ByteString, IPAddress, IOHandler, TimeStamp, and Sockets). All the
library codes are moved to under "shill/net/".

Upcoming changes:
- Remove dependency for "shill/error.h" which depends on dbus-c++.
- Add Netlink interface to the shared library.

BUG=chromium:427982
TEST=unittests
CQ-DEPEND=CL:226103

Change-Id: I7f5c183b8a347c02e80ffed5e3497f691dde517c
Reviewed-on: https://chromium-review.googlesource.com/226110
Reviewed-by: Peter Qiu <zqiu@chromium.org>
Tested-by: Peter Qiu <zqiu@chromium.org>
Commit-Queue: Peter Qiu <zqiu@chromium.org>
/system/connectivity/shill/service.h
22ce765226cfdcf267b7dc80c22892e6b29065ea 16-Oct-2014 Paul Stewart <pstew@chromium.org> shill: Service: Move ManagerTest::SortServices to ServiceTest::Compare

We have long considered the SortServices test to be misplaced.
Finally move this to the Service unit tests, since after all,
this is testing the Service::Compare static method.

While here, mock EnableAndRetainAutoConnect() in MockService since
the move of SortServices was blocking this change.

BUG=chromium:206367
TEST=Unit tests

Change-Id: I4ec7d5a098edfb938d1ffd0ae78116f8004646c9
Reviewed-on: https://chromium-review.googlesource.com/223615
Reviewed-by: Paul Stewart <pstew@chromium.org>
Commit-Queue: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/service.h
cd47732488cd101eaf0d3558dde5a7d4e4fc260b 17-Oct-2014 Ben Chan <benchan@chromium.org> shill: Replace scoped_ptr with std::unique_ptr.

BUG=None
TEST=`USE='wimax' FEATURES=test emerge-$BOARD shill`
TEST=`USE='wimax clang asan' FEATURES=test emerge-$BOARD shill`

Change-Id: Id9737d9a9c75ecb6abb466b5559ff06dcf0751cd
Reviewed-on: https://chromium-review.googlesource.com/224138
Tested-by: Ben Chan <benchan@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Commit-Queue: Ben Chan <benchan@chromium.org>
/system/connectivity/shill/service.h
cc225ef3b77b5e098cc12c661a947e1737480777 30-Sep-2014 Ben Chan <benchan@chromium.org> shill: Replace NULL with nullptr.

BUG=None
TEST=`USE=wimax FEATURES=test emerge-$BOARD shill`

Change-Id: I30ab47ff32dcadad09ae7a2baf4d4123a6ef0d8e
Reviewed-on: https://chromium-review.googlesource.com/220657
Reviewed-by: Ben Chan <benchan@chromium.org>
Tested-by: Ben Chan <benchan@chromium.org>
Commit-Queue: Ben Chan <benchan@chromium.org>
/system/connectivity/shill/service.h
5777690fb2291a468715eabfcc6f7aac6f1678cd 16-Sep-2014 Rebecca Silberstein <silberst@chromium.org> shill: detect password change on user profile load

When loading a user profile, the stored password should be checked
against the currently active password. A credential change should
be detected and handled if the passwords are different. Additionally
removed the Service::SaveToProfile call in Service::SetHasEverConnected
to avoid overwriting a previously loaded profile. Removed ordering
dependence on loading parts of a profile by adding a boolean to
Service::OnEapCredentialsChanged to differentiate between loading
credentials from a profile and changing credentials. In WiFi services
that do not use EAP for authentication, ignore changes to EAP credentials.
This allows only passphrase changes to trigger a disconnect when the
service is loaded from a new profile.

BUG=chromium:414889, chromium:414562
TEST=unit tests with and manual verification on peppy:
Connect to a new PSK network while logged in. Log out (system should
disconnect). Connect to the same network again (while still logged out).
Log in, and ensure that the system does not disconnect and re-connect to
the network in the process.

Change-Id: I6eef098728951cfd0118e94278d76caf595d5b81
Reviewed-on: https://chromium-review.googlesource.com/218618
Reviewed-by: Rebecca Silberstein <silberst@chromium.org>
Tested-by: Rebecca Silberstein <silberst@chromium.org>
Commit-Queue: Rebecca Silberstein <silberst@chromium.org>
/system/connectivity/shill/service.h
d49760e19d137f43df29e00265259d395b07994c 20-Sep-2014 Peter Qiu <zqiu@chromium.org> shill: Add support for disable/enable link monitoring through DBUS

This is a per-service setting, with default value set to false
(link monitoring enabled).

BUG=chromium:415367
TEST=unit tests, manual test
Manual Test
1. Get a chrome device, and turn up the logging with
"ff_debug +device" and "ff_debug --level -2".
2. Connect to "GoogleGuest", verify link monitor is enabled
(by default) by examing log file "/var/log/net.log" for following
message "Link Monitor starting".
3. Disable link monitor for "GoogleGuest" with command
"/usr/local/lib/flimflam/test/set-service-property GoogleGuest
LinkMonitorDisable true"
4. Connect to a different network, then connect back to "GoogleGuest".
Verify link monitor is disabled by examing log file
"/var/log/net.log" for following message
"Link Monitor is disabled for the selected service".
CQ-DEPEND=CL:219029

Change-Id: I83aabe035f66eeaa9547a486d4677c7292247561
Reviewed-on: https://chromium-review.googlesource.com/219117
Reviewed-by: Peter Qiu <zqiu@chromium.org>
Tested-by: Peter Qiu <zqiu@chromium.org>
Commit-Queue: Peter Qiu <zqiu@chromium.org>
/system/connectivity/shill/service.h
8e6b8ef22e185310480c13aa3a6e89184cce62d1 15-Jul-2014 Ben Chan <benchan@chromium.org> shill: Add 'NoAutoConnectTechnologies' manager DBus property.

This CL adds a 'NoAutoConnectTechnologies' property to the manager DBus
interface, which is a comma-separated list of technologies for which
auto-connect is disabled. This property will be used by cellular tests
to temporarily disable auto-connect for a cellular device under test.

BUG=chromium:403164
CQ-DEPEND=CL:217813
TEST=Tested the following:
1. `FEATURES=test emerge-$BOARD platform2`
2. Manually test the following on a DUT:
- Plug in a cellular modem over USB.
- Verify that shill auto-connects the cellular service.
- Unplug the modem.
- Disable auto-connect on cellular via:
dbus-send --system --dest=org.chromium.flimflam \
/org/chromium/flimflam \
org.chromium.flimflam.Manager.SetProperty \
string:'NoAutoConnectTechnologies' string:'cellular'
- Plug in the modem again.
- Verify that shill no longer auto-connects the cellular service.

Change-Id: Ib09e7593695b0436c72717bc9463ce0c714185ee
Reviewed-on: https://chromium-review.googlesource.com/217825
Reviewed-by: Paul Stewart <pstew@chromium.org>
Tested-by: Ben Chan <benchan@chromium.org>
Commit-Queue: Ben Chan <benchan@chromium.org>
/system/connectivity/shill/service.h
64ad2383c4555a99f4f09fe8f5faa088f99f5b90 26-Aug-2014 Prathmesh Prabhu <pprabhu@chromium.org> shill: Add dark resume methods to PowerManager client object.

This CL updates the PowerManagerProxy API in response to updated DBus API of
powerd. It also updates PowerManager to allow shill to register
DarkSuspendDelay with powerd, and handle DarkSuspendImminent message from it.
Finally, it adds stub (synchronous) functions in Manager/Device/Service base
objects to handle this message.

BUG=chromium:397346
TEST=(1) shill unittests.
(2) On a device supporting dark resume, test powerd/shill interaction
manually across a dark resume.
Change-Id: I872615a8a68d4e02b35aa50a165c06e9d034f0e4
Reviewed-on: https://chromium-review.googlesource.com/215371
Reviewed-by: Prathmesh Prabhu <pprabhu@chromium.org>
Commit-Queue: Prathmesh Prabhu <pprabhu@chromium.org>
Tested-by: Prathmesh Prabhu <pprabhu@chromium.org>
/system/connectivity/shill/service.h
9b83c897f8e197ff7846e4fe7cec1d83d54e7b7b 10-Aug-2014 Peter Qiu <zqiu@chromium.org> shill: Export portal detection failure phase and status

When portal detection fails, report the failure phase and status
to the given Service. The Chrome can then retrieve this information from
Service property through DBUS, and inform the user appropriately.

BUG=chromium:399486
TEST=unit tests
CQ-DEPEND=CL:211763

Change-Id: I27ec85bc6bf73162b1214d35bc84084588c3a855
Reviewed-on: https://chromium-review.googlesource.com/211745
Reviewed-by: Peter Qiu <zqiu@chromium.org>
Commit-Queue: Peter Qiu <zqiu@chromium.org>
Tested-by: Peter Qiu <zqiu@chromium.org>
/system/connectivity/shill/service.h
7fab89734d88724a288e96a9996b15548c5294c7 11-Aug-2014 Ben Chan <benchan@chromium.org> shill: Use integer types from stdint.h

This CL replaces the deprecated int* and uint* types from
'base/basictypes.h' with the int*_t and uint*_t types from 'stdint.h'.

BUG=chromium:401356
TEST=`USE='cellular gdmwimax wimax' FEATURES=test emerge-$BOARD platform2`

Change-Id: I3d4c195881203dd2a47dbb5af150b6c90b9c206e
Reviewed-on: https://chromium-review.googlesource.com/211770
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Commit-Queue: Ben Chan <benchan@chromium.org>
Tested-by: Ben Chan <benchan@chromium.org>
/system/connectivity/shill/service.h
a41ab517725d036b63420f8445550246f8f50b99 23-Jul-2014 Alex Vakulenko <avakulenko@chromium.org> shill: Sort headers alphabetically (build/include_alpha)

We are going to enable build/include_alpha linter warning soon,
so in preparation for this, fixed the warnings in shill.

BUG=None
TEST=cpplint.py --filter=-build/include_order,+build/include_alpha shill/*

Change-Id: I113ed7f9dd3f465a3f660599320cdb434e7cc214
Reviewed-on: https://chromium-review.googlesource.com/209636
Tested-by: Alex Vakulenko <avakulenko@chromium.org>
Reviewed-by: Ben Chan <benchan@chromium.org>
Commit-Queue: Alex Vakulenko <avakulenko@chromium.org>
/system/connectivity/shill/service.h
6d4836bd3e385b8929597c366b4d5ba969f5cd04 16-Jul-2014 Rebecca Silberstein <silberst@chromium.org> shill: use profile order in service sorting

Add the ability to sort services based on their loaded profiles.
Loaded profiles should be ranked above ephemeral, then base sort
order on profile priority. This allows user-specific networks to
be preferred over device-wide networks.

BUG=chromium:266107
TEST=Ran shill unit tests

Change-Id: I6412d16e0b5fdb5ece1ae72e17405e3a7cfc0b4a
Reviewed-on: https://chromium-review.googlesource.com/208462
Tested-by: Rebecca Silberstein <silberst@chromium.org>
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Commit-Queue: Rebecca Silberstein <silberst@chromium.org>
/system/connectivity/shill/service.h
b6df8b11a3eff18acdc3e9128af73c62ef39aa1a 11-Jul-2014 Rebecca Silberstein <silberst@chromium.org> shill: clear has_ever_connected_ with EAP change

Clear the has_ever_connected_ field with a change in
EAP credentials.

BUG=chromium:216796
TEST=Ran shill unit tests

Change-Id: I3d49abd7b7043ef3fe1e4597faad420bf275932c
Reviewed-on: https://chromium-review.googlesource.com/207450
Reviewed-by: Rebecca Silberstein <silberst@chromium.org>
Commit-Queue: Rebecca Silberstein <silberst@chromium.org>
Tested-by: Rebecca Silberstein <silberst@chromium.org>
Reviewed-by: mukesh agrawal <quiche@chromium.org>
/system/connectivity/shill/service.h
0d06119be3224788ba1aa65ed24bc8e46b56b949 08-Jul-2014 Samuel Tan <samueltan@chromium.org> shill: add disconnect reason to log messages

Allow logging of function/reason for triggering disconnect.

BUG=chromium:227295
TEST=unit tests

Change-Id: I92ea3cca664c060bc02bbb8d50d303ce11d1a7de
Reviewed-on: https://chromium-review.googlesource.com/207020
Tested-by: Samuel Tan <samueltan@chromium.org>
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Commit-Queue: Samuel Tan <samueltan@chromium.org>
/system/connectivity/shill/service.h
700de6400c18f8cba77821f8cd2a1935b96999a6 15-Jul-2014 Peter Qiu <zqiu@chromium.org> shill: Reporting of device's connection status

Report device's connection status to UMA stats periodically. Possible status
are offline (not connected to an AP), connected (connected to an AP), and
online (connected to an AP with internet connectivity). When the device is
in online state, it will report both connected and online to UMA stats.

This data will allow us to determine the percentage of time when the device
have internet connectivity, also the percentage of time when the device is
connected to an AP but without internet connectivity.

While at it, update the old IsOnline function in manager.cc to IsConnected
to be more semantically correct, since that function return true if there is a
service that's in connected or above state. And Add a new IsOnline function
which will return true only if there is a service that's in online state.

BUG=chromium:392990
TEST=unit tests, manual
Manual Test:
1. Boot up a chrome device without any network connectivity.
2. Wait for 3 minutes, and browse to "chrome://histograms", veriyf
there is a histogram for "Network.Shill.DeviceConnectionStatus"
with a hit for bucket 0 (offline).
3. Connect the chrome device to an AP without internet connectivity.
4. Wait for 3 minutes, and browse to "chrome://histograms", verify
there is a hit for bucket 1 (connected) for histogram
"Network.Shill.DeviceConnectionStatus".
5. Connect the chrome device to an AP with internet connectivity.
6. Wait for 3 minutes, and browse to "chrome://histograms", verify
there sia hit for bucket 1 (connected) and 2 (online) for
histogram "Network.Shill.DeviceConnectionStatus".

Change-Id: I1a949b17398214d745ca1d5a37e35202e087181a
Reviewed-on: https://chromium-review.googlesource.com/207960
Reviewed-by: Paul Stewart <pstew@chromium.org>
Commit-Queue: Peter Qiu <zqiu@chromium.org>
Tested-by: Peter Qiu <zqiu@chromium.org>
/system/connectivity/shill/service.h
e99f6643c3282317d2f381c463f46e59628c58c4 09-Jul-2014 Rebecca Silberstein <silberst@chromium.org> shill: clear has_ever_connected_ field with password change

Clear the has_ever_connected_ field and counter for
suspected credential failures with password change. This
change also impacted an existing test. The
SuspectedCredentialFailure test was modified and updated to
reflect the new behavior.

BUG=chromium:216796
TEST=Ran shill unit tests

Change-Id: I207251e5938b873dee7e6a7914a6123155687c5a
Reviewed-on: https://chromium-review.googlesource.com/207207
Reviewed-by: Paul Stewart <pstew@chromium.org>
Tested-by: Rebecca Silberstein <silberst@chromium.org>
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Commit-Queue: Rebecca Silberstein <silberst@chromium.org>
/system/connectivity/shill/service.h
a89154bfedfd8872242083ffe4f084fdc774c078 24-May-2014 Peter Qiu <zqiu@chromium.org> shill: Support of DNS auto fallback

Automatically switch to fallback DNS server when broken DNS setting
is detected. This feature is disabled by default (due to property
defaulting to "false").

BUG=chromium:377056
TEST=unit tests, manual test
1. Manually update the code to allow DNS auto fallback.
2. Connect a chrome device to GoogleGuest.
3. Update the name servers setting to an invalid
DNS server "192.168.1.1"
4. Browse to "chrome://net-internals/#dns", and verify
the nameserver changed from "192.168.1.1" to Google's
DNS servers "8.8.8.8" and "8.8.4.4" within a minute.
CQ-DEPEND=CL:201412

Change-Id: I31dbaf715b5b11dd2f736e0664ee432e55bdeeb9
Reviewed-on: https://chromium-review.googlesource.com/207155
Reviewed-by: Paul Stewart <pstew@chromium.org>
Commit-Queue: Peter Qiu <zqiu@chromium.org>
Tested-by: Peter Qiu <zqiu@chromium.org>
/system/connectivity/shill/service.h
7b5cee92f29791ebd3867b858fc1d301b39d26bd 25-Jun-2014 Paul Stewart <pstew@chromium.org> shill: Service: Remove DHCP minimal config code

This code does not end up being very useful (as evidenced by
UMA stats) and can reduce functionality in infrastructures
that require the use of some DHCP options.

This reverts commit 26a997b04bd65a6252987ea6fdcbbb70785d1d8d,
except for the cleanup of "*service" in unit tests and the
setting of SelectedService in ethernet.cc.

BUG=chromium:360452
TEST=Unit tests

Change-Id: Ib2c49fc5639452bfffd5cd03c1bb69e32568cc60
Reviewed-on: https://chromium-review.googlesource.com/205588
Commit-Queue: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/service.h
8a5322984f2d81bcbfd8d44c59747a11bd9b904b 17-Jun-2014 Alex Vakulenko <avakulenko@chromium.org> shill: Fix most of warnings from cpplint

Fix most cpplinter's warnings. On a few occasisions, the warnings
produced were false-positives, so added explicit // NOLINT comment
overrides.

There were a few instances of disallowed non-const reference usage
(reported as runtime/reference error by cpplint) for
"DBus::Error &error" which should potentially be changed
to pointers to comply with C++ coding style but I will let Shill
owners do that since there is quite a few of those and the
change isn't brain-dead simple...

BUG=None
TEST=platform2 still compiles and all unit tests pass.

Change-Id: Ic2e31896aa13d20eeb1a85dee74f3db8cccfde2e
Reviewed-on: https://chromium-review.googlesource.com/204164
Tested-by: Alex Vakulenko <avakulenko@chromium.org>
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Commit-Queue: Alex Vakulenko <avakulenko@chromium.org>
/system/connectivity/shill/service.h
45170bcb5e3b5e076e9307c695faf25faac395c8 03-Jun-2014 Paul Stewart <pstew@chromium.org> shill: Service: Use ServicePropertyChangeNotifier

Instead of using an ad-hoc method, use the
ServicePropertyChangeNotifier for the IsVisible property.

BUG=chromium:379948
TEST=Unit tests

Change-Id: Ie9f88d505e1d825ced706276dd253f30fbab7d1d
Reviewed-on: https://chromium-review.googlesource.com/202442
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Commit-Queue: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/service.h
7cc906803118d61ead47471f26eb1970a5851811 31-May-2014 Paul Stewart <pstew@chromium.org> shill: WiFiService / WiMaxService: Emit Visibility updates

Send property change singals for the "Visible" property when
some attribute of the service changes in a way that would
affect it. For WiMax services, this happens during start/stop
and for WiFi services this happens when the endpoint list or
service state changes.

Also add documentation for the "Visible" property.

BUG=chromium:379231
TEST=Unit tests

Change-Id: I104226fe096996a58c251984af498ebe1910a120
Reviewed-on: https://chromium-review.googlesource.com/202136
Reviewed-by: Paul Stewart <pstew@chromium.org>
Commit-Queue: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/service.h
cca85b15c06b120ea3d17a4be2f24da06d62a1c4 30-May-2014 Paul Stewart <pstew@chromium.org> shill: Service: Make "Visible" property available in RPC

Add a "Visible" property that corresponds to the result of
the Service::IsVisible() method call.

CQ-DEPEND=CL:202314
BUG=chromium:379231
TEST=Unit tests

Change-Id: Ib0b7f55bd2b71262c74ae05ec6a128e380d9e029
Reviewed-on: https://chromium-review.googlesource.com/202305
Reviewed-by: Steven Bennetts <stevenjb@chromium.org>
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Commit-Queue: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/service.h
316acef85ecfc128bf06cc2d2699f21880aa5a7e 30-May-2014 Paul Stewart <pstew@chromium.org> shill: WiFi: Disable gateway ARP for static IP

Even when a static IP address is configured for a WiFi service,
we perform a DHCP lease negotiation in the interest of gaining
other parameters associated with the connection (DNS servers,
proxy configuration, etc). Shortly thereafter, we release such
a lease. Since we never intend on actually using the IP address
provided by the DHCP server, the validity of the IP address it
provides is not of any interest. As such, it's reasonable to
disable the "gateway ARP" address validation.

BUG=chromium:377990
TEST=New unit tests. Note that an DHCP autotest using
pseudoethernet won't help validate this change since it is not
WiFi, and as such gateway ARP is disabled across-the-board.

Change-Id: I7f3e096370189698f900f85d78592fd42017ffbd
Reviewed-on: https://chromium-review.googlesource.com/202176
Reviewed-by: Paul Stewart <pstew@chromium.org>
Commit-Queue: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/service.h
2eee613868307d04f9e5a0efbc8c72a7ffcd90bb 09-May-2014 Paul Stewart <pstew@chromium.org> shill: Manager: Clear all explicit disconnections

When the profile stack changes, remove all state related to
explicit disconnections. Since this state is related to the
logged in user, it is reasonable to expect that this state
should be removed even for services which aren't switching
profiles as a result.

BUG=chromium:371771
TEST=Unit tests

Change-Id: I773c68e5e38ab4fda92a0532beb046188465dc13
Reviewed-on: https://chromium-review.googlesource.com/199147
Reviewed-by: Christopher Wiley <wiley@chromium.org>
Commit-Queue: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/service.h
dc4e099103a56f0427ed0969fea2c46c88ab2e9e 01-May-2014 Peter Qiu <zqiu@chromium.org> Metric report for result of user-initiated wifi connection

Added an UMA metric for result of user-initiated wifi connection.

BUG=chromium:369135
TEST=unit tests, manual
Manual Test:
1. Initiate a connection to a wifi service on a chrome device.
2. Browse to "chrome://histograms" after connection is established.
3. Verify there is a historgram for
"Network.Shill.WiFi.UserInitiatedConnectionResult", and there
is a hit for value 0 (success).
4. Initiate a connection to a secure wifi service, and intentionally
enter a wrong password.
5. Browse to "chrome://histograms" after connection is failed, and
verify there is a hit for value 1 (failure).
6. Initiate a connection to a wifi service, and then initiated another
connection to a different wifi service before the connection is
established to the first wifi service.
7. Browse to "chrome://histograms", verify there is a hit for
value 2 (aborted).

Conflicts:
metrics.cc
metrics.h
metrics_unittest.cc
mock_metrics.h

Change-Id: I6d7ffe9f73334715775d76d17a9b977a926c4b94
Reviewed-on: https://chromium-review.googlesource.com/197813
Reviewed-by: Peter Qiu <zqiu@chromium.org>
Commit-Queue: Peter Qiu <zqiu@chromium.org>
Tested-by: Peter Qiu <zqiu@chromium.org>
/system/connectivity/shill/service.h
401a5b930545f17b8f6a7cc5851896bdbf1beb45 30-Apr-2014 Prathmesh Prabhu <pprabhu@chromium.org> shill: cellular: Unify UpdateStorageIdentifier.

Before this CL, |CellularService::SetStorageIdentifier| was called from
different code paths in three of the capabilities. This CL unifies these code
paths to be triggered when the ServingOperator is determined in |Cellular|.

BUG=chromium:352243
TEST=- Manually test that sensible storage identifiers are used for different
operators, and that they are persistent across service reboots.
- Run shill unit-tests.

Change-Id: I5837465589667e4d4feb75eeeeeb6f793fb5450a
Reviewed-on: https://chromium-review.googlesource.com/197602
Commit-Queue: Prathmesh Prabhu <pprabhu@chromium.org>
Tested-by: Prathmesh Prabhu <pprabhu@chromium.org>
Reviewed-by: Ben Chan <benchan@chromium.org>
/system/connectivity/shill/service.h
9d58193108f55edf0f06cd54f44464da633cb8aa 15-Apr-2014 Peter Qiu <zqiu@chromium.org> Services network reporting.

Added a network ID to each services object, to identify the network
(gateway) that the service is connected to. Network ID is generated by
hashing a random salt value, together with gateway's IP and MAC address.
At the time when the device is connected to a network, report the number
of services that are connected to the same network.

BUG=chromium:359302
CQ-DEPEND=CL:194942
TEST=unittest, manual
Manual Test
1. Configure airport extreme router with two BSSes bss1 "cros airport extreme wpa2"
and bss2 "cros aiport extreme wpa2 5GHz".
2. Connect a peppy device to bss1, then connect it to bss2.
3. Verify the ip address stays the same when connected to bss2.
4. Verify the ConnectionId for both BSSes is the same in
"/var/cache/shill/default_profile".
5. Verify histogram for Network.Shill.ServicesOnSameNetwork
exist in "chrome://histogram", and there is 1 entry for value 2.

Change-Id: I01c446b58be96cb0613a7d5336248838a6e865a9
Reviewed-on: https://chromium-review.googlesource.com/194857
Reviewed-by: Paul Stewart <pstew@chromium.org>
Commit-Queue: Peter Qiu <zqiu@chromium.org>
Tested-by: Peter Qiu <zqiu@chromium.org>
/system/connectivity/shill/service.h
4943822214f823c2437aa32b0376414b3e60388d 14-Mar-2014 Peter Qiu <zqiu@chromium.org> Improve disconnect reporting from shill

When service is disconnected or unable to connect, set the failure state
to an appropriate value if failure state is not set yet and disconnect is
not initiated by user, and then set the service state to idle.

When service is disconnected due to intentional network switch, do not
set the failure state, only set the service state to idle.

BUG=chromium:352383
TEST=manual
out-of-range test
1. Connect a target device to an AP.
2. Manually turn off the AP.
3. Verify in Network Event Log, the service state is first transition to
failure (out-of-range error), and then idle.

bad passphrase test
1. Trying to connect to an AP with wrong passphrase.
2. Verify in Network Event Log, the service state is first transition to
failure (bad-passphrase error), and then idle.

network switching test
1. Connect a target device to an AP "AP1"
2. Manually connect the device to another AP "AP2"
3. Verify in Network Event log, the service state for "AP1" is transition
to idle.

Change-Id: I4141dbe5de5225ccd6e3e1a64d8f61b31009b9d9
Reviewed-on: https://chromium-review.googlesource.com/190119
Tested-by: Peter Qiu <zqiu@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Commit-Queue: Peter Qiu <zqiu@chromium.org>
/system/connectivity/shill/service.h
d7c09a5f2d7dc6f610e3162be392e349e9ceed8d 19-Feb-2014 Paul Stewart <pstew@chromium.org> shill: Service: Track previous error details

Add new PreviousError and PreviousErrorSerialNumber properties
to the Service so that the UI can query the last value of the
Error property even after this failure is cleared (and the
Service may no longer be in an errored state).

BUG=chromium:302020
TEST=Addition to unit tests + manual: list-service and observe
that the new properties are displayed.

Change-Id: Ia051908114c8821f173f2d2962189b8785c1da69
Reviewed-on: https://chromium-review.googlesource.com/187069
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Commit-Queue: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/service.h
fa11e28ddb81dab93971d5433a5274a1dc5c8283 03-Dec-2013 Paul Stewart <pstew@chromium.org> shill: Service: Provide "Tethering" property

Present a service property that indicates whether the service's
connectivity is likely to be provided via a cellular backhaul.

BUG=chromium:323010
TEST=Unit tests; autotest at https://chromium-review.googlesource.com/178577
Manual: list-services with both an iPhone and Nexus in tethering mode. Note
that both are listed with "Tethering: Suspected". After connecting to the
Android phone, the "list-services" shows "Tethering: Confirmed".
CQ-DEPEND=CL:178563

Change-Id: Iefde3a71008a0a3d7e452d740cfa3bbb610b502b
Reviewed-on: https://chromium-review.googlesource.com/178575
Reviewed-by: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
Commit-Queue: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/service.h
1cf7eb8dcb037d45b23ed85b777c227b7ab39069 04-Dec-2013 Paul Stewart <pstew@chromium.org> shill: PropertyAccessor: Create a const ReadOnly accessor

Provide a means to create an Accessor child class which can be
constructed with a const method. This is useful for read-only
properties which won't modify the called object's state. Make
use of this new feature by transforming the HelpRegisterConst*
in the Service object to take const methods and to register
read only accessors. The bulk of this CL is the change to all
the subclasses to constify methods which were only non-const
due to this issue.

BUG=chromium:325603
TEST=Unit test

Change-Id: I79c6211e9e0907869c2885937dff58c1faf2ca4a
Reviewed-on: https://chromium-review.googlesource.com/178698
Reviewed-by: Paul Stewart <pstew@chromium.org>
Commit-Queue: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/service.h
43ce4d428d619bda64eea6d37534f02c179a1756 05-Oct-2013 Thieu Le <thieule@chromium.org> cellular: Improve out-of-credits detection

Refactor out-of-credits detection from cellular, service and capability
into its own class. Add support for detecting out-of-credits using
subscription state.

BUG=chromium:273849
TEST=Unit tests, Manually exhaust SIM data on Pixel and verify
out-of-credits warning is displayed in UI

Change-Id: I31b1d4d2fac31c31bf509787f7edb86cff29f9f6
Reviewed-on: https://chromium-review.googlesource.com/171909
Reviewed-by: Thieu Le <thieule@chromium.org>
Commit-Queue: Thieu Le <thieule@chromium.org>
Tested-by: Thieu Le <thieule@chromium.org>
/system/connectivity/shill/service.h
dded00702cf33f15b1f2eaafbbaccc13231e08d8 24-Oct-2013 Paul Stewart <pstew@chromium.org> shill: Service: Track DHCP failures and inform ShouldUseMinimalDHCPConfig()

The default DHCP configuration used by ChromeOS requests a
large number of options in order to support features like
Web Proxy Auto-Discovery. Unfortunately this practice
sometimes runs afoul of issues in some network topologies.
In some networks, a large number of option values in the
DHCP response can cause MTU problems with proxies or other
network elements. This may prevent the reply from being
forwarded back to the client.

Although the problem may not lie with the outgoing request,
it may be possible to mitigate this issue by modifying these
requests. This CL provides a means for the Service to track
such failures and infer from a series of experiments whether
it is likely to be due to an MTU issue. To do this, the
Device informs the selected Service of each DHCP success and
failure, and queries the Service before starting each DHCP
session to inquire whether it should request an extensive or
minimal DHCP options from the server.

In order to detect and respond to such issues, this CL
maintains state in the Service about how DHCP has been
performing. If there have been a spate of recent DHCP
failures, we should suspect that this may be due to the
number of options we are requesting from the DHCP server.

We should confirm that this is in fact the issue by testing
whether a request for a smaller response succeeds. If this
request succeeds we can consider the hunch confirmed and the
client should switch to using small requests for some period
of time. If our test request fails, we can assume for now
that the problem isn't realated to a DHCP response size and
return to the default behavior.

If we have confirmed our hunch earlier and the time period
expires, we should try again to use a more comprehensive
DHCP request. If this succeeds, we can assume either the
network infrastructure has repaired itself or that the
previous hunch was in error, and return to the "not
detected" state. If it fails, we should confirm whether
this is the identical problem to before by re-testing a
small DHCP request size. Since the "confirmed" state did
not pay attention to DHCP failures, it's possible that they
have been failing across the board as of late. If indeed
both large and small DHCP responses fail to reach us, we
should put off our re-test until we start receiving DHCP
replies again.

The state machine implemented for DHCP failures is
illustrated in state machine diagram below (all events not
shown do not cause a state change):

[ Not Detected (send full request) ] <------------
| ^ |
| | |
n * failure failure |
| | |
V | |
[ Suspected (send minimal request) ] |
| |
success |
| |
V |
[ Confirmed (send minimal request) ] |
^ | |
| hold timer elapsed |
| | |
success V |
| [ Retest Full Request ] ----success--/
| | ^
| failure |
| | |
| V |
[ Retest Minimal Request ] |
| success
failure |
| |
V |
[ Retest With No Reply (send minimal requests) ]

The Service only persists two states: "Not Detected" and
"Confirmed". This is done via the presence or absence of
the stored "LastDHCPOptionFailure" property, which is the
time the system last entered the "Confirmed" state. A
third state, "Reset Full Request" is implicitly persisted
if this timestamp is old enough that the hold timer has
expired.

BUG=chromium:297607
TEST=Unit tests

Change-Id: I1ee83debf4d11f25678fe3586574ec04f254a83f
Reviewed-on: https://chromium-review.googlesource.com/174634
Reviewed-by: Paul Stewart <pstew@chromium.org>
Commit-Queue: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/service.h
11c224b7054a3f0dc5a34c2903e13f74376db27e 23-Oct-2013 Paul Stewart <pstew@chromium.org> shill: WiFi: Provide wpa_supplicant a PIN if asked for

There are conditions under which wpa_supplicant will clear the
"pin" property of its configuration, even if this was previously
supplied by shill. Under these circumstances it wil request it
again as the EAP negotiation starts. This change provides the
means for the WiFi object to detect when this parameter is being
requested and to supply this value to wpa_supplicant if the
WiFiService has this information on hand.

BUG=chromium:310296
TEST=Unit tests + new autotest:
https://chromium-review.googlesource.com/174170
This autotest still fails the following but shows in the supplicant logs:
CTRL_IFACE: response handle field=PIN
EAPOL: received control response (user input) notification - retrying pending EAP Request
indicating that the PIN has been successfully provided to wpa_supplicant

Change-Id: I91bc3ddd01a335f93d20cca4d47ca497bd631ebe
Reviewed-on: https://chromium-review.googlesource.com/174180
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Commit-Queue: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/service.h
2da34c038933eeac36a85550ff54e09611a1d828 18-Oct-2013 Paul Stewart <pstew@chromium.org> shill: Service: Remove "Favorite" property

We bid farewell to the much misunderstood and maligned "Favorite"
property. Chrome doesn't use this property and although it did
not fall into disuse in shill, it was misused for the purpose of
tracking whether the "auto_connect" property should be modified
on a successful connection. This CL renames the property and its
accessors more intuitively. We will no longer export and emit
property change events for this property.

While here, remove "Favorite" from the properties used to compare
services for sorting. Replace it with a test for HasEverConnected.

BUG=chromium:308754
TEST=Unit tests

Change-Id: I577849cbcff2758b02e65516eafc3f9e5c20e888
Reviewed-on: https://chromium-review.googlesource.com/173631
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
Commit-Queue: David James <davidjames@chromium.org>
/system/connectivity/shill/service.h
43d8dc054417ea59a2c6507965196d5f46012f72 17-Oct-2013 Paul Stewart <pstew@chromium.org> shill: Service: Add an explict "Clear" method for AutoConnect

If the AutoConnect property is cleared, we should also clear the
state indicating that it is set.

BUG=chromium:307692
TEST=Unit test

Change-Id: Iad47c6df401ce851288333b50681944f589ffc99
Reviewed-on: https://chromium-review.googlesource.com/173630
Reviewed-by: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
Commit-Queue: David James <davidjames@chromium.org>
/system/connectivity/shill/service.h
e37ad321159eb4d7898c1a2f4a64f14f9fc32e15 09-Oct-2013 mukesh agrawal <quiche@chromium.org> shill: use serial_number_ for tie breaker when sorting Services

We were previously using a string comparison of unique_name(),
which led to unexpectedly ordering service 10 before service 2.

While there, I made some additional changes to manager_unittest:
- removed a work-around for the bad sorting
- added some comments to existing tests
- fixed a bug in the IsFailed subcase of the SortServices test

BUG=chromium:269023
TEST=unit tests

Change-Id: Ie7d942baee25f7fbe4c851a2f5a55ff0dce20f2d
Reviewed-on: https://chromium-review.googlesource.com/172303
Reviewed-by: Paul Stewart <pstew@chromium.org>
Commit-Queue: mukesh agrawal <quiche@chromium.org>
Tested-by: mukesh agrawal <quiche@chromium.org>
/system/connectivity/shill/service.h
c539123120725dedc9055ec0b4171215946ac307 24-Sep-2013 Arman Uguray <armansito@chromium.org> shill: cellular: Update storage identifier based on SID for CDMA.

BUG=chromium:297396
TEST=Build and run unit tests.

Change-Id: Id463eb819b2778a91945eb9987532bb338ebdbbc
Reviewed-on: https://chromium-review.googlesource.com/170422
Reviewed-by: Ben Chan <benchan@chromium.org>
Tested-by: Arman Uguray <armansito@chromium.org>
Commit-Queue: Arman Uguray <armansito@chromium.org>
/system/connectivity/shill/service.h
923a5025a5e1138b052cbeffa60ea387d479696f 20-Sep-2013 Ben Chan <benchan@chromium.org> shill: Deprecate flimflam namespace.

CL:170123 moves all DBus service constants from the flimflam namespace
to the shill namespace. This CL removes the use of the flimflam
namespace in device, manager, metrics, service and technology code.

BUG=chromium:295425
CQ-DEPEND=CL:170123
TEST=Unit tests and trybot runs on release builders.

Change-Id: Ic9a853cbb623ec7e996dfc7590039dbe2d245db9
Reviewed-on: https://chromium-review.googlesource.com/170205
Reviewed-by: Paul Stewart <pstew@chromium.org>
Tested-by: Ben Chan <benchan@chromium.org>
Commit-Queue: Ben Chan <benchan@chromium.org>
/system/connectivity/shill/service.h
d47738866711ed29c04a82647d9acb7b8a668924 15-Aug-2013 mukesh agrawal <quiche@chromium.org> shill: dongles: don't retry connect after PPP auth failure

An earlier CL for chromium:246451 fixes a problem where we might not
reconnect after a PPP failure. However, that changes the behavior
for the authentication failure case. Whereas we would previously
not reconnect in that case (just as in any other case), we now try
reconnecting.

Automatically reconnecting after an authentication failure doesn't
make sense, since we expect the same result on the next attempt.
Fix this by having CellularServices return false for IsAutoConnectable,
when in this state.

The user should change the PPP credentials, and then initiate a connection
manually.

While there: remove an unused declaration in service.h.

BUG=chromium:246451
TEST=unit test, manual (pending)

Manual test
-----------
- stop shill
- rm /var/cache/shill/default.profile
- rm /var/run/shill/user_profiles/chronos/shill.profile
- start shill
- plug in dongle that requires a ppp username and password
- watch connection fail, with notification about PPP credential failure
- wait (e.g. 10 seconds), verify that shill does not retry connecting
- configure correct username and password
- select cellular network from ash tray
- verify that we connect to the network
- suspend + resume
- verify that we reconnect to the network

Change-Id: I92b3b9048af33731c289f1f1d29e125a557a496a
Reviewed-on: https://chromium-review.googlesource.com/65919
Reviewed-by: Ben Chan <benchan@chromium.org>
Commit-Queue: Ben Chan <benchan@chromium.org>
Tested-by: Ben Chan <benchan@chromium.org>
/system/connectivity/shill/service.h
6cfe53faf6c6406e1f7695bdbec26c38e9dd1553 13-Aug-2013 mukesh agrawal <quiche@chromium.org> shill: fix Network.Shill.Wifi.TimeToJoin metric

The Network.Shill.Wifi.TimeToJoin metric was not being collected, due
to subtleties of how it was supposed to be hooked in to Metrics. So
fix it.

More specifically, What's supposed to happen is this:

Metrics::RegisterService
-> WiFiService::InitializeCustomMetrics // overrides base class impl
-> Metrics::AddServiceStateTransitionTimer(...)

The problem was that Metrics::RegisterService is called from
Service::Service. Thus, at the time that Metrics::RegisterService is called,
we only have a Service object, not a WiFiService object. Consequently, the
virtual method call from Manager::RegisterService resolves to the base class
implementation of InitializeCustomMetrics, which has an empty body.

To fix this, we make InitializeCustomMetrics a non-virtual method (it
only had a meaningful implementation in WiFiService, anyway), and call
it explicitly from the WiFiService ctor, rather than implicitly via
Metrics::RegisterService.

While there:
- Remove RegisterService calls in MetricsTests. These are both
unnecessary, and actively harmful. The harm comes from the fact
that the explicit call to RegisterService in the unit tests overrides
the effect of the RegisterService in the Service.

In the case of WiFiService, this meant calling the derived-class
implementation of InitializeCustomMetrics. That meant the test passed,
but only because it did not reflect actual program behavior.
- Log a WARNING if a Service is re-registered with Metrics (without an
intervening call to DeregisterService).
- Remove unused |service| field of ServiceMetrics.
- Add parenthesis to ctor invocation in Metrics::RegisterService. I
believe the fields are non-POD, and initialized either way (with or
without parentheses). But it seems clearer to use the parentheses,
since we want the fields initialized.
- Fix whitespace issue in WiFiService::InitializeCustomMetrics.
- Tweak log message in service.cc.

BUG=chromium:268058
TEST=new unit test, manual

Manual testing
--------------
1. boot system
2. connect to wifi
3. open chrome://histograms
4. find that Network.Shill.Wifi.TimeToJoin exists, and has at least one sample

Change-Id: Icd925148415ea30fb63709bf034e63b8930c179c
Reviewed-on: https://gerrit.chromium.org/gerrit/65739
Tested-by: mukesh agrawal <quiche@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Commit-Queue: mukesh agrawal <quiche@chromium.org>
/system/connectivity/shill/service.h
c3dbff129c978e573d387aeb4685045851623e6d 17-Jul-2013 Paul Stewart <pstew@chromium.org> shill: Service: Clear optionally saved parameters on Load()

There are some values that are not saved to a profile entry
(explicitly removed) in Service::Save if they are currently
the default value. When loading from a Profile, reset these
properties if the profile property does not exist.

BUG=chromium:261211
TEST=New unit tests

Change-Id: Ia6d847f30fade2ed54ed007ad847c1426560a795
Reviewed-on: https://gerrit.chromium.org/gerrit/62372
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Commit-Queue: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/service.h
ee6b3d7f9d49fa52072a352fbb59f06127b1ba4c 13-Jul-2013 Paul Stewart <pstew@chromium.org> shill: Map crosbugs to their crbug equivalent

This makes things more consistent with the current issue URLs.

BUG=chromium:260016
TEST=Unit tests;
sed -i $(for crosbug in $(grep 'crosbug.com/[0-9]' *.cc *.h | sed -e 's#.*crosbug.com/\([0-9]*\).*#\1#' | sort | uniq); do crbug=$(curl -s "https://code.google.com/p/chromium-os/issues/detail?id=$crosbug" | grep HREF | sed -e 's/.*id=\([0-9]*\).*/\1/'); echo "-e s#crosbug.com/$crosbug#crbug.com/$crbug#"; done) *.cc *.h

Change-Id: I28e31c6c30186dd2a7cd1b36a170c33c2797d97f
Reviewed-on: https://gerrit.chromium.org/gerrit/61794
Commit-Queue: Paul Stewart <pstew@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/service.h
bca08f806803aa8f78dc563c9d1a3acf8e1ebe97 10-Jul-2013 Paul Stewart <pstew@chromium.org> shill: WiFiService: Track successive WPA/EAP auth failures

When a WiFi association fails during 802.1x EAP authentication or
WPA 4-way handshake, track these in in the WiFi Service in a manner
that will allow us to detect multiple consecutive failures. When
a number of such failures occur, signal the service's failure in a
similar manner to an initial authentication failure with no prior
successful connections. This will signal the UI to notify the user
that their credentials might no longer be valid.

This counter is non-persistent (not stored to the profile) and
orthogonal to other facilities like connection throttling and
the PassphraseRequired property, since it is only meant as a
heuristic signal to Chrome.

BUG=chromium:217033
TEST=Unit tests

Change-Id: I9c2df6770e643162ae0e7b5e03b2b857f4773b37
Reviewed-on: https://gerrit.chromium.org/gerrit/61355
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Commit-Queue: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/service.h
af471414b5ccb0dfbfd030e7baffd55dfdf51fe7 27-Jun-2013 Thieu Le <thieule@chromium.org> shill: Only reset service state before connect if it had failed priorly.

BUG=chromium:213956
TEST=New unit tests, network_3GSafetyDance

Change-Id: I1227cd00df9105606d8056ca5b6bb5e2882a4f6f
Reviewed-on: https://gerrit.chromium.org/gerrit/60263
Reviewed-by: Arman Uguray <armansito@chromium.org>
Commit-Queue: Thieu Le <thieule@chromium.org>
Tested-by: Thieu Le <thieule@chromium.org>
/system/connectivity/shill/service.h
cb094351820824cade9a2bf914f211e3298b4f7d 09-May-2013 Wade Guthrie <wdg@chromium.org> shill: Removes unused Service::kStateDisconnected.

Not used; doesn't belong in our code.

BUG=None
TEST=unittest

Change-Id: I2a54667737a7d226faedd4ee83f27888c464d7d7
Reviewed-on: https://gerrit.chromium.org/gerrit/50502
Reviewed-by: Paul Stewart <pstew@chromium.org>
Commit-Queue: Wade Guthrie <wdg@chromium.org>
Reviewed-by: Wade Guthrie <wdg@chromium.org>
Tested-by: Wade Guthrie <wdg@chromium.org>
/system/connectivity/shill/service.h
bebf1b8bce52b88c2cc2d93200b9405f9c19cf21 24-Apr-2013 mukesh agrawal <quiche@chromium.org> shill: make setting a property to its current value a no-op

Before this change, setting the EAP authentication properties
on a WiFiService would cause the connection to be dropped.
The connection would drop even if the new values were the same
as the old.

With this change, the connection is only dropped if the new
values differ from the old.

Overview of changes:
- AccessorInterface: have property setters return a bool (rather
than void). Setters should return true to indicate the value was
changed, and false otherwise.
- PropertyAccessor and derived classes:
- Implement the new AccessorInterface.
- Add tests that we implement the new AccessorInterface.
- Custom property setters (various classes):
- Update existing custom setters to return true if the value was
changed, and false otherwise.
- Add tests that custom setters implement the desired behavior.
- DBusAdaptor
- Change SetProperty to propagate the return value of
PropertyStore's setters, rather than Error::IsSuccess().
- In combination with other changes, this means
DBusAdaptor::SetProperty now returns false if the new value is
the same as the old.
- This also suppresses some spurious change notifications from
IPConfig, Manager, and Profile objects.
- Add tests that DBusAdaptor::SetProperty implements the desired
behavior.
- PropertyStore
- Add a change callback. This optional argument to the ctor is
invoked if a setter or clearer modified its property. This
is so that classes don't have to depend on their RPC adaptors
to inform them of a change. (See changes in Service.)
- Have setters pass through the return value of the Accessor,
rather than returning Error::IsSuccess(). In
combination with other changes, this means that setters
now returns false if the new value is the same as the old.
- Add tests that PropertyStore invokes the change callback
appropriately.
- ClearPropertyNonexistent, SetPropertyNonexistent: no callback
- ClearProperty: callback
- SetProperty: callback if and only if property changed
- Service
- Register OnPropertyChanged with PropertyStore, instead of relying
on a callback from ServiceDBusAdaptor. Two reasons for the change:
1) The RPC adaptors should be as trivial as possible, and
2) We can't test code in the RPC adaptors.
3) If we can't test code in the RPC adaptors, go to 1.
- ServiceDBusAdaptor: remove OnPropertyChange callback in SetProperty.
See Service for the rationale.
- Update existing SetProperty tests (various classes)
We now use values that differ from the current value of the property.
This ensures that the setter returns true.
- WiFiServiceTest: add a case to test that EAP authentication property
changes caused cached credentials to be cleared appropriately. This is
redundant given some of the other tests. But given that this was the
original problem in the bug, it seems worth testing specifically.
- HACKING: add some guidelines for what to do when adding properties.

While there:
- Change some HelpRegister... functions to HelpRegisterConst...
- Update some tests to check error.is_set() before reading
error.name(). This avoids a stray pointer dereference.
- Add SetStringmapsProperty to PropertyStore. This is needed because
PropertyStoreTypedTest now tests setters.
- Remove duplicate kAutoConnectProperty test case in ServiceTest.SetProperty
- Remove unused local in WiFiServiceTest.SetPassphraseRemovedCachedCredentials
- Remove unused method Device::HelpRegisterDerivedStrings
- Remove KeyValueStore from the set of types exercised by
PropertyStoreTypedTest. We only use KeyValueStore for const
properties, and PropertyStoreTypedTest tests setting and
clearing.
- Add PropertyChanges test to EthernetEapServiceTest.
BUG=chromium:233681
TEST=new unit tests

Change-Id: I9bdd89fbe6f19101dfcd5f126f2ba9c81533ff97
Reviewed-on: https://gerrit.chromium.org/gerrit/49733
Commit-Queue: mukesh agrawal <quiche@chromium.org>
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Tested-by: mukesh agrawal <quiche@chromium.org>
/system/connectivity/shill/service.h
967eaebb63aac3b9679dc4b2dca0565292e3af03 26-Apr-2013 Paul Stewart <pstew@chromium.org> shill: Service: Return profile entries that can configure

Add a Service DBus method that can provide the set of
(profile, entry) pairs that contain configuration for the
Service. This can be used to figure out what profile
entries other than the one currently associated with the
service contain configuration entries relevant to this
service.

BUG=chromium:235674
TEST=Unit tests + manual: call GetLoadableProfileEntries
on a remembered service from python returns something like:
dbus.Dictionary({dbus.ObjectPath('/profile/default'): dbus.String(u'wifi_any_beef_managed_psk')}, signature=dbus.Signature('os'))

Change-Id: Id94f98b98e5cb5c98c32c765e707125f53dae2d9
Reviewed-on: https://gerrit.chromium.org/gerrit/49279
Commit-Queue: Paul Stewart <pstew@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/service.h
e7de2942df36080268c1f296b40e28480479187c 26-Apr-2013 Paul Stewart <pstew@chromium.org> shill: Service: Return loadable service identifier

Add a Service method which returns the storage identifier from
a given StorageInterface which could be used to configure this
service. Override this method for WiFiService since it uses
a different method than default to decide a loadable profile
entry.

BUG=chromium:235674
TEST=Unit tests

Change-Id: I6d1bc3cc7e472d3598ac9299b3d76d33820ce0fe
Reviewed-on: https://gerrit.chromium.org/gerrit/49269
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Commit-Queue: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/service.h
cbfb34e699532f62eb5b381d0ea3a15d39e00b7c 18-Apr-2013 mukesh agrawal <quiche@chromium.org> shill: Emit more property change notifications for Services.

Add property change notifications for all the Service properties that
Chrome currently pays attention to. Also add unit tests for these
property change notifications.

While there:
- add some more tips to TESTING
- update service-api documentation for AutoConnect
(it is settable for non-favorite services, and has been for
some time)
- update some ServiceTests to no longer set_favorite before
changing AutoConnect (set_favorite is no longer necessary,
as noted above)
- clarify service-api documentation for Device property
- make the security_ field of WiFiService const (it is only
set in the ctor, and designating it const makes it obvious
why there's no property change for it)
- fix bug where VPNService would change the Favorite property,
but not signal the change

BUG=chromium:230329
TEST=new unit tests

Change-Id: Ia387b1ab90fa80fd218cd69e0fd8126ff4c5a2ae
Reviewed-on: https://gerrit.chromium.org/gerrit/48459
Reviewed-by: Paul Stewart <pstew@chromium.org>
Commit-Queue: mukesh agrawal <quiche@chromium.org>
Tested-by: mukesh agrawal <quiche@chromium.org>
/system/connectivity/shill/service.h
be9abfd46f85280d2139d635190f72b792eb3efa 22-Apr-2013 Paul Stewart <pstew@chromium.org> shill: Ethernet: Send EAPOL logoff and logon

Use newly created "EAPLogoff" and "EAPLogon" commands in
wpa_supplicant to de-authenticate and speed authentication
on 802.1x wired networks respectively. Add small fixes to
make sure that logoff happens during "Unload" and eap
credential changes.

CQ-DEPEND=CL:48803
BUG=chromium:234290
TEST=New unit tests. Modified autotest
network_8021xWiredAuthentication tests logoff/logon using
profile pop/push (see https://gerrit.chromium.org/gerrit/48806).

Change-Id: Ic9f6e74371e7f57bd3f28b1a68be5fc603da0fdd
Reviewed-on: https://gerrit.chromium.org/gerrit/48802
Reviewed-by: Christopher Wiley <wiley@chromium.org>
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
Commit-Queue: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/service.h
9dd253ea215bd0d11be2038050c2d77217042e36 22-Apr-2013 Paul Stewart <pstew@chromium.org> shill: ManagerTest: Reset Service::serial_number_

Some Manager unit tests make implicit assumptions that services sorted
by no other means will be sorted sequentially based on the order they
were created. This depends on the string-wise comparison between the
"unique_name" property which is generated from a monotonically
increasing integer Service::serial_number_. Depending on how many
services were created in previous unit tests, we may, for example
instantiate "99" and "100", which will cause this sorting assumption
to break. Since this sorting property is of no consequence in normal
operation, fix this by setting an explicit serial number during
manager unit tests.

BUG=None
TEST=Run unit tests

Change-Id: I8eac4a4d2949f1743154407c9cf8feb3bee752fe
Reviewed-on: https://gerrit.chromium.org/gerrit/48801
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Commit-Queue: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/service.h
35eff134fd95fdf1918803c4966f8b790914b3d4 12-Apr-2013 Paul Stewart <pstew@chromium.org> shill: Ethernet: Create shared credentials provider

Share a single service instance for all Ethernet devices to use
for EAP credentials. This service instance is only used for EAP
authentication, so other parameters such as Static IP paramters
are still retrieved from the per-device Ethernet service. Provide
a method for all Ethernet devices connected to an EAP
authenticator to be notified when the EAP credentials for this
shared service have been changed. Use both facilities in the
Ethernet device.

CQ-DEPEND=CL:48162
BUG=chromium:227433
TEST=New unit tests; revised version of network_8021xWiredAuthentication
(see co-dependent CL)

Change-Id: I5b19723dddfa2d793090128adb6429f31174b276
Reviewed-on: https://gerrit.chromium.org/gerrit/48138
Reviewed-by: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
Commit-Queue: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/service.h
c43cbbe5b33a7afe1b1250bef87fb8e9223cb764 11-Apr-2013 Paul Stewart <pstew@chromium.org> shill: EapCredentials: Promote to a class

Promote the EapCredentials structure to a sovereign class with
a small set of getters and setters where necessary. Otherwise,
move most of the member manipulation (creating arguments for
wpa_supplicant and wimax_manager, Load() and Save()) interior
to the class. This involves a straightforwarnd but lengthy
refactor of just about everything that uses EapCredentials.
The EapCredentials object is ref-counted to allow it to be
shared between some services. For this reason, move the
"remote_certification" property out of EapCredentials into
Service since this property is strictly per-service.

BUG=chromium:227434
TEST=Unit tests, wired 802.1x and wifi EAP-TLS autotests

Change-Id: I167e71e1d9c934bc328a0e1d73f638e1ff50d238
Reviewed-on: https://gerrit.chromium.org/gerrit/47973
Reviewed-by: Ben Chan <benchan@chromium.org>
Commit-Queue: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/service.h
9413bcc8c3576eeab8f232253264dce4347bbb0c 05-Apr-2013 Paul Stewart <pstew@chromium.org> shill: Ethernet: Authenticate to 802.1x networks

Instantate a Network instance in wpa_supplicant to perform
802.1x authentication, given the service EAP parameters if
an EAP authenticator is detected on the link and credentials
are available. Note that this is the only flow that is
supported with this change -- authenticating and
deauthenticating as credentials appear and disappear will
be supported in a follow-on CL.

CQ-DEPEND=CL:47403,CL:47428
BUG=chromium:224091
TEST=New autotest network_8021xWiredAuthentication
(https://gerrit.chromium.org/gerrit/47410)

Change-Id: I3feeceb02b15646130bf862f894a77c203fb9860
Reviewed-on: https://gerrit.chromium.org/gerrit/47411
Tested-by: Paul Stewart <pstew@chromium.org>
Commit-Queue: Paul Stewart <pstew@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/service.h
dc7b8447aa220fae51b73fd8610cbfed14ed57fc 27-Sep-2012 mukesh agrawal <quiche@chromium.org> shill: improve service logging

- In Service::Connect: log the unique name of the service
we're connecting to, as well as the function that triggered
the connect.
- In *Service: ensure all derived classes call into the
base class' Connect method.
- In Service::ThrottleFutureAutoConnects: clarify log message
- In Service::Disconnect: log the unique_name of the service
- In WiFi::BSSRemovedTask: log the affected service
- In WiFiService::Connect: don't attempt a connection if the
security parameter was unrecognized.
- In Service ctor: LogSSID of FriendlyName at INFO.

BUG=chromium:220496
TEST=unit tests

Change-Id: If254d081c7426dc6adff5aeab2c99122f6742efe
Reviewed-on: https://gerrit.chromium.org/gerrit/47510
Tested-by: mukesh agrawal <quiche@chromium.org>
Reviewed-by: Ben Chan <benchan@chromium.org>
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Commit-Queue: mukesh agrawal <quiche@chromium.org>
/system/connectivity/shill/service.h
9c6e9818cd1337ee06a218db83ee577ac977c7d9 26-Mar-2013 Darin Petkov <petkov@chromium.org> shill: vpn: Support Service.Name property change.

BUG=chromium:221577
TEST=Unit tests; Tested on device through configure-vpn; Also, tested
on device through corp policy and checked that the service got
renamed.

Change-Id: I936f85573e8d0820e2baa2361f94619e0e655f8f
Reviewed-on: https://gerrit.chromium.org/gerrit/46514
Reviewed-by: Darin Petkov <petkov@chromium.org>
Tested-by: Darin Petkov <petkov@chromium.org>
Commit-Queue: Darin Petkov <petkov@chromium.org>
/system/connectivity/shill/service.h
0654ece95920696c530ce1c0344365eb741f7efe 26-Mar-2013 Paul Stewart <pstew@chromium.org> shill: Move Populate8021xProperties() to wpa_supplicant

In anticipation of using wpa_supplicant in other places than WiFi,
allow 802.1x configuration for wpa_supplicant to be used in other
places than WiFi Services. This involves the following steps:

- Change shill:wpa_supplicant namespace into a shill::WPASupplicant
class. There's a lot of rote renaming as a result of this.

- Move the EAPCredentials struct out of Service, and into its own
top level. A few bits of renaming here too.

- Move Populate8021xProperties() out of WiFiService and into
a static method in WPASupplicant.

- Make a unit test for WPASupplicant and move the Populate* tests
from WiFiServiceTest into it.

BUG=chromium:224090
TEST=Unit tests, USE=clang FEATURES=test emerge-lumpy shill,
amd64-generic-asan trybot

Change-Id: Icdd5316d77a13e75c3ae164ace02508d00933131
Reviewed-on: https://gerrit.chromium.org/gerrit/46679
Reviewed-by: Christopher Wiley <wiley@chromium.org>
Tested-by: Christopher Wiley <wiley@chromium.org>
Commit-Queue: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/service.h
074bad634b98aaa9afbd00d22f0f2a3ca404669b 27-Mar-2013 Dave Parker <dparker@chromium.org> Revert "shill: Move Populate8021xProperties() to wpa_supplicant"

This reverts commit 8e0c5979b7ae8ac69f290c3bee8d2b6c6252eb3b

Suspected of build breakage on "amd64 generic ASAN"
http://build.chromium.org/p/chromiumos/builders/amd64%20generic%20ASAN/builds/4587/steps/BuildTarget/logs/stdio

Change-Id: I7de7cf2d26652d99a4e62cc6dc06ece3ada1b60c
Reviewed-on: https://gerrit.chromium.org/gerrit/46667
Reviewed-by: Dave Parker <dparker@chromium.org>
Tested-by: Dave Parker <dparker@chromium.org>
/system/connectivity/shill/service.h
8e0c5979b7ae8ac69f290c3bee8d2b6c6252eb3b 26-Mar-2013 Paul Stewart <pstew@chromium.org> shill: Move Populate8021xProperties() to wpa_supplicant

In anticipation of using wpa_supplicant in other places than WiFi,
allow 802.1x configuration for wpa_supplicant to be used in other
places than WiFi Services. This involves the following steps:

- Change shill:wpa_supplicant namespace into a shill::WPASupplicant
class. There's a lot of rote renaming as a result of this.

- Move the EAPCredentials struct out of Service, and into its own
top level. A few bits of renaming here too.

- Move Populate8021xProperties() out of WiFiService and into
a static method in WPASupplicant.

- Make a unit test for WPASupplicant and move the Populate* tests
from WiFiServiceTest into it.

BUG=chromium:224090
TEST=Unit tests

Change-Id: If229d7de117d41a6606ac87c795791a7921cdf42
Reviewed-on: https://gerrit.chromium.org/gerrit/46567
Commit-Queue: Paul Stewart <pstew@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/service.h
1c049c794175356e5b6c2b6bbb5ef4a12fbfe9a3 21-Mar-2013 Darin Petkov <petkov@chromium.org> shill: openvpn: Detect and flag DNS resolution errors.

BUG=chromium:196348
TEST=unit tests; tested on device by trying to connect to an unknown
openpvn server; verified corp OpenVPN connectivity.

Change-Id: I014dcbb37553941c56ad8f2ce01ccb225b1a6128
Reviewed-on: https://gerrit.chromium.org/gerrit/46125
Tested-by: Darin Petkov <petkov@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Commit-Queue: Darin Petkov <petkov@chromium.org>
/system/connectivity/shill/service.h
39db5caaa3d07c3af9c575affcbb7313536de91d 18-Mar-2013 Paul Stewart <pstew@chromium.org> shill: Manager: Add method to explicitly connect to "best" services

Add a method that evaluates the best connectable services
independent of their current connectivity state, and connects
the best service for each technology type. This method will
only connect services that have their "auto-connect" property
set, and will only connect non-primary services (VPN) if the
system is already online.

BUG=chromium-os:39739
TEST=Unit test

Change-Id: I6bdd0504cccfcb7a8e66fe8fb2e33aa480b21fe0
Reviewed-on: https://gerrit.chromium.org/gerrit/45781
Reviewed-by: Darin Petkov <petkov@chromium.org>
Commit-Queue: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/service.h
5baebb73bd597f5896b43d38e8ed3447680f47f4 14-Mar-2013 Paul Stewart <pstew@chromium.org> shill: Support raw PEM data for CA Certificates

For all connection types that support CA Certificates (L2TP-IPSec,
OpenVPN, 802.1x WiFi) support a Service property that contains the
raw contents of the PEM certificate to be used in authenticating
the remote entity.

BUG=chromium-os:39685
TEST=Unit tests; Manual: Set the EAP.CACertPEM property on a
service and ensure that the data is stored and retrieved from
the profile correctly with newlines intact.

Change-Id: I4adc850dbb38a8b9afb55fc40260d67bcaa33485
Reviewed-on: https://gerrit.chromium.org/gerrit/45642
Commit-Queue: Paul Stewart <pstew@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/service.h
85d5317bed668c1fb0e4225de614c7b386e3de25 13-Mar-2013 Darin Petkov <petkov@chromium.org> shill: l2tp/ipsec: Expose exit/error codes as UI failure reasons.

BUG=chromium-os:32877
TEST=unit tests; tested on device by setting up an L2TP/IPSec service
with an invalid hostname, trying to connect to it and observing a "DNS
lookup failed" error message in Chrome.

CQ-DEPEND=I4a123326487f9fe8e194c360f91589a755ca3a70
CQ-DEPEND=If06f059320e7556a93ac8b229bd0750f45b33da1

Change-Id: Iacb903573da6a5f0a3d1d9a5783907d8fb270661
Reviewed-on: https://gerrit.chromium.org/gerrit/45313
Tested-by: Darin Petkov <petkov@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Commit-Queue: Darin Petkov <petkov@chromium.org>
/system/connectivity/shill/service.h
0e1cdeae24dd678a5fe27c840802582c0ca45ec0 28-Feb-2013 Albert Chaulk <achaulk@chromium.org> shill: Implement Service.Remove & delete DHCP leases

Implement the Service.Remove dbus API and modify the unload sequence to
remove the DHCP lease file. Add unit tests to DHCPProvider & WiFiService to
check lease file deletion. Currently only WiFi does the DHCP lease delete
from DBus - WiMax/Cell/VPN do their own things for IP configuration and
Ethernet can't be removed as per the API spec.

Also make sure FilePath is qualified as base::FilePath throughout the project.

BUG=chromium-os:32756
TEST=added unittests to test the call path on Unload() to delete the lease file

Change-Id: Ic6eee17b9d81cd0be8d09c683d85d6a4d19278c9
Reviewed-on: https://gerrit.chromium.org/gerrit/44339
Tested-by: Albert Chaulk <achaulk@chromium.org>
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Commit-Queue: Albert Chaulk <achaulk@chromium.org>
/system/connectivity/shill/service.h
aba893217c9cf1dd0d39c4dee89a23d3b1a3f4c1 11-Mar-2013 Darin Petkov <petkov@chromium.org> shill: openvpn: Expose server-provided authentication failure reasons.

The failure reason is obtained from openvpn through the management API
and set on Service's ErrorDetails property.

BUG=chromium-os:31410
TEST=unit tests; tested on device by trying to connect to corp OpenVPN
with wrong OTP, then through list-services ensured service state is
set to Failure and ErrorDetails is set to 'Invalid password/OTP.';
connected and disconnected from OpenVPN, ensured the service state is
set to Idle with empty ErrorDetails.
CQ-DEPEND=I8a481be6b4c13cb5ca232d5e65b9a20e977ce5c0

Change-Id: I827e88d95801dfdbac202e3c4a53373b9567dabd
Reviewed-on: https://gerrit.chromium.org/gerrit/45070
Tested-by: Darin Petkov <petkov@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Commit-Queue: Darin Petkov <petkov@chromium.org>
/system/connectivity/shill/service.h
0fec81c24484638bb50c0e57cf7e572fbe4f642b 28-Feb-2013 Liam McLoughlin <lmcloughlin@chromium.org> Fix CellularCapabilityUniversalMainTest.UpdateStorageIdentifier on Clang

Also disabled CellularTest.ConnectAddsTerminationAction on Clang for now
since it crashes (bug: crosbug.com/39351)

BUG=chromium-os:28749, chromium-os:30434, chromium-os:39351
TEST=Run USE="clang asan" FEATURES="test" emerge-amd64-generic -v shill
Run USE="clang asan" FEATURES="test" emerge-x86-generic -v shill

Change-Id: I223bf423a8f6585b76d1b9dd441c9b8b21fbcb5a
Reviewed-on: https://gerrit.chromium.org/gerrit/44276
Commit-Queue: Liam McLoughlin <lmcloughlin@chromium.org>
Reviewed-by: Liam McLoughlin <lmcloughlin@chromium.org>
Tested-by: Liam McLoughlin <lmcloughlin@chromium.org>
/system/connectivity/shill/service.h
43970a2573b7c8fea9f4c2010e7bef7785ca0e82 16-Feb-2013 mukesh agrawal <quiche@chromium.org> shill: implement security_levels

When multiple Services are connectable, we should try the most
secure Service first. This CL provides the requisite plumbing
in the Service base class, and uses the plumbing in WiFiService.
Technologies other than WiFi are not addressed.

BUG=chromium-os:35128
TEST=new unit tests

Change-Id: I120ca9094cb3a4b6dcefd46695c2dd36cab72a84
Reviewed-on: https://gerrit.chromium.org/gerrit/43452
Tested-by: mukesh agrawal <quiche@chromium.org>
Reviewed-by: Wade Guthrie <wdg@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Commit-Queue: mukesh agrawal <quiche@chromium.org>
/system/connectivity/shill/service.h
5d924544cf3bd1da5dff3204ca645f52427a6ff8 15-Feb-2013 Ben Chan <benchan@chromium.org> shill: Add a 'CompleteCellularActivation' DBus method to Service interface.

BUG=chromium-os:38974
TEST=Build and run unit tests.

Change-Id: Idc18916b950de1a0f1fdff51de2dd252efe63fe0
Reviewed-on: https://gerrit.chromium.org/gerrit/43372
Reviewed-by: Darin Petkov <petkov@chromium.org>
Commit-Queue: Ben Chan <benchan@chromium.org>
Tested-by: Ben Chan <benchan@chromium.org>
/system/connectivity/shill/service.h
3c5040174273386868cc8dea8044d22c465885d8 18-Jan-2013 Paul Stewart <pstew@chromium.org> shill: WiFiProvider: Move Service vector to WiFiProvider

Remove the services_ vector from the WiFi Device and move it
to the WiFiProvider. Also remove the WiFi device initializer
from the WiFiService, so it doesn't have an early or permanent
binding to a particular device. This allows WiFi services to
be loaded immediately as a profile loads, so that operations
that operate on services (like Manager::ConfigureService
and Manager::FindMatchingService) do not need to use a separate
API to find and modify services that are not visible but have
stored configuration associated with them.

This also allows Chrome a somewhat more stabilized service
path to remembered services as they appear and disappear from
view. Another advantage is that this completely regularizes
the relationship between the presence of the service in the
provider's services_ list and its registration with the
manager.

In order to perform late-binding to a WiFi device, we provide
two methods for WiFi services to find a device to call
WiFi::ConnectTo on when the time comes: Firstly, visible
WiFi services (ones with endpoints) can select the device
associated with the most "promising" endpoint. In the case
where we try to connect to a hidden WiFi service before
endpoints appear for it, there is a new method for selecting
a WiFi device from the Manager. In both of these cases only
one WiFi device is selected for the connect request, so this
method is no worse than before in the unlikely case where
there are two WiFi devices, except for the fact that now
there won't be duplicate WiFi services registered in the
Manager.

CQ-DEPEND=Ic8af4999b25503c3b002504edd12405dc91cc824
BUG=chromium-os:38017
TEST=Unit tests; manual operation; manager unit tests, WiFiManager
autotests (profile tests failing due to crosbug.com/35374)

Change-Id: I904df8a983ba6e7e76e20159622c652675eb6a7d
Reviewed-on: https://gerrit.chromium.org/gerrit/41664
Commit-Queue: Paul Stewart <pstew@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/service.h
2717a10096e12e46413adf47b39c5b19cd33bce7 30-Jan-2013 Arman Uguray <armansito@chromium.org> shill: Update cellular service name, if modem reports a new name.

CellularCapabilityUniversal now updates the cellular service's
|friendly_name_| field when new carrier related information is either
read from the SIM or updated OTA. For the duration of time in which no
valid carrier information is available, the service will be assigned a
generic name as before.

BUG=chrome-os-partner:17310
TEST=1. Build and run unit tests.
2. Use pseudomodem to generate changes in the OperatorName property
of interface org.freedesktop.ModemManager1.Modem.Modem3gpp.
Observe that the UI updates appropriately.

Change-Id: I5b2813731173e8329d191889d4dc58905a6f9e8e
Reviewed-on: https://gerrit.chromium.org/gerrit/42294
Commit-Queue: Arman Uguray <armansito@chromium.org>
Reviewed-by: Arman Uguray <armansito@chromium.org>
Tested-by: Arman Uguray <armansito@chromium.org>
/system/connectivity/shill/service.h
4cbff5b5897593f7a2e6de48a98abe72356075af 29-Jan-2013 Darin Petkov <petkov@chromium.org> shill: vpn: Auto-connect at most one service at a time, only when online.

This patch suppresses auto-connect for non-primary technologies (such
as VPN) while the system is offline. Also, don't auto-connect a VPN
service if there's already an active (connecting or connected) VPN
service.

Cleanup Manager's online/offline API a bit.

BUG=chromium-os:38229
TEST=unit tests

Change-Id: Iedd3879cf45c8b509a956415c7de5e5ba1af4652
Reviewed-on: https://gerrit.chromium.org/gerrit/42226
Tested-by: Darin Petkov <petkov@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Commit-Queue: Darin Petkov <petkov@chromium.org>
/system/connectivity/shill/service.h
c8d91e54873d3490e01d9aa5dac83e7bd9192ff0 21-Jan-2013 Darin Petkov <petkov@chromium.org> shill: Note connectivity failures even when going through Idle.

Some services may go from a connecting/connected state to idle before
going to failure. This patch ensures that such transitions are counted
as connectivity failures -- they used to be ignored.

BUG=chromium-os:37930,chromium-os:37445
TEST=unit tests; connect to an WPA-PSK AP with wrong password and
observe a non-empty Diagnostics.Misconnects property for the service
through list-services

Change-Id: I5f520722aa23427d2bd7b8719689d1215d89beef
Reviewed-on: https://gerrit.chromium.org/gerrit/41710
Reviewed-by: Paul Stewart <pstew@chromium.org>
Tested-by: Darin Petkov <petkov@chromium.org>
Commit-Queue: Darin Petkov <petkov@chromium.org>
/system/connectivity/shill/service.h
7a20aa492230e9e969c8853ad684be0c5b224479 17-Jan-2013 Paul Stewart <pstew@chromium.org> shill: Manager: Implement FindMatchingService

Find an in-memory Service given a dictionary of attributes. The
Manager will return the first Service that matches these attributes.
While here, fix an old bug where Service::Configure enumerated the
input uint32 arguments with the intention of configuring the
"Priority" property, except that "Priority" is an int32.

BUG=chromium-os:34525
TEST=Unit tests, manual using python script to call GetMatchingService
with a known service name

Change-Id: Ib093b257c4217796ae5aa13bf090c1234df70c7d
Reviewed-on: https://gerrit.chromium.org/gerrit/41554
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Commit-Queue: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/service.h
1369c2b482e97a18e8ecb63df04799696ebe39d6 11-Jan-2013 Paul Stewart <pstew@chromium.org> shill: WiFi: Catch more EAP authentication failures

Since we do not yet have a way to interactively request credentials
from the UI, it is an authentication failure if wpa_supplicant asks
for them. Also track whether we disconnect during EAP
authentication and treat this situation with a similar heuristic
to WPA networks disconnecting during 4-way handshake.

CQ-DEPEND=I80b6887fcfde1362ff5fc37ee25a8d8c7477e8d7
BUG=chromium-os:31466,chromium-os:37710
TEST=New unit tests, network_WiFiSecMat/072CheckWPA_1x_PEAP, ensuring
that connection fails-fast with eap-authentication-failure.
Manual: associate to PEAP network with EAP-TLS credentials and vice
versa -- make sure both attempts fail-fast with eap-authentication-failure.

Change-Id: I755740d92c9069552a00f657ff8562b13b377270
Reviewed-on: https://gerrit.chromium.org/gerrit/41126
Commit-Queue: Paul Stewart <pstew@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/service.h
457728b3eeb2d67c980e0d20675f0a0f750903e1 09-Jan-2013 Darin Petkov <petkov@chromium.org> shill: Log service's unique name rather than friendly name.

This way we consistently identify the service throughout shill's logs
as well as alleviate PII concerns due to SSIDs leaking into
logs. Renamed Service::UniqueName() to Service::unique_name(), per
style. Made Service::friendly_name() protected to limit its accidental
use.

BUG=chromium-os:37679
TEST=unit tests, tested on device and inspected logs

Change-Id: Idcdba75875a9d10cda51b714730ef633876481c6
Reviewed-on: https://gerrit.chromium.org/gerrit/40926
Tested-by: Darin Petkov <petkov@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Commit-Queue: Darin Petkov <petkov@chromium.org>
/system/connectivity/shill/service.h
a47c3c62552d33aa1f745097a5713c4f6f4cc325 18-Dec-2012 Paul Stewart <pstew@chromium.org> shill: WiFi: Enable WiFi debugging for persistent failures

If a service has recent connection failures, enable wpa_supplicant
debugging for the duration of any connection attempt to this
service.

BUG=chromium-os:36469
TEST=Unit tests + Manual: repeat failing connection attempt to
WPA-PSK AP with the wrong passphrase. Use command-line "wpa_debug"
command to note that during successive connection attempts
wpa_supplicant is set to the "debug" debugging level, and when the
system returns to an idle state it returns to the "info" debugging
level.

Change-Id: Ibef464fe0599f511a937c09a727c703ebdf1ebbf
Reviewed-on: https://gerrit.chromium.org/gerrit/39882
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Commit-Queue: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/service.h
483e4720a875953f07497fd59856156e212cac56 18-Dec-2012 Paul Stewart <pstew@chromium.org> shill: Service: Add public function to report dis/mis-connect

Add a boolean function to Service to report whether there are
disconnect or misconnect issues in recent history. This also
refactors the code that removes old / excessive issues from
the history.

BUG=chromium-os:36469
TEST=Modified unit test

Change-Id: I7ce8bf1ee34f7dab3629c4b9e9a12f85c7a8fc3f
Reviewed-on: https://gerrit.chromium.org/gerrit/39926
Commit-Ready: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/service.h
0c65bdd97e8dc59102b9e9f4e1f63245311cbdcd 05-Dec-2012 Darin Petkov <petkov@chromium.org> shill: Expose Service's disconnect and misconnect history as properties.

These history properties are exposed as real-time timestamps in the
same format as in logs. Also, replace use of timeval in history with a
Timestamp struct encapsulating monotonic and wall-clock times.

BUG=chromium-os:36924
TEST=lumpy and x86-alex unit tests; tested on device by dropping the
connection and list-services
CQ-DEPEND=I5e1852af18381995c30c5e1f356d3c2745c44d2f

Change-Id: Icb41077ab99262e236790fc30a11c26bccd90d43
Reviewed-on: https://gerrit.chromium.org/gerrit/39244
Commit-Ready: Darin Petkov <petkov@chromium.org>
Reviewed-by: Darin Petkov <petkov@chromium.org>
Tested-by: Darin Petkov <petkov@chromium.org>
/system/connectivity/shill/service.h
385b9bccbcdb5395e1fc8903a0f14cb6016b01c3 03-Dec-2012 Darin Petkov <petkov@chromium.org> shill: Detect connectivity failures: drops and connect attempts.

The base Service class monitors and keeps history of the service state
transitions. When a certain threshold of failures is reached within the
specified period of time, connectivity logs will be stashed away to be included
in feedback (or automatically uploaded).

BUG=chromium-os:35950,chromium-os:35953
TEST=unit tests

Change-Id: Id2c8b110eb1af14188eeda5f42084442671d5c9f
Reviewed-on: https://gerrit.chromium.org/gerrit/39078
Tested-by: Darin Petkov <petkov@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Commit-Ready: Darin Petkov <petkov@chromium.org>
/system/connectivity/shill/service.h
db0f917217979bf7547e27b47faf1b49d25c8d9c 01-Dec-2012 Paul Stewart <pstew@chromium.org> shill: WiFi: Emit WiFiService errors on EAP Failures

Do not wait for wpa_supplicant to timeout on EAP failures.
Instead, report EAP failures immediately by setting the
most specific failure possible on the service and disconnecting.
By doing so, this empowers the UI (and in turn the user) to
take appropriate action to correct the authentication problem.

CQ-DEPEND=Ifae8eeb45c1f9ef5a9f0406482a15c0c9adca12c
BUG=chromium-os:31466
TEST=Unit tests, network_WiFiSecMat/network_WiFiSecMat.073CheckWPA_1x_TTLS,
network_WiFiSecMat/network_WiFiSecMat.019CheckWPA_1x_AES, observing that
the service enters the Failed state and the error is set appropriately
to the cause of failure.

Change-Id: I1d019f3148c64ed41d173aeae0a91409eb73e906
Reviewed-on: https://gerrit.chromium.org/gerrit/39026
Reviewed-by: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
Commit-Ready: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/service.h
03c15ce0583d0c89bbd762b1140ace8d537c7625 30-Nov-2012 mukesh agrawal <quiche@chromium.org> shill: reduce logspam due to autoconnect

It's quite normal, and frequent, for an autoconnect request
(from the Manager, to a Service), to be supressed because
a) we're already connected to that Service, or
b) the Device needed by this Service is busy.

Reduce log-spam by logging those cases with SLOG at level 1,
rather than at LOG_INFO.

Checking a couple of the log files on one of my Chromebooks,
this would reduce the number of shill log lines by 7-8%.

While there: consolidate the kAutoConnConnected string into
Service. (It was previously defined independently in WiFiService
and WiMaxService.)

BUG=chromium-os:31143
TEST=unit tests

Change-Id: Ifc94e1357674999e65eb7b3ec98f6381ea59fc0d
Reviewed-on: https://gerrit.chromium.org/gerrit/38974
Reviewed-by: Paul Stewart <pstew@chromium.org>
Reviewed-by: Darin Petkov <petkov@chromium.org>
Commit-Ready: mukesh agrawal <quiche@chromium.org>
Tested-by: mukesh agrawal <quiche@chromium.org>
/system/connectivity/shill/service.h
c68c867905c985c0a703a7e2b575ecc091d14688 21-Nov-2012 Christopher Wiley <wiley@chromium.org> shill: Don't let WiFi scan during association or configuration

Don't let the UI trigger scans during association or configuration to
avoid missing frames while we're off channel. This fixes behavior where
we take a long time to connect to service (or fail completely) because
we essentially stop listening to the AP for a second or two.

BUG=chromium-os:36233
TEST=Unit tests

Change-Id: I5cd9c687209b13d6206930f55761ba355201ff82
Reviewed-on: https://gerrit.chromium.org/gerrit/38482
Commit-Ready: Christopher Wiley <wiley@chromium.org>
Reviewed-by: Christopher Wiley <wiley@chromium.org>
Tested-by: Christopher Wiley <wiley@chromium.org>
/system/connectivity/shill/service.h
7917360b71c6680de60b487b3630dc1a0f8cdca2 13-Nov-2012 Philipp Neubeck <pneubeck@chromium.org> shill: Add emits for proxy and profile properties.

Added emits for the properties:
- Service.ProxyConfig
- Service.Profile
- Manager.Profiles

These are required by Chrome to update Policies and Proxies correctly.

BUG=chromium:157642
TEST=None, adapted manager unit test to ignore emits.
Change-Id: Icba2b43804d1d69e3b93ef0b2f30606c8d6f9753
Reviewed-on: https://gerrit.chromium.org/gerrit/37935
Tested-by: Philipp Neubeck <pneubeck@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Reviewed-by: Darin Petkov <petkov@chromium.org>
Commit-Ready: Philipp Neubeck <pneubeck@chromium.org>
/system/connectivity/shill/service.h
df3c0a897bc74cb3a9800332b8359a364ca2f753 10-Nov-2012 Paul Stewart <pstew@chromium.org> shill: Service: Sort services based on dependency

If one connected service depends on another for connectivity,
it should be sorted first, overriding technology and priority
ordering. We evaluate this by using the "Lower binder" property
of the service's connection, which is currently the case for
VPNs connections to indicate what underlying link is used. It does
not make sense for a VPN service to be ranked at a lower priority
than its underlying technology, since the fact that it is connected
implies that the VPN is meant to be applied to it.

BUG=chromium-os:36231
TEST=Unit tests.

Change-Id: I74ee5d1213141db2c6a124ed44717c848a0e2701
Reviewed-on: https://gerrit.chromium.org/gerrit/37774
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Commit-Ready: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/service.h
19f83971a35d7f2c7b08aae6eb0abdc8e52ba057 04-Oct-2012 Ben Chan <benchan@chromium.org> shill: cellular: Suppress auto-connect when device is not running.

When a cellular device is being disabled, it may disconnect a
connected cellular service. However, shill may try to auto-connect the
service before the service is destroyed. To avoid such a race, this CL
makes a cellular service not auto-connectable when the cellular device
is not running.

BUG=chromium-os:34182
TEST=Tested the following:
1. Build and run unit tests.
2. After connecting to a cellular network, disable the cellular
technology and verify that shill does not try to auto-connect the
cellular service while the cellular device is being disabled.

Change-Id: I4ce18dfc416984c607976a183100779b645ebbcb
Reviewed-on: https://gerrit.chromium.org/gerrit/34497
Tested-by: Ben Chan <benchan@chromium.org>
Reviewed-by: Darin Petkov <petkov@chromium.org>
Commit-Ready: Ben Chan <benchan@chromium.org>
/system/connectivity/shill/service.h
abd3b50b0c3b6cde124892134091328d2b6dd5e3 26-Sep-2012 Christopher Wiley <wiley@chromium.org> shill: Disconnect a service on DHCP lease failure

Fix a bug where failing to acquire a DHCP lease would result in
permanent device offline state. This happens because marking a service
as disconnected doesn't work through any of the logic to trigger an
actual disconnect from the actually fully associated service. For
instance, in WiFi's case, this leaves the service associated in the
eye's of wifi.cc, but in some state outside of the typical state machine
for connecting services. Thus shill does nothing, leaving users to
wonder.

device.cc should ask the service to disconnect itself rather than
changing its state unbeknownst to the service. However, there does not
seem to be a path to disconnect a service without marking the disconnect
as user initiated. Create such a path. I've gone over the callsites
and looked for places where they might assume that the service won't be
autoconnected again, and not found problems on inspection. At worst,
we'll just be auto connecting some services we didn't used to. In some
places, like cellular, it seems like we Disconnect when we find we are
roaming, which doesn't seem like a permanent/non autoconnectable
offense.

TEST=Unit tests
BUG=chromium-os:32279

Change-Id: I34b60f3c009c276efac5d7e51495dc5681bf4b5f
Reviewed-on: https://gerrit.chromium.org/gerrit/34195
Commit-Ready: Christopher Wiley <wiley@chromium.org>
Reviewed-by: Christopher Wiley <wiley@chromium.org>
Tested-by: Christopher Wiley <wiley@chromium.org>
/system/connectivity/shill/service.h
0801d1962dae6af189858f5ab727b5cfc490726f 24-Sep-2012 Christopher Wiley <wiley@chromium.org> shill: Throttle AutoConnect calls

We occasionally run into issues where cellular services fail quickly
inside a Connect() call, leading to a cycle where shill calls Connect()
on the service, fails, tries another AutoConnect() on the state change
from Associating->Idle, and Connect() fails again. This leads to system
lockup as the CPU is consumed by our aggressive Connects().

Fix this by changing services to mark themselves as not able to
AutoConnect for a period of time after the last AutoConnect attempt.
The "cooldown" for a service to become auto-connectable exponentially
increases from one second to up to 30 minutes. The cooldown resets on
device suspend/resume, and any successful connection.

In addition to unit tests, tested with a modem in a bad state. The
device times out its connect call, and then the connect/connect failed
cycle begins. Observed that this cycle no longer consumes the CPU.

BUG=chromium-os:34548
TEST=Unit tests and as described above

Change-Id: I339a7b7f3b8f4c3d30ef110c2a09538afc4bad3b
Reviewed-on: https://gerrit.chromium.org/gerrit/33817
Commit-Ready: Christopher Wiley <wiley@chromium.org>
Reviewed-by: Christopher Wiley <wiley@chromium.org>
Tested-by: Christopher Wiley <wiley@chromium.org>
Reviewed-by: paul drews <paul.drews@intel.com>
/system/connectivity/shill/service.h
88769de74d877abb34190ee93e7539b46bd363ca 21-Sep-2012 Paul Stewart <pstew@chromium.org> shill: Service: Reset has_ever_connected on Unload()

This property should be removed if credentials have been reset
for this service. While we are at it, remove a couple of bool
fields that never amounted to anything. Add logic to test
has_ever_connected on both load and unload. While here test
that explicitly_disconnected is cleared on Load().

BUG=chromium-os:25226
TEST=Unit tests.

Change-Id: I20580c3f78cf05db90ac1b709ac946e6cb9b6241
Reviewed-on: https://gerrit.chromium.org/gerrit/33796
Commit-Ready: Paul Stewart <pstew@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/service.h
51e4a12ff6c6cde561491da712cab83ed63c49d9 09-Aug-2012 mukesh agrawal <quiche@chromium.org> shill: remove unused field in Connection class

BUG=None
TEST=unit tests

Change-Id: Ifefb59e1f07bde04555d4614e9b8a733d49a47d5
Reviewed-on: https://gerrit.chromium.org/gerrit/29768
Commit-Ready: mukesh agrawal <quiche@chromium.org>
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Tested-by: mukesh agrawal <quiche@chromium.org>
/system/connectivity/shill/service.h
cf199de9b7c813635b5247a1858a99ab1fc9e21b 16-Aug-2012 Paul Stewart <pstew@chromium.org> shill: EthernetService: Fix auto-connect-by-default

Fix a nasty typo which prevented EthernetService from overriding
the parent class IsAutoConnectByDefault. Add unit tests. Add
belt-and-suspenders by also overriding the SetAutoConnect RPC
settter to prevent AutoConnect from being set over the control
interface.

BUG=chromium-os:32709
TEST=Unit tests

Change-Id: I683333b915cb747ccb241512f66d2fb3f1efca3a
Reviewed-on: https://gerrit.chromium.org/gerrit/30557
Commit-Ready: Paul Stewart <pstew@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/service.h
def189ec3772bdc440b1c45c2b673122d3e2789e 03-Aug-2012 Paul Stewart <pstew@chromium.org> shill: Static IP: Save DHCP-supplied IP parameters

Before Static IP parameters are applied to an IPConfig, save
all DHCP-supplied parameters to corresponding "SavedIP.*"
values in the service. This way the UI can display:

* The current IP address confgured on the interface by
showing the IPConfig value.
* The current user-supplied static IP parameter by showing
the "StaticIP.*" parameter.
* The DHCP-supplied IP parameter by first checking for a
"SavedIP.*" parameter, failing that, using the IPConfig
parameter.

BUG=chromium-os:33223
TEST=New unit test + manual (set StaticIP.Address parameter,
reconnect, and confirm that both SavedIP.Address and StaticIP.Address
parameters are set on the service)

Change-Id: I6410b003bbdc63097a193cfb09881c862dcef5bd
Reviewed-on: https://gerrit.chromium.org/gerrit/29130
Commit-Ready: Paul Stewart <pstew@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/service.h
7fb0938c8485118e0b6684d5a696e58be7cf21c9 19-Jul-2012 Paul Stewart <pstew@chromium.org> shill: Service: Ethernet services should be auto-connect on unload

Create an overridable IsAutoConnectByDefault() method on services
so that the auto-connect-by-default property of Ethernet services
is more cleanly exported. In this way, in the unlikely scenario
where an Ethernet service is unloaded, it won't lose its autoconnect
property.

BUG=chromium-os:32709
TEST=Reran unit tests

Change-Id: I850aa10c226a2192640a8278e696c3667d8b7897
Reviewed-on: https://gerrit.chromium.org/gerrit/27843
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Reviewed-by: David James <davidjames@chromium.org>
Tested-by: David James <davidjames@chromium.org>
Commit-Ready: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/service.h
f2d609103916861ea8a9377ef93a72cc998bdf80 15-Jul-2012 Paul Stewart <pstew@chromium.org> shill: Service: Update RPC "Error" property on failure

When the service's failure_ enum is set, translate that into
the a string and set the DBus "Error" property so that Chrome
can display the error type as a service fails.

In order to do this, instead of using arbitrary strings, use
the string constants in service_constants.h, so that Chrome
can convert these to internationalized strings.

As part of this, realign a few of the items in the
ConnectFailure enum to match service_constants, while keeping
the same initial order so we don't mess up metrics.

BUG=chromium-os:23206
TEST=Changed unit tests, manual: connect to a non-existent hidden
network and observe "Out of range" as the error using dbus-monitor.
Also repro "Bad Passphrase" and "Out Of Range" scenarios and make
sure error mole displays the correct failure string.

Change-Id: I93f2116a101bd71a92c58ced0c80895a2091be93
Reviewed-on: https://gerrit.chromium.org/gerrit/27499
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
Commit-Ready: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/service.h
6b9b2e18088f22b79ea5d87f575b67632fb5770a 10-Jul-2012 Darin Petkov <petkov@chromium.org> shill: wimax: Autoconnect only one service per WiMAX device.

BUG=chrome-os-partner:11162
TEST=unit tests

Change-Id: Ie7a67035f2410f13c25991c57a955b76b71d791e
Reviewed-on: https://gerrit.chromium.org/gerrit/27169
Commit-Ready: Darin Petkov <petkov@chromium.org>
Reviewed-by: Darin Petkov <petkov@chromium.org>
Tested-by: Darin Petkov <petkov@chromium.org>
/system/connectivity/shill/service.h
58f0b6dbd71f52c3abdac91aed44024a35bc4898 12-Jun-2012 Darin Petkov <petkov@chromium.org> shill: Log boot statistics for service state changes.

BUG=chromium-os:30169
TEST=unit tests, booted device, /tmp/disk-network-ready is populated

Change-Id: I8f0de3d3f9da2f73ca10977d46262fbbbbd56584
Reviewed-on: https://gerrit.chromium.org/gerrit/25084
Tested-by: Darin Petkov <petkov@chromium.org>
Reviewed-by: Thieu Le <thieule@chromium.org>
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Commit-Ready: Darin Petkov <petkov@chromium.org>
/system/connectivity/shill/service.h
a121c44fb8e620b572c2f8d260406729d10d339a 09-Jun-2012 Paul Stewart <pstew@chromium.org> shill: Sort services with respect to "portal"

BUG=chromium-os:31686
TEST=New unit test

Change-Id: Iea8424a9858557e6e29499a703b1196c9f379239
Reviewed-on: https://gerrit.chromium.org/gerrit/24949
Reviewed-by: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
Commit-Ready: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/service.h
b2ba39fb7b19ce331f6aadb3e6e9e61d70a2f0a1 06-Jun-2012 Darin Petkov <petkov@chromium.org> shill: wimax: Resort services when WiMAX service connectability changes.

If a WiMAX service's connectable property changes, alert Manager so
that it can resort the registered services and initiate auto-connect
to the service if necessary.

BUG=chrome-os-partner:10179
TEST=unit tests

Change-Id: Icdfc6f432de496d2f53994dd993387605f87dece
Reviewed-on: https://gerrit.chromium.org/gerrit/24584
Tested-by: Darin Petkov <petkov@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Commit-Ready: Darin Petkov <petkov@chromium.org>
/system/connectivity/shill/service.h
053fa82aad4ce9bc99ab3dc278d4e12ab0be14c0 05-Jun-2012 Joshua Kroll <joshkroll@chromium.org> Remove TechnologyIs method from the Service class and its subclasses. This is step 1 in removing the method altogether.

BUG=chromium-os:29696
TEST=Ran the shill unit tests.

Change-Id: I793cddee870afbdae778b1ea0527ad2398481411
Reviewed-on: https://gerrit.chromium.org/gerrit/24524
Reviewed-by: Paul Stewart <pstew@chromium.org>
Tested-by: Joshua Kroll <joshkroll@chromium.org>
Commit-Ready: Joshua Kroll <joshkroll@chromium.org>
/system/connectivity/shill/service.h
bc6e7390c4401e171ede4dc83b79b316f3e71100 24-May-2012 Paul Stewart <pstew@chromium.org> shill: Service: Report and filter EAP remote certificate subjects

Create a read-only "EAP.RemoteCertification" parameter in WiFi
services that returns the subject name of each entity in the
ceritificate chain in the server side of TLS authentication.

Create a read/write "EAP.SubjectMatch" parameter in WiFi services
that populates the "subject_match" parameter in wpa_supplicant for
802.1x interactions. This allows callers to specify that we only
connect to specific endpoints who have a subject name that contains
this substring.

BUG=chromium-os:31247
TEST=New unit tests + observe EAP-TLS autotest
Change-Id: Ia37b7726e08eb121fb1ab7ec4c2de7eb958fc9cf
Reviewed-on: https://gerrit.chromium.org/gerrit/23746
Commit-Ready: Paul Stewart <pstew@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/service.h
cf24a2465a3e7b5a11fa97be282f0af47aa3ef6e 22-May-2012 mukesh agrawal <quiche@chromium.org> shill: implement heuristic for WPA/WPA2 bad-passphrase detection

BUG=chromium-os:23211
TEST=new unit tests, manual (see below)

Collateral changes:
- alphabetize properties in Service::Load, Service::Save
- clean up some comments (remove stale ones, fix typos)
- minor refactoring of WiFi::HandleDisconnect, so that we
don't bail early if we can't find the network to disable

Manual testing:
- Try connecting to a WPA network using the wrong password.
Note that the password must be syntactically valid.
(E.g. try "abcdefgh".)
- Observe that Chrome shows the "Network Connection Error" dialog.
- Dismiss dialog.
/home/chronos/user/shill/shill.profile
- Try connecting to a WPA network using the wrong password.
Note that the password must be syntactically valid.
(E.g. try "abcdefgh".)
- Observe that Chrome does NOT show the "Network Connection Error" dialog.

Change-Id: If8f223432c324862965729e05b20b455177ca1f5
Reviewed-on: https://gerrit.chromium.org/gerrit/23290
Reviewed-by: Gary Morain <gmorain@chromium.org>
Tested-by: mukesh agrawal <quiche@chromium.org>
Commit-Ready: mukesh agrawal <quiche@chromium.org>
/system/connectivity/shill/service.h
81426131e75bf214ab49162127fec60490d979fc 16-May-2012 Paul Stewart <pstew@chromium.org> shill: service: Update connectability when EAP parameters are changed

When EAP parameters that affect connectability change over the RPC
interface, call set_eap, which will trigger an update of the
connectability of any service subclasses.

BUG=chromium-os:29374
TEST=New unit tests

Change-Id: I6f0a78f771827b4fc941a27cce983d4790cbfd2a
Reviewed-on: https://gerrit.chromium.org/gerrit/22835
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
Reviewed-by: Thieu Le <thieule@chromium.org>
Commit-Ready: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/service.h
cc0fded2a80c2c6c7fb46cbd7eee578e7a78c50a 09-May-2012 mukesh agrawal <quiche@chromium.org> shill: implement timeout for DHCP requests

BUG=chromium-os:30689
TEST=new unit tests, manual (see below)

Manual testing:
- Start shill.
- ff_debug +dhcp
- Plug USB-Ethernet into a switch (to get carrier), but without
an upstream connection for the switch. Plug dongle into USB
port.
- Wait 30 seconds.
- Check log file, find "Timed out waiting for DHCP lease on eth0",
and "Service Ethernet state Configuring -> Disconnected".

Change-Id: Ifc27539ec7191b060f615eb9dec61c9fdab07267
Reviewed-on: https://gerrit.chromium.org/gerrit/22302
Commit-Ready: mukesh agrawal <quiche@chromium.org>
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Tested-by: mukesh agrawal <quiche@chromium.org>
/system/connectivity/shill/service.h
5eb0542cb67358d9030367498a4ad741fc42af4f 11-May-2012 Darin Petkov <petkov@chromium.org> shill: vpn: Disconnect VPN service when underlying connection disconnects.

BUG=chromium-os:30737,chromium-os:30774
TEST=unit tests, tested on device with 000OpenVPNGenesis

Change-Id: Ib350cb23edd3e68b3bd5390378789a6b60857b80
Reviewed-on: https://gerrit.chromium.org/gerrit/22461
Tested-by: Darin Petkov <petkov@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Commit-Ready: Darin Petkov <petkov@chromium.org>
/system/connectivity/shill/service.h
d93615e9687b3473ede06a8503b6d23aacd0c603 27-Apr-2012 Gary Morain <gmorain@chromium.org> shill: Save ephemeral profile when GSM cellular network connects

Normally, a service is saved when an IP address is
assigned to a network. However, in the case of GSM, when the
network connects (but before an IP address is assigned), the
APN needs to be saved. This was causing crashes because the
save function was being performed on the ephemeral profile,
which does not have a backing store. This change saves the
service to the current profile (which has a backing store).

BUG=chromium-os:29981
TEST=manual. Log in. Ensure there is no cellular network in
~chronos/shill/shill.profile. Attempt to connect to the
a GSM (T-Mobile) network. Verify that shill does not crash
and that the cellular network has an entry in
~chronos/shill/shill.profile.

Change-Id: Ib14c80cc08598841629a3a1a3e96739b30297aa6
Reviewed-on: https://gerrit.chromium.org/gerrit/21350
Commit-Ready: Gary Morain <gmorain@chromium.org>
Reviewed-by: Gary Morain <gmorain@chromium.org>
Tested-by: Gary Morain <gmorain@chromium.org>
/system/connectivity/shill/service.h
1062d9deedace1cf4b3b374c5d40c53047fd6778 27-Apr-2012 Paul Stewart <pstew@chromium.org> shill: Allow service override of DHCP-derived IP parameters

Create new class StaticIPParameters which encapsulates all of the
property handling for RPC and storage, as well as applying parameters
to an IPConfig::Properties element. When a DHCP request succeeds
these parameters are used to selectively override values gained from
DHCP with those specified on the service.

BUG=chromium-os:23930
TEST=New unit tests -- manual testing is pending

Change-Id: I3b784f897ec6ffe0c78f2efe615d07d8f8924add
Reviewed-on: https://gerrit.chromium.org/gerrit/21448
Commit-Ready: Paul Stewart <pstew@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/service.h
1d0080a0f39f03402cde853d832af976eb32852b 30-Apr-2012 Darin Petkov <petkov@chromium.org> shill: vpn: Don't mark VPN services as auto-connect automatically.

BUG=chromium-os:30246
TEST=050IPSecGenesis

Change-Id: I8927e69d5cab614364f8d803a1255e458fb33015
Reviewed-on: https://gerrit.chromium.org/gerrit/21461
Tested-by: Darin Petkov <petkov@chromium.org>
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Commit-Ready: Darin Petkov <petkov@chromium.org>
/system/connectivity/shill/service.h
4357f4ea204e5d3e7632d67f26531e106dd211e2 27-Apr-2012 Paul Stewart <pstew@chromium.org> shill: wifi: Register newly-configured hidden networks

When a hidden WiFi service is created via ConfigureService,
it should be registered. This matches up exactly with how
hidden services are loaded from newly pushed profile in
WiFi::LoadHiddenServices().

BUG=chromium-os:26676
TEST=New unit tests, manual -- configure a hidden network via
configure-hidden-wifi, then propose a scan via "test-flimflam scan",
while running "iw event" to confirm whether the new SSID appears in
the scan list

Change-Id: I09cc26ad93c816ae109d5ce993354e2a9ed6240c
Reviewed-on: https://gerrit.chromium.org/gerrit/21289
Commit-Ready: Paul Stewart <pstew@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/service.h
10ccbb3c6bc4f4246105743c8508fc9ce8759c17 27-Apr-2012 Paul Stewart <pstew@chromium.org> shill: wifi: Scan for non-ephemeral hidden networks

Before, shill used the "favorite()" property to tell whether it
should scan for a hidden SSID. Instead, use a more direct approach
of asking whether the service is part of a non-ephemeral profile.
This allows services configured via Manager::ConfigureService()
for which the "favorite" flag has not been set to be scanned for
and listed for the user to select.

BUG=chromium-os:26676
TEST=New unit tests, manual -- configure a hidden network via
configure-hidden-wifi, then propose a scan via "test-flimflam scan",
while running "iw event" to confirm whether the new SSID appears in
the scan list

Change-Id: I75364c83c94482c0c3d654e2076a4bed06a7fca2
Reviewed-on: https://gerrit.chromium.org/gerrit/21288
Commit-Ready: Paul Stewart <pstew@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/service.h
d215af6f72d012f43057c34f17a12506baa21e66 25-Apr-2012 Paul Stewart <pstew@chromium.org> shill: service: Do active checks on PortalCheck and ProxyConfig

Change both properties to be derived strings. Validate the various
values of the PortalCheck parameter. Force a restart of portal
detection if either parameter changes, so that we can switch from
Portal to Online or vice vesa if by changing this parameter we are
changing the behavior of portal check.

BUG=chromium-os:29745
TEST=New unit tests. Manual: Set Proxy configuration on a service
in portal state while on the login screen.

Change-Id: I86c386e61396a23103f99382c568372b4774f452
Reviewed-on: https://gerrit.chromium.org/gerrit/21027
Commit-Ready: Paul Stewart <pstew@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/service.h
cb71529cc0432935aff005726c81df109d1dc710 25-Apr-2012 Darin Petkov <petkov@chromium.org> shill: vpn: Save credentials based on the SaveCredentials property.

Also, unload VPN credentials when the service is unloaded and reset
its SaveCredentials property to false.

BUG=chromium-os:20921
TEST=unit tests

Change-Id: Ia7536de4ba0f970a51d7ae9f9464703bb584ce6a
Reviewed-on: https://gerrit.chromium.org/gerrit/21046
Commit-Ready: Darin Petkov <petkov@chromium.org>
Reviewed-by: Darin Petkov <petkov@chromium.org>
Tested-by: Darin Petkov <petkov@chromium.org>
/system/connectivity/shill/service.h
10241e32c136ba99e7533ca1370e2e8eca241b7c 24-Apr-2012 Paul Stewart <pstew@chromium.org> shill: Add "IPConfig" property for Services

Add an IPConfig property to services so it can be directly referenced
here instead of indirectly through the device. A side effect of this
is that one can query the IPConfig RPCIdentifier for a VPN service
even though the device is not registered. While we are at it, fix
all the PropertyStore values to be read-only since we never want to
allow these fields to be modified on the IPConfig itself. Later we
will provide a method for individual IPConfig fields to be overridden
but these will be Service properties.

BUG=chromium-os:29540
TEST=Manual: Over DBus, ensure that IPConfig property points at a
readable IPConfig instance, both for OpenVPN, Ethernet and WiFi.
Ensure that in the Chrome UI, the "Network Info" is still available
(basically checking to make sure IPConfigs are still displayable
using the old method) even thought the parameters are now set to
be "Const".

Change-Id: Ib01297ef8dc9bec828ed57361873e9eebc0354bd
Reviewed-on: https://gerrit.chromium.org/gerrit/20983
Commit-Ready: Paul Stewart <pstew@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/service.h
ff14b0261ac867f98b96db9ba39490fd70269fcd 25-Apr-2012 Paul Stewart <pstew@chromium.org> shill: Service: Save service entry when property is set

When individual properties are set on a service that has a
backing profile, save the property to the profile so it is
persisted immediately.

BUG=chromium-os:29745
TEST=New unit test

Change-Id: I19084436d29f39033f5be2d08958aa68297be4d0
Reviewed-on: https://gerrit.chromium.org/gerrit/21026
Commit-Ready: Paul Stewart <pstew@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/service.h
2f903b3842af547e062fbf7b21a04e103211dec3 18-Apr-2012 Darin Petkov <petkov@chromium.org> shill: vpn: Ensure connected VPN services get sorted higher.

This allows shill to use the VPN connection as default once its
connected. Don't use the auto-connect property to decide the sort
order between already connected services, so that connected
non-autoconnectable VPN services are sorted higher (based on
technology order) than to other connected services.

Also, don't try to connect an already connected VPN service.

BUG=chromium-os:29628
TEST=unit tests, tested on device

Change-Id: Ia12b4ac939fc49abd9ca745373e9aa9ed181658c
Reviewed-on: https://gerrit.chromium.org/gerrit/20447
Tested-by: Darin Petkov <petkov@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Commit-Ready: Darin Petkov <petkov@chromium.org>
/system/connectivity/shill/service.h
ecf4cd104cf2957d6db9076b975d9deee87c55b2 17-Apr-2012 Paul Stewart <pstew@chromium.org> shill: wifi: Enable use of NSS-backed CA Certificates

Export CA certificates out of NSS if one is specified.

BUG=chromium-os:29462,chromium-os:25663
TEST=New unit test, manual -- ensure certificate is written out to /tmp

Change-Id: Ibe2c4b60a76402995eda4fdbef742ffe8c6a64fb
Reviewed-on: https://gerrit.chromium.org/gerrit/20386
Reviewed-by: Gaurav Shah <gauravsh@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
Commit-Ready: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/service.h
2055098b0dc296b36a916fca9c2944c4cf3ca63e 16-Apr-2012 Paul Stewart <pstew@chromium.org> shill: wifi: Enable use of hardware-backed certificate credentials

Enable use of hardware-backed certificates and keys by enabling
the pkcs11 module for wpa_supplicant. Bonus change: Enable use
of system CAs by default, although it is expected that Chrome
sets this explicitly in all interesting cases.

BUG=chromium-os:29462
TEST=New unit tests. Manual: Connect to EAP-TLS network using hardware
backed certs.

Change-Id: I9909f25be1007a56f2b9830a03f26cb6b7931968
Reviewed-on: https://gerrit.chromium.org/gerrit/20332
Commit-Ready: Paul Stewart <pstew@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/service.h
0c43833150ce2b5cd408c12e0f96ce6903dee8a5 11-Apr-2012 Paul Stewart <pstew@chromium.org> shill: service: Allow trivial set of "Name" property

ONC is wont to set the "Name" property on services it does a "GetService"
on. Allow this in the case where this would not have actually changed
the service.

BUG=chromium-os:29285
TEST=New unit test

Change-Id: I28c5469e6a2c655f2623229a72654bab93e7c521
Reviewed-on: https://gerrit.chromium.org/gerrit/19981
Reviewed-by: Darin Petkov <petkov@chromium.org>
Commit-Ready: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/service.h
acdc11f4961994f894f978713d1a22f2eb23687d 30-Mar-2012 Jason Glasgow <jglasgow@chromium.org> shill: Change service.device property to be a DBus::Path

Change service.device property to be a DBus::Path because it is a path
not a string. Flimflam exports the property as a path. Exporting it
as a string causes cashew to die.

Change the unit tests to use valid DBus paths which can contain
elements separated by /. Each element can contain only
[A-z][a-z][0-9]_ and cannot end in a trailing /.

BUG=chromium-os:28734
TEST=run shill unit tests, run shill on DUT. Run cashew.

Change-Id: I65fb843fb93f76d95eea6da334ad326ccb9fbd6f
Reviewed-on: https://gerrit.chromium.org/gerrit/19366
Commit-Ready: Jason Glasgow <jglasgow@chromium.org>
Reviewed-by: Jason Glasgow <jglasgow@chromium.org>
Tested-by: Jason Glasgow <jglasgow@chromium.org>
/system/connectivity/shill/service.h
65512e10f0534c390b2ef027cc64f660658db6c0 27-Mar-2012 Paul Stewart <pstew@chromium.org> shill: vpn: Destroy Unload()ed VPN services

BUG=chromium-os:28481
TEST=New unit test.

Change-Id: I222441d3ff5cbc7d97d97f7fdd2917eee5921721
Reviewed-on: https://gerrit.chromium.org/gerrit/19143
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Commit-Ready: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/service.h
568b5c6b093d5605a40216711d3291376394dd0f 28-Feb-2012 mukesh agrawal <quiche@chromium.org> shill: separate (externally observed) failure state from internal
failure condition.

Changing a service's state to failure causes Chrome to display
a connection failed dialog. Consequently, before this CL, if
a user suspends a device at home, and resumes it at the office,
he'll see a spurious connection failure dialog. (shill will
display the dialog when it can't connect to the home AP, even
though it is about to connect to the office AP.)

To resolve this, we set a WiFiService's state to idle, rather
than failure. However, internally, we record the time at which
the service disconnected, and use that to determine whether or
not a service is failed.

BUG=chromium-os:26828
TEST=new unit tests

Change-Id: I556a110f5705495d681f40c1bb645c34bd0e43f9
Reviewed-on: https://gerrit.chromium.org/gerrit/18685
Commit-Ready: mukesh agrawal <quiche@chromium.org>
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Tested-by: mukesh agrawal <quiche@chromium.org>
/system/connectivity/shill/service.h
cb59fed9326dc91c93b817dcd9eaca363d8313fe 22-Mar-2012 Paul Stewart <pstew@chromium.org> shill: Implement Service::Configure

This applies the properties of a KeyValueStore to a Service. It
does so by calling accessors in the Service's PropertyStore with
each value in the KeyValueStore. Certain parameters are ommitted
at the request of the Service if they were ostensibly already handled
in the GetService or ConfigureService call that started this Confiugre.

BUG=chromium-os:22800
TEST=New unit tests.

Change-Id: I69eedcdee03fa0682ff7821553bb6c7d76e6a50e
Reviewed-on: https://gerrit.chromium.org/gerrit/18823
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
Commit-Ready: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/service.h
9a24553461df7036755060423f90804011612249 07-Mar-2012 Eric Shienbrood <ers@chromium.org> Make Enable/Disable work using new callbacks for async support.

Use new-style callbacks to implement the Manager EnableTechnology
and DisableTechnology operations asynchronously. This allows
devices to be enabled and disabled from the UI ,and for the UI
to display available networks once the device is enabled.

Removed the behavior whereby setting the Device.Powered property
had the side effect of enabling or disabling the device. To
replace this, I added new Device.Enable and Device.Disable calls
for enabling and disabling individual devices.

Also separated the in-memory value of the Powered property from
the persisted value. Whenever a client requests that a device
be enabled or disabled, the desired power state is immediately
saved in the profile, but the in-memory value isn't updated until
the operation completes. On startup, shill now automatically
starts any devices for which the persistent Powered property
is set, and does not start devices for which it is not set.

BUG=chromium-os:23319,chromium-os:27814
TEST=Manual testing on device + unit tests passing.

Change-Id: Id676be3fc662cfd5efb730c67687edfd16b2dc6b
Reviewed-on: https://gerrit.chromium.org/gerrit/18123
Commit-Ready: Eric Shienbrood <ers@chromium.org>
Reviewed-by: Eric Shienbrood <ers@chromium.org>
Tested-by: Eric Shienbrood <ers@chromium.org>
/system/connectivity/shill/service.h
4c56161d7f3801ea86bb2bbd3e2d667c1ab57607 21-Mar-2012 Paul Stewart <pstew@chromium.org> shill: Add "GUID" property to Service

Hold, load and save the "GUID" property.

BUG=chromium-os:22800
TEST=Unit tests

Change-Id: I2ab8407213281e82eb71295e05d4ee54d410ba58
Reviewed-on: https://gerrit.chromium.org/gerrit/18688
Commit-Ready: Paul Stewart <pstew@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/service.h
ce4ec19216ccd15ae349ee42498657afc2c75bd8 14-Mar-2012 Paul Stewart <pstew@chromium.org> shill: vpn: Pin route on default connection

If "trusted_ip" and "gateway" are both specified in the OpenVPN
config, pin a host route to the VPN server. As a bonus change,
add a MockService::connection() and supply a default value so
Service does not need to befriend so many tests.

BUG=chromium-os:27483
TEST=New unit tests

Change-Id: I010fca6336b227c4086efb0481dcb8052245213e
Reviewed-on: https://gerrit.chromium.org/gerrit/18155
Reviewed-by: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
Commit-Ready: Darin Petkov <petkov@chromium.org>
/system/connectivity/shill/service.h
7f06033f84f6176170213ca5941b80284b4ce63e 14-Mar-2012 Darin Petkov <petkov@chromium.org> shill: vpn: Set the friendly VPN service name.

Also, implement a more concise KeyValueStore string lookup method and add unit
tests.

BUG=chromium-os:27775
TEST=unit tests

Change-Id: If6ab38a9110c09275816bcc6ca992a77425859eb
Reviewed-on: https://gerrit.chromium.org/gerrit/18106
Commit-Ready: Darin Petkov <petkov@chromium.org>
Reviewed-by: Darin Petkov <petkov@chromium.org>
Tested-by: Darin Petkov <petkov@chromium.org>
/system/connectivity/shill/service.h
e2bad7c1edd7dbe837619e5350bd70814e6913be 14-Mar-2012 Paul Stewart <pstew@chromium.org> shill: Add Manager::GetDefaultService

Also fix SortServices to fix reporting of "DefaultService" to metrics.

BUG=chromium-os:27483
TEST=New unit tests

Change-Id: Ic456e51de366ac4181bcd32d49d6e4055622c1cc
Reviewed-on: https://gerrit.chromium.org/gerrit/18133
Reviewed-by: Thieu Le <thieule@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
Commit-Ready: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/service.h
bf14e94cbd47d6320eec846f1ca4def026840e14 02-Mar-2012 mukesh agrawal <quiche@chromium.org> shill: logging improvements

BUG=None
TEST=unit tests

Change-Id: I0b91fc7c2b44a0866d0bb53d546a7a87bb7ccccd
Reviewed-on: https://gerrit.chromium.org/gerrit/17743
Commit-Ready: mukesh agrawal <quiche@chromium.org>
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Tested-by: mukesh agrawal <quiche@chromium.org>
/system/connectivity/shill/service.h
b84ba34aec59d083980d840fb845a3e2bea893cb 03-Mar-2012 Thieu Le <thieule@chromium.org> shill: Add support for Network.*.TimeResumeToReady

BUG=chromium-os:24440
TEST=Unit tests, network_WiFiManager, manually suspend/resume system

Change-Id: Ica618f2c713bac92f609d7894b16b0dd93af1645
Reviewed-on: https://gerrit.chromium.org/gerrit/17263
Commit-Ready: Thieu Le <thieule@chromium.org>
Reviewed-by: Thieu Le <thieule@chromium.org>
Tested-by: Thieu Le <thieule@chromium.org>
/system/connectivity/shill/service.h
20088d860631a67c151a12783fbbee63c708792f 16-Feb-2012 Paul Stewart <pstew@chromium.org> shill: Perform Portal Detection in Device

When a connection completes, start a portal detection request, which
may change the state of the selected service. Bonus changes: removed
Service::kStateReady, since Service::kStateConnected maps directly
to flimflam::kStateReady. Also, move technology list parsing over
to technology.cc.

BUG=chromium-os:23318
TEST=New unit tests

Change-Id: I2fad724165af6914c8f83bc123f07db5af223a05
Reviewed-on: https://gerrit.chromium.org/gerrit/16117
Commit-Ready: Paul Stewart <pstew@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/service.h
8f3f775cc511815300fec4e67cf30a329c975e56 18-Feb-2012 mukesh agrawal <quiche@chromium.org> shill: set ethernet_service signal strength to max. (so if it has to
compete with wifi_service, it isn't unfairly penalized.)

BUG=chromium-os:26529
TEST=unit tests

Collateral change: update WiFiService (and its unit tests) to
use Service::kStrengthMin and Service::kStrengthMax.

Change-Id: I208fd2ce7a8dba8dbd6c72ae2f8fdd8b90ed9c12
Reviewed-on: https://gerrit.chromium.org/gerrit/16403
Commit-Ready: mukesh agrawal <quiche@chromium.org>
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Tested-by: mukesh agrawal <quiche@chromium.org>
/system/connectivity/shill/service.h
ddc378f1b63b842cc691ecd2274c3674525a7639 18-Feb-2012 mukesh agrawal <quiche@chromium.org> shill: logging improvements

- in sorted service list, include the reason that service A
comes before service B
- set friendly name for ethernet service
(so they no longer log as "0")
- log argument to Connection::SetIsDefault

BUG=None
TEST=unit tests

Change-Id: I34f893cad0ba76be988171868540327105e9dd50
Reviewed-on: https://gerrit.chromium.org/gerrit/16401
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Tested-by: mukesh agrawal <quiche@chromium.org>
Commit-Ready: mukesh agrawal <quiche@chromium.org>
/system/connectivity/shill/service.h
d4e9e552fb39c5c6f384b5b1bb2369415971ea39 17-Feb-2012 Thieu Le <thieule@chromium.org> shill: Persists updated favorite setting.

BUG=chromium-os:26373
TEST=Unit tests, manually connect to GoogleGuest, reboot, suspend/resume
and ensure GoogleGuest gets reconnected, network_WiFiManager

Change-Id: Ib35c281fc3f1ece8a469cd737fe2dfdb5c1a3dc8
Reviewed-on: https://gerrit.chromium.org/gerrit/16105
Commit-Ready: Thieu Le <thieule@chromium.org>
Reviewed-by: Thieu Le <thieule@chromium.org>
Tested-by: Thieu Le <thieule@chromium.org>
/system/connectivity/shill/service.h
e1d90e9f688406d47a1453eeac51b7faaebf9908 16-Feb-2012 mukesh agrawal <quiche@chromium.org> shill: update service signal strength and frequency from endpoints

In addition to updating the values in WiFiService, we emit
notification of the changes over RPC.

BUG=chromium-os:16786,chromium-os:16788
TEST=new unit tests, manual

Manual test: run on device, see signal strength indicator in UI
instead of "X".

Change-Id: I1ab5f064953a412387362d50e47602ee62dbe0cc
Reviewed-on: https://gerrit.chromium.org/gerrit/16000
Reviewed-by: Gary Morain <gmorain@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Commit-Ready: mukesh agrawal <quiche@chromium.org>
Tested-by: mukesh agrawal <quiche@chromium.org>
/system/connectivity/shill/service.h
67370f6ebe6757f55249f6e87f4a96922d0c4518 15-Feb-2012 Thieu Le <thieule@chromium.org> shill: Add code to track disconnect metric.

BUG=chromium-os:25958
TEST=Unit tests, network_WiFiManager

Change-Id: I4cee4d4380dc822c9bed61e006df304c6c6fbdde
Reviewed-on: https://gerrit.chromium.org/gerrit/15850
Commit-Ready: Thieu Le <thieule@chromium.org>
Reviewed-by: Thieu Le <thieule@chromium.org>
Tested-by: Thieu Le <thieule@chromium.org>
/system/connectivity/shill/service.h
6bb9e7c2c068fc15333babea8e66f02332683e33 30-Jan-2012 mukesh agrawal <quiche@chromium.org> shill: rename DispatchOnType to SetProperty

I think this name is clearer. While the function does
have to dispatch based on type, what the caller is trying
to do is to set a property.

BUG=None
TEST=unit tests
Change-Id: I7eedd5a74de7f465310d07271e61cff320645fd8
Reviewed-on: https://gerrit.chromium.org/gerrit/15538
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Tested-by: mukesh agrawal <quiche@chromium.org>
Commit-Ready: mukesh agrawal <quiche@chromium.org>
/system/connectivity/shill/service.h
292dc0f18ce6ba7ea1419efc4d8ef909712bb7c2 27-Jan-2012 mukesh agrawal <quiche@chromium.org> shill: teach property accessors how to clear properties,
and update code that instantiates property accessors
accordingly.

BUG=chromium-os:24814
TEST=new unit tests

Change-Id: Iae385c331648e74916c2eb2b69c41ccc9cdcafdf
Reviewed-on: https://gerrit.chromium.org/gerrit/15289
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Tested-by: mukesh agrawal <quiche@chromium.org>
Commit-Ready: mukesh agrawal <quiche@chromium.org>
/system/connectivity/shill/service.h
0756db95c9d39d6e6aa9a754e54b441eff46ff34 27-Jan-2012 Paul Stewart <pstew@chromium.org> shill: Implement GetEntry on Profile

Implement "GetEntry" on profile_dbus_adaptor. This change adds
the ability to look up a Service in the Manager by its
StorageIdentifier and then to return its properties to the caller.
If the Service does not exist in the manager, we have to read
directly out of the Profile's store and build a DBus property dict
out of its contents. This is a pretty gross method, and I've already
created a bug to remove this as soon as we can diverge from the
flimflam Profile API. crosbug.com/25813

BUG=chromium-os:25542
TEST=New unit tests + Manual: chrome://settings/internet now lists
both visible and unavailable networks under "Remembered Networks"
and clikcing on "Forget Network" purges the network from the profile.

Change-Id: Ib2f0ab772e40a1f615206a7b985be446fc7facde
Reviewed-on: https://gerrit.chromium.org/gerrit/15200
Commit-Ready: Paul Stewart <pstew@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/service.h
9f32d197feae49a42ceca12606bc61fe22b59065 31-Jan-2012 Paul Stewart <pstew@chromium.org> shill: Make EapPassword and EapPrivateKeyPassword write-only

In the same vein as the Passphrase property in WiFiService,
make these properties unavailable for read-back.

BUG=chromium-os:25690
TEST=New unit test

Change-Id: Ic2e61c0110d593d22c447206a35a0e9982e46aae
Reviewed-on: https://gerrit.chromium.org/gerrit/15078
Commit-Ready: Paul Stewart <pstew@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/service.h
284fe797377b574717e6f61196219fece1cbe85b 01-Feb-2012 Thieu Le <thieule@chromium.org> shill: make access to Service.AutoConnect consistent with flimflam

Service.AutoConnect is writable only if the Favorite property is true.

BUG=chromium-os:23342
TEST=Unit tests, network_WiFiManager (7/9)

Change-Id: Ia76e1bfb39e51b62352b97131d14a672fdc45f6d
Reviewed-on: https://gerrit.chromium.org/gerrit/15156
Commit-Ready: Thieu Le <thieule@chromium.org>
Reviewed-by: Thieu Le <thieule@chromium.org>
Tested-by: Thieu Le <thieule@chromium.org>
/system/connectivity/shill/service.h
313324136473f9120b1e485a408f51ae938dcb64 28-Jan-2012 Darin Petkov <petkov@chromium.org> shill: Fix the cellular service storage identifier.

This CL fixes a few issues:

- It bases the default cellular service storage identifier on the friendly
service name.

- If service is GSM and IMSI is available, use it instead of the friendly name.

- Fix a bug where all legal characters in the storage identifier were replaced
by "_" (rather than all illegal characters).

BUG=chromium-os:24952
TEST=unit tests

Change-Id: Ie55cb2b4f2dafb73545ac285a57674063946ceb3
Reviewed-on: https://gerrit.chromium.org/gerrit/15151
Tested-by: Darin Petkov <petkov@chromium.org>
Reviewed-by: Eric Shienbrood <ers@chromium.org>
Commit-Ready: Darin Petkov <petkov@chromium.org>
/system/connectivity/shill/service.h
10109f2c0dd33784d50c27f300f0780986d81eff 12-Nov-2011 Gaurav Shah <gauravsh@chromium.org> shill: Add support for connecting to WPA+802.1x networks

This includes supporting EAP-TTLS and EAP-PEAP networks.

Also, also add a "connectability" check for 802.1x networks which
checks if there are sufficient and necessary EAP parameters to attempt
a connection.

BUG=chromium-os:20901, chromium-os:23466
TEST=2 new unit tests + 3 new autotests pass (019CheckWPA_1x_AES,
072CheckWPA_1x_PEAP and 073CheckWPA_1x_TTLS)

Change-Id: I46c1886d8fd901c1f95387c984975f2aac89b28e
Reviewed-on: https://gerrit.chromium.org/gerrit/13063
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Commit-Ready: Gaurav Shah <gauravsh@chromium.org>
Tested-by: Gaurav Shah <gauravsh@chromium.org>
/system/connectivity/shill/service.h
5de44ab664b7cbb7619e31431e346ec8309548a6 05-Dec-2011 Eric Shienbrood <ers@chromium.org> Add async support for shill client calls.

Many of the modem manager method invocations performed by the
shill cellular support have been converted to be asynchronous,
based on the dbus-c++ support for asynchronous proxies.
I've also hooked this up with the mechanism that was recently
introduced that allows adaptor methods to defer returning
results to callers of shill methods, so that we now have
an end-to-end asynchronous solution.

Adaptor methods that want to be non-blocking create a Returner
object, which will later be used to send back the result
of the operation. The cellular device code that implements
the method (or the cellular service code, depending on the
method), wraps the Returner in an AsyncCallHandler object,
which is passed to the proxy methods as the "data" argument.
When the reply callback for the method occurs, it can pull
the Returner object out of the AsyncCallHandler and use it
to return the result.

In the case of an operation like Enable that involves multiple
client method invocations, the object that wraps the returner
is a MultiStepAsyncCallHandler, a subclass of AsyncCallHandler,
that also wraps a list of Tasks comprising the compound
operation.

In either case, a callback indicates that the handling of
the method is complete by calling Complete() on the AsyncCallHandler.
This is an overloaded method - without any argument, it returns
a success result to the caller of the shill method. With an
Error argument, it returns the DBus::Error equivalent of that
error to the caller. For a MultiStepAsyncCallHandler, calling
Complete() with no argument removes the next Task from the
list and posts it to the main loop, unless there are no
remaining tasks, in which case it returns the result to
the caller of the original shill method.

I've converted the following operations to work asynchronously
end-to-end:
Enable, Register, EnterPIN, RequirePIN, ChangePIN, UnblockPIN,
Activate.
Connect and Scan have been changed to be asynchronous on the
proxy side, but not yet on the adaptor side. For Enable, all of
the individual proxy operations are now done asynchronously,
except for fetching of individual properties.

I've moved all the ModemProxy and ModemSimpleProxy method
invocations from Cellular into CellularCapability. Now all
operations to the modem are done through a Capability interface.

There is a memory leak issue noted in the file async_call_handler.h

BUG=chromium-os:23433,chromium-os:22732
TEST=unit tests, testing on device

Change-Id: I54254dd36d116a1e9089bc9b1a60fa06a3098bd5
Reviewed-on: https://gerrit.chromium.org/gerrit/12564
Commit-Ready: Eric Shienbrood <ers@chromium.org>
Reviewed-by: Eric Shienbrood <ers@chromium.org>
Tested-by: Eric Shienbrood <ers@chromium.org>
/system/connectivity/shill/service.h
adb6848a27f0eb449527fa3aa0440002f2be6800 18-Jan-2012 mukesh agrawal <quiche@chromium.org> shill: don't auto-connect to a disconnected service

This addresses part of the problem with the 003AsciiKeyWEP40
failure. That test establishes a connection, disconnects,
reconfigures the (WEP) password on an AP, and then tries
to reconnect.

Before this patch, the test failed as follows:
1. shill immediately tries to reconnect after the disconnect.
This reconnect uses the old password (because the test
hasn't had a chance to supply a new password).
2. The test code provides the correct password, and then
initiates an explicit connect. However, the explicit
connect is ignored, because a connection is already in
progress (to the same service).
3. The automatic reconnect fails, because it is using the
wrong password.

BUG=chromium-os:25153,chromium-os:25157
TEST=unit tests, WiFiRoaming, WiFiSecMat.*WEP*, WiFiManager

Testing notes:
- WiFiRoaming had some failures, but no regressions
- WiFiSecMat.*WEP* passed except 003CheckWEP_8021x
(previously, that failed in addition to 000StaticKeyWEP40,
001StaticKeyWEP104, 005SharedKeyWEP40, and 006SharedKeyWEP104.)
- WiFiManager passed
(previously, 003AsciiKeyWEP40 and 004AsciiKeyWEP104 failed.)

Change-Id: I2dd6312006865c914d4193ce3f7d7c5443b84deb
Reviewed-on: https://gerrit.chromium.org/gerrit/14408
Commit-Ready: mukesh agrawal <quiche@chromium.org>
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Tested-by: mukesh agrawal <quiche@chromium.org>
/system/connectivity/shill/service.h
3426c8fc7a3943f2d8fcb2ec78f0593088b42bed 12-Jan-2012 Thieu Le <thieule@chromium.org> shill: Move Metrics from singleton to Shill daemon

While implementing chromium-os:24810, it was discovered that Metrics is
cleaner if it is passed around like ControlInterface, Dispatcher,
Manager, etc. This approach also makes Metrics more testable.

BUG=chromium-os:24810
TEST=Unit tests, network_WiFiManager suite

Change-Id: I556a1bd11f21f0b93ecfeaae8855dfb99ed5e5f9
Reviewed-on: https://gerrit.chromium.org/gerrit/14099
Commit-Ready: Thieu Le <thieule@chromium.org>
Reviewed-by: Thieu Le <thieule@chromium.org>
Tested-by: Thieu Le <thieule@chromium.org>
/system/connectivity/shill/service.h
d78ee7e07da6a78b0ad72b97c6737084d96428e7 12-Jan-2012 Darin Petkov <petkov@chromium.org> shill: Broadcast service strength changes.

Similar to flimflam, make strength a property of the base service class, and
broadcast changes to the property.

BUG=chromium-os:25011
TEST=unit tests, tested on device

Change-Id: Iff7a638a2c1b8a828260739273c428373aff420e
Reviewed-on: https://gerrit.chromium.org/gerrit/14054
Commit-Ready: Darin Petkov <petkov@chromium.org>
Reviewed-by: Darin Petkov <petkov@chromium.org>
Tested-by: Darin Petkov <petkov@chromium.org>
/system/connectivity/shill/service.h
76d1388a4a0435f1586117b55674ad61f5a8e6c6 13-Jan-2012 mukesh agrawal <quiche@chromium.org> shill: have Service check if a service is connected/connecting
before executing an AutoConnect request.

This avoids a spurious warning in the log file, if manager
autoconnects to an already connected Cellular service.

No effect on Ethernet services, because Ethernet's connect is
a no-op. No effect on WiFi services, because they override
Service::AutoConnect.

BUG=None
TEST=new unit test

Change-Id: If9e6c18735a5fb8a0d9baa1602c392ce7ec6e932
Reviewed-on: https://gerrit.chromium.org/gerrit/14097
Reviewed-by: Thieu Le <thieule@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Commit-Ready: mukesh agrawal <quiche@chromium.org>
Tested-by: mukesh agrawal <quiche@chromium.org>
/system/connectivity/shill/service.h
d8ad3c4266195daeb440a9fb65c612e4f6bfc7f8 09-Jan-2012 Paul Stewart <pstew@chromium.org> shill: Purge service/wifi_service state on Unload

Clear relevant state from Service and WiFiService when manager
notifies the service that it is no longer backed by a Profile.

BUG=chromium-os:22947
TEST=New unit tests

Change-Id: I048d2692fade5b883332e727be39f86caf4ed7f0
Reviewed-on: https://gerrit.chromium.org/gerrit/13880
Commit-Ready: Paul Stewart <pstew@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/service.h
1b1a7f222bc8a2b6c9f15fd7a41aad7977ff275e 07-Jan-2012 Paul Stewart <pstew@chromium.org> shill: Implement get/set of Profile property for Service

Create getter and setter. To set the "Profile" property on a
service we have to ask the manager to take care of finding the
profile by name, and then moving the service to the new profile.

BUG=chromium-os:22803
TEST=New unit test, manual (via list-services on a live system)

Change-Id: Idfb3f9f68764b926ddf06c0cc0285292aa85864d
Reviewed-on: https://gerrit.chromium.org/gerrit/13847
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Reviewed-by: Thieu Le <thieule@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
Commit-Ready: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/service.h
8a3188dbc04245c17a4729d16a632547ce4bf585 01-Dec-2011 mukesh agrawal <quiche@chromium.org> shill: improve conformance with WiFiRoaming tests

This patch makes several changes to get shill passing more of
the WiFiRoaming suite. shill now passes 13 of the 18 tests.

Overview of changes:
- Clean up Services when their last Endpoint disappers.
- Make a new WiFi connection request pre-empt an existing one.
- Make Device::SelectService no-op if new service is same as old.
(part of resolving crosbug.com/23703)
- Move auto-connect logic to its own function, and run that function
in a deferred task (partly resolves crosbug.com/24276)
- Add a non-deferred variant of Service::Connect (part of resolving
crosbug.com/24276).
- Have service sort order reflect whether or not services are
connecting, failed, connectable, and configured for auto-connect.

BUG=chromium-os:24276,chromium-os:23223,chromium-os:22943,chromium-os:23703
TEST=WiFiRoaming, unit tests, manual

Manual testing: per https://gerrit.chromium.org/gerrit/12963

Collateral changes:
- updated TESTING
- added crosbug.com/24461 for problem with autotest and profiles
- declared some functions as const
- removed some useless comments

Change-Id: I36d6eb7108a377dbf409d3e5673deffb85c0633e
Reviewed-on: https://gerrit.chromium.org/gerrit/12687
Reviewed-by: Thieu Le <thieule@chromium.org>
Tested-by: mukesh agrawal <quiche@chromium.org>
Commit-Ready: mukesh agrawal <quiche@chromium.org>
/system/connectivity/shill/service.h
48e6d6d0ec0f90d9b2206f60c1ff2a825c5ce9c1 06-Dec-2011 Thieu Le <thieule@chromium.org> shill: Add preliminary UMA support

Add preliminary UMA framework and support for common service metrics and one
WiFi metric (Network.Shill.WiFi.Channel) so we can thrash out how the
metrics fit in the current code. Other metrics will be added in the
future and are tracked by separate bugs.

BUG=chromium-os:22062
TEST=Unit tests

Change-Id: If3dc6da2e66e846e2178a1700b2576218b90abda
Reviewed-on: https://gerrit.chromium.org/gerrit/12474
Commit-Ready: Thieu Le <thieule@chromium.org>
Reviewed-by: Thieu Le <thieule@chromium.org>
Tested-by: Thieu Le <thieule@chromium.org>
/system/connectivity/shill/service.h
3d9bcf58bd29080b96db4a2c9e7bfe6ed3d6e6df 13-Dec-2011 Paul Stewart <pstew@chromium.org> shill: Enable auto-connect for WiFi services

This performs a few of the last tidbits to get auto-connect
working for WiFi networks. The tweaks include:

* Adding calls to SortServices() in Push/PopProfile
* On successful connection, move service to the profile on
the top of the stack if this service was previously in the
ephemeral profile.
* Add a method to Services to return whether they are eligible
for auto-connect. Implement this for the WiFi services by
using a new method to test if the WiFi device is busy.

BUG=chromium-os:24261,chromium-os:17255
TEST=Unit Tests (for regression)
Manual: Connect to WPA-PSK network successfully; restart shill and
observe an auto-connect after scan.

Change-Id: Ia4e1fd94795a4ce64d66ec6db940ee16ff694431
Reviewed-on: https://gerrit.chromium.org/gerrit/12963
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Commit-Ready: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/service.h
2706aaf80a93dcc3891bf7205318b530d40393f9 15-Dec-2011 Paul Stewart <pstew@chromium.org> shill: Save "Passphrase" property in WiFi services

Save and load the "Passphrase property", as well as saving a few
new Service properties that will be useful later on to get us out
of the habit of parsing the storage identifier. Also update the
"Connectable" and "need_passphrase" state, so that Chome now
believes this service can be connected to without any user
intervention.

BUG=chromium-os:23467
TEST=Manual: With this change one can manually re-connect to a
stored service without re-entering credentials.

Change-Id: I25e1704ab4f9b6cb0be85d2205acc018415cddfc
Reviewed-on: https://gerrit.chromium.org/gerrit/12962
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
Commit-Ready: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/service.h
c1dec4d5cad7c6ee2cd8dbc4f47e4d30403dcca1 09-Dec-2011 Paul Stewart <pstew@chromium.org> shill: Assign "Default" status to the best connection

Set the highest-ranked connection to be the "Default".
As a result, the highest priority default route will
move with the highest-ranked connection in the service
list.

Bonus changes:
* Service now formally holds a reference to the Connection
object, so call a "SetConnection" method instead of a
Create/Destroy of the HTTPProxy.
* Actually start the routing table service, and do a couple
minor fixes due to how the kernel actually accepts metric
changes.

BUG=chromium-os:7607,chromium-os:23993
TEST=New Unit Test + Manual (watch routes while inserting
USB-Ethernet on a machine connected to WiFi)

Change-Id: Iddf1ed766238d9e8adc97bb54fc12b527f86239f
Reviewed-on: https://gerrit.chromium.org/gerrit/12685
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Reviewed-by: Gaurav Shah <gauravsh@chromium.org>
Commit-Ready: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/service.h
be5f5b341ba4b85d45ffb6c0430ef5ab84c7b961 08-Dec-2011 Paul Stewart <pstew@chromium.org> shill: Create HTTPProxy for connected services

When an a Connection is created on a Device, ask the
Service to create an HTTPProxy. The Service will
then expose the port number for the proxy as an RPC
property. Whenever the Service is unselected by
the Device, or the connection terminates, ask the
Service to destroy the proxy.

The Service owns the HTTPProxy so that it can report
the proxy port in its properties.

BUG=chromium-os:21664
TEST=Add expectations for DestroyProxy in unit tests.
Manual: Ensure that "list-services" shows the proxy
port on a successful connection, and "curl -x" to
this proxy succeeds.

Change-Id: I24a1f7a23c0fc4577b48aed7bec370fba6edc342
Reviewed-on: https://gerrit.chromium.org/gerrit/12625
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Commit-Ready: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/service.h
0ed0f2e84c366a90bca4a824b0adf18e9f243369 05-Dec-2011 mukesh agrawal <quiche@chromium.org> shill: implement Service.Disconnect (for WiFiService only)

BUG=chromium-os:23774,chromium-os:23662
TEST=new unit tests, some autotests

autotests run:
- PASS network_WiFiSecMat.031CheckHidden_WPA
- PASS network_WiFiSecMat.032CheckHidden_RSN

Change-Id: I0c2dc8c9888caca793f0dfe5a55c0df2a4b10c79
Reviewed-on: https://gerrit.chromium.org/gerrit/12498
Commit-Ready: mukesh agrawal <quiche@chromium.org>
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Tested-by: mukesh agrawal <quiche@chromium.org>
/system/connectivity/shill/service.h
987e71e21e4f71226e75b564e14cb2b09d070411 05-Dec-2011 Paul Stewart <pstew@chromium.org> shill: Support UIData property in Services

This is another opaque string property similar to ProxyConfig
controlled by Chrome.

BUG=chromium-os:21992
TEST=Unit Tests (for regression)

Change-Id: Ic494b36aaa6dfe29b964eaaeec1bfa97c9d9abb5
Reviewed-on: https://gerrit.chromium.org/gerrit/12446
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Reviewed-by: Darin Petkov <petkov@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
Commit-Ready: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/service.h
ed2c28c6e3c0bc2f9d8832fee083868304178f08 30-Nov-2011 Hristo Stefanov <hstefanov@chromium.org> shill: cleaning glint warnings

The typical warnings addressed include a lot of missing includes
and missing argument names. About 30 files edited in total.

Cpplint was the actual lint being run.

BUG=chromium-os:15873
TEST=Ran all the unit tests.

Change-Id: I64a8b76cd8f94c7729743b76b41a956f1b7370cf
Reviewed-on: https://gerrit.chromium.org/gerrit/12253
Commit-Ready: Hristo Stefanov <hstefanov@chromium.org>
Reviewed-by: Hristo Stefanov <hstefanov@chromium.org>
Tested-by: Hristo Stefanov <hstefanov@chromium.org>
/system/connectivity/shill/service.h
29c13a12b666344c56d2bbc1b3ee08b695b9b98b 24-Nov-2011 mukesh agrawal <quiche@chromium.org> shill: make Connectable property of WiFiService reflect state
of security requirements and available credentials

BUG=chromium-os:23352
TEST=new unittests

Change-Id: I3d98512073d2280a40eee3fd462f592c43df00f3
Reviewed-on: https://gerrit.chromium.org/gerrit/12093
Tested-by: mukesh agrawal <quiche@chromium.org>
Reviewed-by: Gaurav Shah <gauravsh@chromium.org>
Commit-Ready: mukesh agrawal <quiche@chromium.org>
/system/connectivity/shill/service.h
435de2cd55a95836381b53acbce8cbbad98ec04d 18-Nov-2011 Gaurav Shah <gauravsh@chromium.org> Implement {Available|Connected|Enabled}Technolgies and DefaultTechnology

This is Part 1 of a series of changes required for the Manager to generate
the right set of DBus events allowing shill to properly tell Chrome about
connectivity.

Some other side-effects in the change (needed to implement the above):
- Emit these manager properties over DBus everytime we re-sort the Service
vector.
- Add a technology data member to Device, this allows easy enumeration of
technologies.
- Add interface for getting a handle to the selected service on a device.
- Map connected state to online instead of ready state. This is needed for
so that Chrome doesn't wait for the portal detection code to switch the
state from ready->online.
- Default set the ethernet service as connectable.

BUG=chromium-os:14887
TEST=1) manual test to verify shill properly configures the ethernet
device and Chrome correctly detects that.
2) new unit tests

Change-Id: Ib10f2f0836f8d4aacaad1491f58ed9b3b5d37e7d
Reviewed-on: https://gerrit.chromium.org/gerrit/12019
Tested-by: Gaurav Shah <gauravsh@chromium.org>
Reviewed-by: mukesh agrawal <quiche@chromium.org>
/system/connectivity/shill/service.h
c6d6c72920d32299e8ae1cb3a7dbbb13a0741b13 18-Nov-2011 Gaurav Shah <gauravsh@chromium.org> shill: Add more connection states and connection failure states

Also add methods to get a string description of a given connection or failure
state. Clean up some logs.

BUG=none
TEST=none

Change-Id: I0d9278c686940f401202807e3f3eac412283bb70
Reviewed-on: https://gerrit.chromium.org/gerrit/12118
Tested-by: Gaurav Shah <gauravsh@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/service.h
00917ceafbc28599391bfcdd5837faf6d63fec32 23-Nov-2011 mukesh agrawal <quiche@chromium.org> shill: set favorite property when a Service is connected, and
set autoconnect property when a Service is made a favorite

BUG=chromium-os:23346,chromium-os:23349
TEST=new unittests

Bonus changes:
- remove some unused variables in ManagerTest.SortServices
- add "static" comment for Service::DecideBetween and
Service::Compare

Change-Id: I4b7e01f98d1292b9c8f951c9a54a01f76292b740
Reviewed-on: https://gerrit.chromium.org/gerrit/12053
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Tested-by: mukesh agrawal <quiche@chromium.org>
/system/connectivity/shill/service.h
b72cf40dc315f9ae3537980f4fd85e737c125a03 22-Nov-2011 Darin Petkov <petkov@chromium.org> shill: Decouple Cellular's IsRegistered from the network technology string.

Also, broadcast changes in the cellular service network technology and roaming
state properties.

BUG=chromium-os:23327
TEST=unit tests, tested on device

Change-Id: Ia4c297586dbc9b8a32d297c126c4d791310b5abd
Reviewed-on: https://gerrit.chromium.org/gerrit/12028
Tested-by: Darin Petkov <petkov@chromium.org>
Reviewed-by: Eric Shienbrood <ers@chromium.org>
/system/connectivity/shill/service.h
1590839e44a0e922d4763003a35dbd493509b705 16-Nov-2011 mukesh agrawal <quiche@chromium.org> shill: track the CurrentBSS property reported by wpa_supplicant,
and use it to update WiFiService state.

BUG=chromium-os:22850
TEST=new unit tests, autotests (details below)

Ran the WiFiRoaming suite, and noted the following changes:
- 000ChannelHopBSS regressed. This is due to the fact that we
now call RemoveNetwork when supplicant gives up on connecting
to a network. With this in place, we need other mechansism
to retry the connection. (They will come in later commits.)
- 006BeaconLoss now passes.
- 008Prefer5GHz regressed. This failed because we don't group
Endpoints into Services. I suspect the previous pass was a
fluke.
- 009ConnectOnResume passes, even though it should fail until
we provide retry mechanisms. Logs indicate that supplicant's
AP scan didn't time out as soon as it should have.

Bonus changes:
- Updated some TESTING and HACKING info.
- Added some comments TODOs about timing out connection
attempts. These aren't strictly part of CurrentBSS
tracking, but they fit along the theme of getting our
wpa_supplicant interactions sorted out.

Change-Id: Iba3495cae89ca835523dbf4d9ebfab5da4a8cc2d
Reviewed-on: https://gerrit.chromium.org/gerrit/11822
Tested-by: mukesh agrawal <quiche@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Commit-Ready: mukesh agrawal <quiche@chromium.org>
/system/connectivity/shill/service.h
a41e38d57e4fa37bd2c8de6447890b4e1951acb7 11-Nov-2011 Paul Stewart <pstew@chromium.org> shill: wifi: Load hidden services from storage

When a device or profile comes into existence, the device
will search the profile for hidden services and instantiate
services if they do not exist. These services will not
be visible in the RPC service list until they either appear
in scan or are actively being connected.

Side effects:
* Manager now loads the devices with profile data.
* Manager now respects the "powered" attribute loaded by
devices from the profile to determine whether or not
to call Start() on them.
* Key files can be searched for groups with a certain
key. This will be useful when we start supporting GUIDs.
* On service registration go backward (from top of stack
downward) through the list of profiles searching for
configuration instead of forwards.
* Move the update of the "Services" property of the manager
to a more centralized spot in SortServices. This way,
when the service order changes (or anything else that
affects the service list) this RPC property will update.
* Hidden services are not scanned for if they are in the
ephemeral profile -- it means that whatever profile was
supporting them does not exist anymore.
* WiFi services have the unenviable task of also decoding
storage identifiers in order to glean the address, mode
and security parameters.

BUG=chromium-os:22073,chromium-os:22074
TEST=New unit tests, Manual on real hardware.
Note: I could not connect to a hidden network, but this
is because we're not setting the ApScan parameter on
wpa_supplicant so on connect it is just doing broadcast
scans. However if I seed the profile with with a record
containing a hidden SSID, shill will force a scan for
the hidden network, which will allow it to connect.

Change-Id: I97a5b5f6db7c6e6d2aabf212c5c2984ce7f4daaa
Reviewed-on: https://gerrit.chromium.org/gerrit/11558
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Commit-Ready: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/service.h
1b7a616197af7ff753dbe7614a8e207b1e10ac1a 09-Nov-2011 Gaurav Shah <gauravsh@chromium.org> shill: Implement write-only properties

Certain properties (e.g. WIFI Passphrase) are write only and must
not be returned when Service.GetProperties() is called over D-Bus.

This CL implements WriteOnlyProperties, a write-only analog of the
read-only ConstProperties.

Also add a ReadablePropertyConstIterator which only returns the
readable properties. Switch over DBus adaptor and PropertyStore
to use that.

BUG=chromium-os:21196
TEST=Added 2 new unittests.

Change-Id: I52815cc395650e0b49e1acac8d4954deeebcee5d
Reviewed-on: https://gerrit.chromium.org/gerrit/11402
Commit-Ready: Gaurav Shah <gauravsh@chromium.org>
Reviewed-by: Gaurav Shah <gauravsh@chromium.org>
Tested-by: Gaurav Shah <gauravsh@chromium.org>
/system/connectivity/shill/service.h
1ca3e85103c23a6e5049f5a3c80a7a7b61f63a4f 04-Nov-2011 Paul Stewart <pstew@chromium.org> shill: Rename "security_" to "security_level_" in Service

Rename the "security" attribute assigned to Services to aid
in sorting, so it isn't confused with the textual "Security"
property that is only available in WiFi Services.

BUG=None
TEST=Rerun unit tests

Change-Id: I21ca99977f000d0e8fa59fe0f4c75fb85b5aa298
Reviewed-on: https://gerrit.chromium.org/gerrit/11208
Reviewed-by: Darin Petkov <petkov@chromium.org>
Commit-Ready: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/service.h
f566c976a074dc4f0826ebef5e83e5dfd279f13e 04-Nov-2011 Darin Petkov <petkov@chromium.org> Revert "shill: Rename "security_" to "security_level_" in Service"

Fails unit tests.

This reverts commit 204420dece1950c93acdfe14960af9aacbd2d999

Change-Id: I0968a9d571fbc856d0510b7e0d10f84428f4734d
Reviewed-on: https://gerrit.chromium.org/gerrit/11203
Reviewed-by: Jon Kliegman <kliegs@chromium.org>
Tested-by: Jon Kliegman <kliegs@chromium.org>
/system/connectivity/shill/service.h
136f6bc8fb3db32fef04dfe6ee279612e63e1305 04-Nov-2011 Paul Stewart <pstew@chromium.org> shill: Rename "security_" to "security_level_" in Service

Rename the "security" attribute assigned to Services to aid
in sorting, so it isn't confused with the textual "Security"
property that is only available in WiFi Services.

BUG=None
TEST=Rerun unit tests

Change-Id: Ib1d48ec72aa8126c7ea9c84c26dc71ccdfc57cfe
Reviewed-on: https://gerrit.chromium.org/gerrit/11191
Reviewed-by: Darin Petkov <petkov@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/service.h
bba6a5b87cb21424770228cd73e10574a2151568 03-Nov-2011 Paul Stewart <pstew@chromium.org> shill: Rename MergeService to ConfigureService

Collateral changes: Use ContainsService internally to profile's
ConfigureService. Refrain from using Service::GetStorageIdentifier
directly. I can think of scenarios coming up where it is important
for the Service to determine for itself whether a StorageInterface
contains anything it can use.

BUG=chromium-os:22422
TEST=ReRun Unit Tests

Change-Id: I34c6cb272c1540ab1e8d8d9bed4083b52e20f75e
Reviewed-on: https://gerrit.chromium.org/gerrit/11099
Commit-Ready: Paul Stewart <pstew@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/service.h
6515aabcd1fbbb9ff2090c9675c17eeef64e7474 13-Oct-2011 Chris Masone <cmasone@chromium.org> [shill] Make profiles backed with StoreInterfaces

Rely on persistence of data in StoreInterface to maintain
Service/Device/IPConfig info for entities that are not
currently active, instead of maintaining lists in Profile
objects themselves.

BUG=chromium-os:17253
TEST=unit, run on device

Change-Id: I206f44ddf16c584354f8fcadb57032f047f33d0a
Reviewed-on: http://gerrit.chromium.org/gerrit/10024
Commit-Ready: Chris Masone <cmasone@chromium.org>
Reviewed-by: Chris Masone <cmasone@chromium.org>
Tested-by: Chris Masone <cmasone@chromium.org>
/system/connectivity/shill/service.h
d835b2079b1b0f67338d48f528d61f882fa77693 08-Oct-2011 mukesh agrawal <quiche@chromium.org> shill: work properly with non-ascii SSIDs

specifically: when a service has non-ascii characters in the SSID,
replace them with a placeholder. this avoids crashing when we try
to serialize the Name property to a D-Bus string. (D-Bus strings
must be utf-8.)

also:
- per pstew, only provide a WiFi.HexSSID property if the Name
property does not faithfully represent the SSID. (other parts
of the system may key on the presence of WiFi.HexSSID as an
indication that Name has been munged.)
- separate out Service.name_ into unique_name_, and friendly_name_.
- unique_name_ is maintained by Service, and is guaranteed to be
unique.
- friendly_name_ may be modified to subclasses of Service, to
provide a user-friendly name.

BUG=chromium-os:21412
TEST=unittests, WiFiManager/001_SSID_NonAscii

Change-Id: Ia625bdcb183691da54f2cf1f4c330379196d94aa
Reviewed-on: http://gerrit.chromium.org/gerrit/9762
Tested-by: mukesh agrawal <quiche@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/service.h
ffa3d0433d419aa9251f3768a0090a27b6b1c434 07-Oct-2011 mukesh agrawal <quiche@chromium.org> shill: allow property accessors to return an error message if a
property's value cannot be changed.

also, reduce some code duplication in property_store.cc

BUG=chromium-os:21384
TEST=unittests

Change-Id: Iaac8d40bbb9e9a1341d6c6d01642885d88ac0e27
Reviewed-on: http://gerrit.chromium.org/gerrit/8925
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Tested-by: mukesh agrawal <quiche@chromium.org>
/system/connectivity/shill/service.h
22aa71b334c716f20999c2e08e5b797207b0afae 16-Sep-2011 Paul Stewart <pstew@chromium.org> shill: Implement service sorting

Sort the list of Services for presentation to
RPC callers, essentially copying the current flimflam
sorting criteria. Introduce the TechnologyOrder to
the Manager.

BUG=chromium-os:20114
TEST=New unit tests

Change-Id: I766b2297ba3170a7a6ab5adfe68425a8011be4fb
Reviewed-on: http://gerrit.chromium.org/gerrit/8205
Tested-by: Paul Stewart <pstew@chromium.org>
Reviewed-by: mukesh agrawal <quiche@chromium.org>
/system/connectivity/shill/service.h
7a4e4008dc09effe39c94a5f9575644a79ee1388 06-Sep-2011 mukesh agrawal <quiche@chromium.org> shill: implement Manager.GetService (error-case only)

BUG=chromium-os:20254
TEST=unittests, WiFiManager/000_SSID_Length_Limit

this gives us enough to pass the autotest for
network_WiFiManager/000_SSID_Length_Limit.

Change-Id: Ib0305e707d2203327d846be3e0b206033d6a884a
Reviewed-on: http://gerrit.chromium.org/gerrit/7567
Commit-Ready: mukesh agrawal <quiche@chromium.org>
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Tested-by: mukesh agrawal <quiche@chromium.org>
/system/connectivity/shill/service.h
de29fa8d95092f28548b5e4537a6c61e21ae760b 17-Sep-2011 mukesh agrawal <quiche@chromium.org> shill: tighten up constness of PropertyStore

BUG=chromium-os:20543
TEST=unittest

Change-Id: Ifa86f82a883b3c3ec61ce10f8d82564b9a036b04
Reviewed-on: http://gerrit.chromium.org/gerrit/7901
Tested-by: mukesh agrawal <quiche@chromium.org>
Reviewed-by: Chris Masone <cmasone@chromium.org>
/system/connectivity/shill/service.h
9d779936d8f8c2d74b30883e2a2622c4207fe797 26-Aug-2011 Chris Masone <cmasone@chromium.org> [shill] Add code for persisting profiles and services to disk.

BUG=chromium-os:17253
TEST=unit

Change-Id: Ic6dbbcb10543da3f4615cb305a77f6b9b301e8bc
Reviewed-on: http://gerrit.chromium.org/gerrit/7633
Reviewed-by: Darin Petkov <petkov@chromium.org>
Tested-by: Chris Masone <cmasone@chromium.org>
/system/connectivity/shill/service.h
f2f68a50aabcde256cabad0041c357cbacaeb3e0 01-Sep-2011 mukesh agrawal <quiche@chromium.org> shill: acquire ip addresses for wifi (via dhcp), and signal when
the service is ready

BUG=chromium-os:20191
TEST=unittest, network_WiFiManager/000_SSID_Length_Limit

note: with this CL, 000_SSID_Length_Limit connects to the
open network, but fails on the hidden network. hidden network
support requires shill to implement Manager.GetService.

Change-Id: I71d1634fb3fc48de36fd2bf828969bfe0b3a46f6
Reviewed-on: http://gerrit.chromium.org/gerrit/7466
Tested-by: mukesh agrawal <quiche@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/service.h
ac4ac00189acd22ce95098712c74e1c2c23ede53 26-Aug-2011 Paul Stewart <pstew@chromium.org> shill: Clean up protected fields

...as per style. I did omit property_store_unittest.h, which I'll
assign to cmasone instead of closing the issue.

BUG=chromium-os:19573
TEST=Rerun unit tests

Change-Id: I37874b6e71f50e91ca753d1ef4f1e25abf77032d
Reviewed-on: http://gerrit.chromium.org/gerrit/6764
Reviewed-by: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
Reviewed-by: Darin Petkov <petkov@chromium.org>
/system/connectivity/shill/service.h
b100ae709f1b774a646d946eae604a2bf6326fd4 25-Aug-2011 Darin Petkov <petkov@chromium.org> shill: Propagate Cellular Activate call errors to the DBus caller.

BUG=chromium-os:19547
TEST=unit tests

Change-Id: I2a0f889f0863c299c3f3ac006a6df5a608407881
Reviewed-on: http://gerrit.chromium.org/gerrit/6616
Reviewed-by: Darin Petkov <petkov@chromium.org>
Tested-by: Darin Petkov <petkov@chromium.org>
/system/connectivity/shill/service.h
03dba0bccc3a39cded5083212e56713a6d349e01 23-Aug-2011 Paul Stewart <pstew@chromium.org> shill: Start assigning service state

Service state is usually controlled by the associated Device. Devices
select a single Service to reflect current connection state. All other
Services remain in an idle or whatever Failure state they ended up with
at the end of their last attempt.

When Service state changes, the service notifies the Manager of its new
state. This will be used by the Manager to update service priority and
selection of default routes.

For unit-tests, add a "State" test for service_unittest which which
tests for state changes and up-calls to the Manager. Add
"SelectedDevice" test to device_unittest to ensure proper down-calls
to the service.

BUG=chromium-os:19523
TEST=New unit tests

Change-Id: Ic253cc1dd77821a74176346521aff5948ad59660
Reviewed-on: http://gerrit.chromium.org/gerrit/6495
Reviewed-by: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/service.h
4d6d941563c2c394e5e650d7ee2d24183fff87b3 24-Aug-2011 Darin Petkov <petkov@chromium.org> shill: Propagate Cellular errors to the DBus caller.

BUG=chromium-os:19547
TEST=unit tests

Change-Id: Ieda54d89d977a48718302c6e1e1c7927e3cf2dba
Reviewed-on: http://gerrit.chromium.org/gerrit/6603
Reviewed-by: Darin Petkov <petkov@chromium.org>
Tested-by: Darin Petkov <petkov@chromium.org>
/system/connectivity/shill/service.h
34af218abe6a99144ffe01332ce36fbad94f2628 22-Aug-2011 Chris Masone <cmasone@chromium.org> [shill] Use flimflam-esque storage ids

Devices:
device_<MAC>

IPConfig:
ipconfig_<MAC of associated device>_0

Services:
ethernet_<MAC of associated device>
wifi_<MAC of associated device>_<SSID>_<mode>_<security>
cellular_<MAC of associated device>_<Network_name>

BUG=chromium-os:17744
TEST=unit

Change-Id: Ibf061f9c184e7c86f5afcf97d48e321fc74bde1c
Reviewed-on: http://gerrit.chromium.org/gerrit/6412
Reviewed-by: Chris Masone <cmasone@chromium.org>
Tested-by: Chris Masone <cmasone@chromium.org>
/system/connectivity/shill/service.h
5148900ad2eb60a07290697446825b16bdc04682 18-Aug-2011 Darin Petkov <petkov@chromium.org> shill: Propagate activation errors to the Cellular service.

Also, use constants from service_constants instead of local string literals for
activate states and errors.

BUG=chromium-os:19305
TEST=unit tests

Change-Id: Ifeb4828b9103e31302d2e25492a6ad6bb00f661e
Reviewed-on: http://gerrit.chromium.org/gerrit/6245
Tested-by: Darin Petkov <petkov@chromium.org>
Reviewed-by: Chris Masone <cmasone@chromium.org>
/system/connectivity/shill/service.h
c408e69059dc709408c1a51f4b757424d08b15f5 17-Aug-2011 Darin Petkov <petkov@chromium.org> shill: Support Cellular CDMA activation.

Still TODO is communicating the activation error codes to the Cellular service.
... And, of course, asynchronous calls throughout.

BUG=chromium-os:19305
TEST=unit tests

Change-Id: I3e0b4a5a8d3c4c74db35ce7f74b5d958677d8b66
Reviewed-on: http://gerrit.chromium.org/gerrit/6192
Tested-by: Darin Petkov <petkov@chromium.org>
Reviewed-by: Chris Masone <cmasone@chromium.org>
/system/connectivity/shill/service.h
51a7e939ed0d260392a40bc5d58e6d2651c6ddc0 28-Jul-2011 mukesh agrawal <quiche@chromium.org> shill: push service naming down into Service class (instead of being
handled in each subclass)

BUG=chromium-os:17974
TEST=FEATURES="test nostrip noclean" emerge-x86-generic shill, and run on device

Change-Id: Ic251fec9c76fec1a4c3aa5ac8d0aba4c664e029d
Reviewed-on: http://gerrit.chromium.org/gerrit/4927
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Tested-by: mukesh agrawal <quiche@chromium.org>
/system/connectivity/shill/service.h
6791a43add38926966bd420e89541717fb2cb2b5 12-Jul-2011 Chris Masone <cmasone@chromium.org> [shill] Enable Profile objects to manage a list of Services to persist.

The Manager will hang on to a list of active services. They will be sorted,
someday, in an order that makes sense. Every service will be associated with
a Profile, though it may the an ephemeral profile that won't persist state to
disk. Profiles will maintain a map of service name to service references to
track the services whose state they persist to disk. Services may move between
Profiles, and will certainly need to be bound to one after they are registered
with the Manager, so support for this is provided as well.

BUG=chromium-os:17436
TEST=unit tests

Change-Id: Id43a0e1d97302b6f574bd2213d4f3d176bb5223f
Reviewed-on: http://gerrit.chromium.org/gerrit/4033
Reviewed-by: Chris Masone <cmasone@chromium.org>
Tested-by: Chris Masone <cmasone@chromium.org>
/system/connectivity/shill/service.h
ba40dd302d1f6f4c38b9449a4e83c3d470159ea1 12-Jul-2011 Darin Petkov <petkov@chromium.org> shill: Initial support for loading and saving of services.

BUG=chromium-os:17255
TEST=unit tests

Change-Id: Ibf2721f72bfd44afbe6be9ac2cce0a2e978465eb
Reviewed-on: http://gerrit.chromium.org/gerrit/3954
Reviewed-by: Chris Masone <cmasone@chromium.org>
Tested-by: Darin Petkov <petkov@chromium.org>
/system/connectivity/shill/service.h
b2e326bf37654683cdc8c0cbbab29d1af7910af8 12-Jul-2011 Chris Masone <cmasone@chromium.org> Re-land "[shill] Get rid of Entry as a first-class citizen""

This reverts commit 7c1ab1cb74bf6397c67e1cdc825043a93c4bce33.

Also, fixes some compile problems that only repro with debug flags
and that cause runtime dbus errors with the new version of libdbus

BUG=chromium-os:17436
TEST=unit tests

Change-Id: I479308e684b802f167788daeaf4ec39d0b63ee17
Reviewed-on: http://gerrit.chromium.org/gerrit/3961
Tested-by: Chris Masone <cmasone@chromium.org>
Reviewed-by: Darin Petkov <petkov@chromium.org>
/system/connectivity/shill/service.h
7c1ab1cb74bf6397c67e1cdc825043a93c4bce33 12-Jul-2011 Chris Masone <cmasone@chromium.org> Revert "[shill] Get rid of Entry as a first-class citizen"

This reverts commit 7c982eade99f01cb6b8719ed4d385c0ec6b50f75

Change-Id: I554c12003c18f09ac7f736e98b9ecd63829100e9
Reviewed-on: http://gerrit.chromium.org/gerrit/3957
Reviewed-by: Chris Masone <cmasone@chromium.org>
Tested-by: Chris Masone <cmasone@chromium.org>
/system/connectivity/shill/service.h
9c9e8fb31c9b39fb2832e0804d5c71b3ef685427 12-Jul-2011 Chris Masone <cmasone@chromium.org> [shill] Get rid of Entry as a first-class citizen

Entry was a bad idea. Instead, merge that stuff back into Service and
make Profile objects just have a list of Services. Live Services will
be registered with Manager; ones that exist only within a Profile will
have to be accessed by querying the Profile over DBus, just like
today.

BUG=chromium-os:17436
TEST=unit tests

Change-Id: Id07d762925b252219aa79340931e34b87f10007e
Reviewed-on: http://gerrit.chromium.org/gerrit/3951
Reviewed-by: Darin Petkov <petkov@chromium.org>
Tested-by: Chris Masone <cmasone@chromium.org>
/system/connectivity/shill/service.h
7aa5f90848b530999d8b6788ecb40aa30871c7ae 11-Jul-2011 Chris Masone <cmasone@chromium.org> [shill] Back property storage in Service objects with Entry objects

Much of Shill Service state is persisted to disk, by creating an Entry
in a Profile. We should store this info just once, so that we don't
have to worry about keeping multiple data stores in sync. This is a
first step in that direction.

BUG=chromium-os:17436
TEST=unit tests

Change-Id: If94db2a38a7d79c56e2c746b2f069cfd7ab4bf65
Reviewed-on: http://gerrit.chromium.org/gerrit/3876
Tested-by: Chris Masone <cmasone@chromium.org>
Reviewed-by: Darin Petkov <petkov@chromium.org>
/system/connectivity/shill/service.h
27c4aa55b33d3a3836cf70c8f7094bce1c5ead8c 02-Jul-2011 Chris Masone <cmasone@chromium.org> [shill] Use composition instead of inheritance with PropertyStore

Instead of having Device, Manager, etc all inherit from PropertyStore
and have it be difficult to follow the getting/setting property code,
have each include a PropertyStore as a data member. Provide an
accessor so that RPC adaptor classes can get and set properties
directly and continue to handle any necessary type conversion
themselves.

BUG=None
TEST=unit tests

Change-Id: I34781bde4de0e152550ca636e28d472abde756af
Reviewed-on: http://gerrit.chromium.org/gerrit/3616
Tested-by: Chris Masone <cmasone@chromium.org>
Reviewed-by: Darin Petkov <petkov@chromium.org>
/system/connectivity/shill/service.h
3c3f6a1dcc0533545f7efb5ffed5a3edc089f240 01-Jul-2011 Chris Masone <cmasone@chromium.org> [shill] Add a few more derived properties of the Manager class

Add properties like Devices, Services -- properties that return object
paths and must be calculated on the fly.

BUG=chromium-os:16343
TEST=unit tests

Change-Id: I4d7e478c2cc574a7006600a1bbcfe9b867d9cb34
Reviewed-on: http://gerrit.chromium.org/gerrit/3555
Reviewed-by: Chris Masone <cmasone@chromium.org>
Tested-by: Chris Masone <cmasone@chromium.org>
/system/connectivity/shill/service.h
95207da4b896bd0a4186163f6f9ebda044a5a7b9 30-Jun-2011 Chris Masone <cmasone@chromium.org> [shill] Enable objects to query an opaque RPC-system ID from Adaptors

This is needed for some properties. For example Service has a property called Device, which is expected
to return a (in the current impl) a DBus path for the associated Device object.

BUG=chromium-os:16343
TEST=unit tests

Change-Id: I8bd32ab483331efabbfee05dbdeba045c7cb20da
Reviewed-on: http://gerrit.chromium.org/gerrit/3417
Reviewed-by: Chris Masone <cmasone@chromium.org>
Tested-by: Chris Masone <cmasone@chromium.org>
/system/connectivity/shill/service.h
2b10554b6c736f3421102d483b74b70bb82f997c 22-Jun-2011 Chris Masone <cmasone@chromium.org> [shill] Use ref-counted pointers more, break unneeded header deps

1) Replace more bare pointers with ref-counted pointers.
2) Move declarations of *RefPtr into a header file with fwd-declared classes
3) Make class headers include that, move inclusion of real headers to .cc files.

BUG=None
TEST=unit tests

Change-Id: I8208c82377c6dbefe6903561a503b8db63f063d6
Reviewed-on: http://gerrit.chromium.org/gerrit/3177
Reviewed-by: Chris Masone <cmasone@chromium.org>
Tested-by: Chris Masone <cmasone@chromium.org>
/system/connectivity/shill/service.h
b925cc8f481d21fddd9569fc68861f6e5b6e3eae 23-Jun-2011 Chris Masone <cmasone@chromium.org> [shill] Add properties to Manager, Device and subclasses. Clean up unit tests

1) Pull much of the properties stuff (the maps, Register*(), Contains()) up
into PropertyStore, and make it a class, not an interface.
2) Add proper property stuff to Manager and Device. Move Cellular- and Wifi-
specific properties to Cellular, CellularService, WiFi, WiFiService as
appropriate.
3) clean up unit tests.

BUG=chromium-os:16343
TEST=unit tests

Change-Id: Iba88f384a5fbe383608cb79fa2134d978f1b81e8
Reviewed-on: http://gerrit.chromium.org/gerrit/3136
Reviewed-by: Chris Masone <cmasone@chromium.org>
Tested-by: Chris Masone <cmasone@chromium.org>
/system/connectivity/shill/service.h
3bd3c8c33917221d1074f1aa19272e45c0ce2793 13-Jun-2011 Chris Masone <cmasone@chromium.org> [shill] Add support for setting properties.

This CL adds a framework for supporting RPC-exposed properties in Shill.
It also plumbs the code for setting properties on Service objects to prove
the approach. Device and Manager settings will follow.

BUG=chromium-os:16343
TEST=build shill, run unit tests.

Change-Id: I55869453d6039e688f1a49be9dfb1ba1315efe0a
Reviewed-on: http://gerrit.chromium.org/gerrit/3004
Reviewed-by: Darin Petkov <petkov@chromium.org>
Tested-by: Chris Masone <cmasone@chromium.org>
/system/connectivity/shill/service.h
afa6fc4d31e884af8710deb14798c69b9c9a898e 22-Jun-2011 Darin Petkov <petkov@chromium.org> shill: Connect Ethernet Device to DHCPConfig.

Most of the implementation is in the base Device class.

BUG=chromium-os:16794
TEST=unit test

Change-Id: I583761f7e54c88b043ce4343cb43f8298aaedf8b
Reviewed-on: http://gerrit.chromium.org/gerrit/2949
Reviewed-by: Darin Petkov <petkov@chromium.org>
Tested-by: Darin Petkov <petkov@chromium.org>
/system/connectivity/shill/service.h
b54601c6f85577ab326da277356b88049d92ee2b 08-Jun-2011 mukesh agrawal <quiche@chromium.org> shill: support association with open wifi access points

with this patch, shill organizes scan results into Endpoints and
Services. although this patch does not communicate information about
Services to the UI, one can connect to an open AP by sending the
appropriate message to shill over D-Bus.

known limitations:
- does not communicate to UI
- creates a Service for every Endpoint (note, however, that this
does not provide the ability to connect to a specific AP)
- only supports open networks

note: a fix to memory management in wifi_integrationtest slipped
into this patch.

BUG=chromium-os:16065
TEST=manual: start shill, use dbus-send to tell shill to connect

Change-Id: I26737f5e61b56497beffb9639f3e347a21ad76d7
Reviewed-on: http://gerrit.chromium.org/gerrit/2910
Reviewed-by: Chris Masone <cmasone@chromium.org>
Tested-by: mukesh agrawal <quiche@chromium.org>
/system/connectivity/shill/service.h
8fe2c7eea92541b5282929361a19ad519e0608a9 10-Jun-2011 Chris Masone <cmasone@chromium.org> [shill] Begin wiring SetProperty

Create a PropertyStoreInterface that can be implemented by Device,
Service, Manager, etc to handle getting/setting of properties. The
various DBusAdaptor subclasses can dispatch incoming calls to their
associated implementation object based on the names of the properties
and/or the types of the arguments.

BUG=chromium-os:16343
TEST=unit tests

Change-Id: If7abb0ffa623e59288943b4ed1f49832a92524ea
Reviewed-on: http://gerrit.chromium.org/gerrit/2408
Reviewed-by: Chris Masone <cmasone@chromium.org>
Tested-by: Chris Masone <cmasone@chromium.org>
/system/connectivity/shill/service.h
c1e50412f45518e23d51ba8bb8694c366943d945 07-Jun-2011 Chris Masone <cmasone@chromium.org> [shill] Start replacing bare pointers with scoped_refptrs where appropriate

BUG=chromium-os:16259
TEST=unit tests

Change-Id: I5e1531b726bbb40917d25dc3ae44da9a6a420e00
Reviewed-on: http://gerrit.chromium.org/gerrit/2236
Tested-by: Chris Masone <cmasone@chromium.org>
Reviewed-by: Darin Petkov <petkov@chromium.org>
/system/connectivity/shill/service.h
a82b7111f2b0515a8d79e6e8034836a5d1342468 26-May-2011 Chris Masone <cmasone@chromium.org> [shill] device, service objects need to register unique paths

BUG=chromium-os:15752
TEST=unit tests

Change-Id: I54a5b1fb3e156fb62ffff0bc49a411135c01a1d0
Reviewed-on: http://gerrit.chromium.org/gerrit/1897
Reviewed-by: Chris Masone <cmasone@chromium.org>
Tested-by: Chris Masone <cmasone@chromium.org>
/system/connectivity/shill/service.h
ba41b99c43de365d3e694e40df6a7647baa075b7 26-May-2011 Paul Stewart <pstew@chromium.org> Use scoped pointer for service adaptor

BUG=n0ne
TEST=Rerun unit tests

Change-Id: Ie72d130ab9c1aa57bbfd48e4a412ec359e662e82
Reviewed-on: http://gerrit.chromium.org/gerrit/1631
Tested-by: Paul Stewart <pstew@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/service.h
9be4a9d1e87d64f850f15061123b2a4334477fa2 17-May-2011 Chris Masone <cmasone@chromium.org> [shill] the beginnings of the data model

Flesh out Manager a little, to add vectors of Device* and Service* and ways to look through them.

BUG=chromium-os:15347
TEST=unit tests

Change-Id: Iae5280f56bf58cf1580f0b87c465f4905459f07a
Reviewed-on: http://gerrit.chromium.org/gerrit/966
Reviewed-by: Chris Masone <cmasone@chromium.org>
Tested-by: Chris Masone <cmasone@chromium.org>
/system/connectivity/shill/service.h
d5843775e98ca18d1e1a6aae26aca951d7c5dc28 12-May-2011 Paul Stewart <pstew@chromium.org> shill: Remove the "resource" superclass

The "resource" superclass was meant at some point to be some
sort of crude mockup of a possible refcounting scheme. Drop
this idea, and use base/ref_counted for Devices which will
likely need multiple entities referencing it.

BUG=chromium-os:12933
TEST=Rebuild

Change-Id: Id267049e881037422271f1611dcc8a5e90e9abac
Reviewed-on: http://gerrit.chromium.org/gerrit/723
Reviewed-by: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/service.h
413a3191a9a177c90e60fa24d5e86eac739549cf 10-May-2011 Chris Masone <cmasone@chromium.org> [shill] Add wpa_supplicant API spec to shill. Also, change 'proxy' -> 'adaptor'

Add the XML description of the wpa_supplicant DBus API, so we can
generate client (proxy object) bindings for it. to use these
bindings, #include "shill/supplicant_cli.h" and then inherit from the
appropriate class in the fi::w1::wpa_supplicant1 namespace.

For example, for the WPA supplicant "Network" interface:

class SupplicantNetworkProxy : public fi::w1::wpa_supplicant1::Network_proxy {
public:
SupplicantNetworkProxy() {}
virtual ~SupplicantNetworkProxy() {}

// All signal handlers are abstract in the base class; implement them all here
virtual void PropertiesChanged(
const std::map< std::string, ::DBus::Variant >& properties) {
return;
}

// Methods are all implemented for you, as are accessors for properties.
};

BUG=chromium-os:15092
TEST=build

Change-Id: I55e42148bc64965317e7223c852707ed6359b0bc
Reviewed-on: http://gerrit.chromium.org/gerrit/572
Reviewed-by: Chris Masone <cmasone@chromium.org>
Tested-by: Chris Masone <cmasone@chromium.org>
/system/connectivity/shill/service.h
75897df1154ac38b7a4512a687241ad6a197ee40 27-Apr-2011 Paul Stewart <pstew@chromium.org> Add initial sketch to shill repository

BUG=chromium-os:12066
TEST=command-line

Change-Id: If1d01bf78fca80de4cc8a26e096e1967293d9738

Review URL: http://codereview.chromium.org//6575006
/system/connectivity/shill/service.h