History log of /system/connectivity/shill/default_profile.cc
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/default_profile.cc
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/default_profile.cc
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/default_profile.cc
289a5a5e18bb1a676b3dfce111af4c2c00c7776e 21-Sep-2015 Samuel Tan <samueltan@google.com> shill: use different service_constants.h path for Android builds

Use the service_constants.h file from the external/cros/system_api/dbus
instead of chromeos/dbus/service_constants.h, since this header file
is installed into different directories when building shill for Android
and Chrome OS.

BUG: 22956441
Change-Id: I7e6ea46b4893588d2862792cf43aa83fdf7c30b4
TEST: shill still compiles using emerge.
/system/connectivity/shill/default_profile.cc
e48186532acb04b9e11efc9b9334dd555ffcae29 29-Aug-2015 mukesh agrawal <quiche@chromium.org> shill: use 'json' extension for JsonStore profiles

To avoid any confusion between files using different formats,
we want KeyFileStore profiles and JsonStore profiles to have
different names. So add '.json' to the file name when using
JsonStore as the backend.

Note: initially, I wanted to isolate the ENABLE_JSON_STORE
dependent code to just StoreFactory. But I've come to change
my mind on that.

The reason for my change of mind is that {Default}ProfileTest
checks the actual path that will be used when writing the file.
And that seems like an appropriate thing to test. But, to do
that, {Default}ProfileTest needs to know when backend we're
using.

So we need ENABLE_JSON_STORE checks in {Default}ProfileTest.
And once we've done that, it seems silly, and unnatural, to
hide this information from Profile.

Along the way:
- Move path computation from InitStorage() and RemoveStorage(),
into the {Default}Profile constructor. This makes the code
slightly simpler (removing a virtual method) and shorter.
- Provide a method for tests to query the path that Profile
would use, so that we don't duplicate path computation logic.
- Remove |storage_path_| field, since it was only needed to
compute the path of the persistent file.

While there:
- Rename |store_path| argument to DefaultProfile ctor. It's
unclear whether such a "path" should refer to a directory
or a file.
- Rename |user_storage_directory| argument to Profile ctor.
This name makes no sense when the Profile ctor is being
called from the DefaultProfile ctor.

Bug: 23561491
TEST="USE=json_store FEATURES=test emerge-samus shill"

Change-Id: I9b7e9b04dc80c89c20ea43158ed293b8a50fadbf
/system/connectivity/shill/default_profile.cc
44b9934a9528c0c19c82e0c6a79642eefeb54ea2 22-Sep-2015 mukesh agrawal <quiche@google.com> shill: DefaultProfile: remove redundant field

Once upon a time [1], DefaultProfile had a |storage_path_|,
and Profile had a |storage_format_|. After many moons had
passed [2], we changed Profile's |storage_format_| into a
|storage_path_|.

Ever since, our DefaultProfile instances have had multiple
|storage_path_| fields. The first is the (inherited) private
|storage_path_| member of Profile. The second is the private
|storage_path_| member of DefaultProfile itself.

Having a child class member variable shadow a parent class
member variable is more than a little confusing. So put an
end to that nonsense.

[1] http://crosreview.com/6454
[2] http://crosreview.com/197061

Bug: None
TEST=unit tests

Change-Id: I40c051fdd1881a6d3055802d7b6dd8161b7a402f
/system/connectivity/shill/default_profile.cc
d48e8140b17d9f04e9848e1e638c483450a5dcfc 22-Sep-2015 mukesh agrawal <quiche@google.com> shill: Profile: change ctor arg type from string to FilePath

The |user_storage_directory| argument to the Profile ctor
is stored inside the Profile object as a FilePath, and the
DefaultProfile ctor takes its path argument as a FilePath.

Both of these facts argue for |user_storage_directory| to
be passed in as a FilePath, rather than a string.

Make it so.

Bug: None
TEST=unit tests

Change-Id: I6094aeb44de96ccd0312c5311bdd195ee64cf510
/system/connectivity/shill/default_profile.cc
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/default_profile.cc
a794cd60a7339d576ea2eed263a4f0a20fb255af 16-Jun-2015 Paul Stewart <pstew@chromium.org> shill: Top-level files a-e: Switch pointer/ref spacing

Switch to Chrome style spacing.

BUG=chromium:501026
TEST=Unit tests

Change-Id: Idb7252202e142098999fe0672712aded7d369259
Reviewed-on: https://chromium-review.googlesource.com/278038
Reviewed-by: Rebecca Silberstein <silberst@chromium.org>
Commit-Queue: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/default_profile.cc
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/default_profile.cc
ff6be29bd74abd31640abcf9ad4332e0a9657196 25-Nov-2014 Paul Stewart <pstew@chromium.org> shill: Manager: Add ProhibitedTechnologies property

Add a Manager property for the list of technologies that should
be prohibited from enablement through D-Bus APIs. New devices
that appear will similarly start in the disabled state and cannot
be enabled. Removing a technology from the prohibited list does
not re-enable any devices that were previously disabled.

CQ-DEPEND=CL:231738
BUG=chromium:436336
TEST=Unit tests
Also manual:
dbus-send --system --print-reply --fixed \
--dest=org.chromium.flimflam / \
org.chromium.flimflam.Manager.SetProperty \
string:ProhibitedTechnologies \
variant:string:wifi

At this point, WiFi is disconnected and disabled, and cannot
be re-enabled via the UI. Changing "wifi" to "wimax" above
causes it to be possible to enable WiFi in the UI again.

Change-Id: I2e95cb5e95913739ccd54457bec778951af4dae6
Reviewed-on: https://chromium-review.googlesource.com/231739
Reviewed-by: Ben Chan <benchan@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
Commit-Queue: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/default_profile.cc
d6a8b519e3057f52313e502f502a4819a942e089 18-Nov-2014 Ben Chan <benchan@chromium.org> shill: wifi: Move wifi code to its own sub-directory.

This CL is part of a series of CLs, which aim to reorganzie shill's flat
source code structure into a more modular form by moving technology
specific code into their own sub-directories.

BUG=chromium:433419
TEST=`FEATURES=test emerge-$BOARD shill`
TEST=`USE='clang asan' FEATURES=test emerge-$BOARD shill`

Change-Id: Ic6bf64e7fe263fd0b2277877d78cf776f179e7d7
Reviewed-on: https://chromium-review.googlesource.com/230460
Reviewed-by: Paul Stewart <pstew@chromium.org>
Tested-by: Ben Chan <benchan@chromium.org>
Commit-Queue: Ben Chan <benchan@chromium.org>
/system/connectivity/shill/default_profile.cc
3d49ea435a59436f762c2cc5e750ff27ece0d3c5 21-Aug-2014 Rebecca Silberstein <silberst@chromium.org> shill: Create ConnectivityTrial class to hold logic for connection tests

Create a new class, ConnectivityTrial, that contains the logic and handling
for each attempt in portal detection. This separates the higher level logic
of retries and maximum number of attempts from the individual connection tests.

This architectural change enables code-reuse for an upcoming feature for on
demand connection testing.

BUG=chromium:402888
TEST=ran shill unit tests and tested on peppy

Change-Id: I90d2bca4cd0778c3aeac82677b675247769a5597
Reviewed-on: https://chromium-review.googlesource.com/216505
Commit-Queue: Rebecca Silberstein <silberst@chromium.org>
Tested-by: Rebecca Silberstein <silberst@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/default_profile.cc
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/default_profile.cc
37c5d94cd4120fddb1b38fba0dc04cf7087e5ac5 18-Jun-2014 Alex Vakulenko <avakulenko@chromium.org> shill: replace rand() with std::default_random_engine

Replace rand() with STL random number generator to have
superior quality of random numbers, thread safety and
stop linter from complaining.

BUG=None
TEST=Unit tests pass.

Change-Id: I80da776c70bbd8bffe10916554393621ad60131e
Reviewed-on: https://chromium-review.googlesource.com/204430
Tested-by: Alex Vakulenko <avakulenko@chromium.org>
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Commit-Queue: Alex Vakulenko <avakulenko@chromium.org>
/system/connectivity/shill/default_profile.cc
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/default_profile.cc
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/default_profile.cc
a0ddf46e466bd4ba3d20952f0a6988c680c1af14 06-Feb-2014 Ben Chan <benchan@chromium.org> shill: Update to build against libchrome-242728.

BUG=chromium:341521
CQ-DEPEND=CL:193660
TEST=Tested the following:
1. `FEATURES=test USE='cellular wimax' emerge-$BOARD platform2`
2. Run the following tests:
- network_3GSmokeTest
- network_VPNConnect.*
- network_WiMaxSmoke
- wifi_matfunc

Change-Id: Ic1553c182ab7a833a68c45f012f646b8930cb095
Reviewed-on: https://chromium-review.googlesource.com/193606
Reviewed-by: Ben Chan <benchan@chromium.org>
Tested-by: Ben Chan <benchan@chromium.org>
Commit-Queue: Ben Chan <benchan@chromium.org>
/system/connectivity/shill/default_profile.cc
92496a43b023b912f7f251d0167be360b3335690 09-Apr-2014 mukesh agrawal <quiche@chromium.org> shill: improve out-of-disk handlng

At present, shill deals poorly with the case where no default profile
exists, and no default profile can be created. In particular, it aborts
in this case. Consequently if the disk is full, and no default profile
is present, shill gets in to a crash loop.

Remedy this by adding a StubStorage class, and using this to back
the DefaultProfile, if we can't back the DefaultProfile with a file
on disk.

One of the alternatives considered was to back the DefaultProfile
using a file in /tmp. This approach seems simpler, in that we don't
need to worry about securing the file in /tmp, or about the
possibility that /tmp is also full.

While there:
- Add DISALLOW_COPY_AND_ASSIGN to the Manager class.
- Make Manager::LoadProperties and Profile::LoadManagerProperties
return void instead of bool. Previously, Profile::LoadManagerProperties
would always return true. That would cause Manager::LoadProperties
to always return true. Seems simpler to return void.
- Fix a grammar nit in profile.cc.
- Fix a typo in profile.h.

BUG=chromium:355140
TEST=network_DiskFull, unit tests

Note that the network_DiskFull may report failures due to
metrics_daemon not running. However, the test should not show
any errors related to shill or flimflam.

Change-Id: Ic081a40d7680ce035ead1459a08bf63e7989f0d6
Reviewed-on: https://chromium-review.googlesource.com/193693
Tested-by: mukesh agrawal <quiche@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Commit-Queue: mukesh agrawal <quiche@chromium.org>
/system/connectivity/shill/default_profile.cc
39a7beb18a0c24c9b73c3cc49008ccdca19f9ac2 21-Sep-2013 Ben Chan <benchan@chromium.org> shill: Remove unnecessary shill:: namespace prefixes.

BUG=chromium:295425
TEST=Unit tests and trybot runs on release builders.

Change-Id: I4ed16404ab9aee79c70c7dc958ec825696214e35
Reviewed-on: https://chromium-review.googlesource.com/170248
Tested-by: Ben Chan <benchan@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Commit-Queue: Ben Chan <benchan@chromium.org>
/system/connectivity/shill/default_profile.cc
5dc58814ae6b1a40f77255986188e43817361ae0 20-Sep-2013 Ben Chan <benchan@chromium.org> shill: profile: 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 profile code.

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

Change-Id: I8b9cb3b3509479f58313ac48a98b3a8b506b8d74
Reviewed-on: https://chromium-review.googlesource.com/170206
Reviewed-by: Paul Stewart <pstew@chromium.org>
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Tested-by: Ben Chan <benchan@chromium.org>
Commit-Queue: Ben Chan <benchan@chromium.org>
/system/connectivity/shill/default_profile.cc
60a3706bee5686ae2322a774b9e7d5e8e63fcaf7 02-Apr-2013 Wade Guthrie <wdg@chromium.org> shill: Keeps track of successful wifi connection frequencies.

Saves the connection frequencies (and counts therefor) in the default
profile. Sends number of frequencies on which successful connections
have been made to an UMA stat.

BUG=chromium:222081
TEST=unittests and manual (look for UMA stat
'Network.Shill.Wifi.FrequenciesConnectedEver', disconnect from
wifi, reconnect, verify that the UMA stat went up by 1).

Change-Id: I1e3c75b82ac387dd01066c4da4ebfce2c4b2ddc0
Reviewed-on: https://gerrit.chromium.org/gerrit/47154
Commit-Queue: Wade Guthrie <wdg@chromium.org>
Reviewed-by: Wade Guthrie <wdg@chromium.org>
Tested-by: Wade Guthrie <wdg@chromium.org>
/system/connectivity/shill/default_profile.cc
23ac6b72d44c446bca88175883ba26b39c5ed817 01-Feb-2013 mukesh agrawal <quiche@chromium.org> shill: Revert "shill: resolver: Use (even) smaller DNS timeout"

The short DNS timeout was intended to work around an issue with
some DNS servers. The belief was that the DNS failure was
transient, and that a quick retry would improve DNS lookup times.

Field results didn't show any improvement, so back out this change.

Note further that, as of M25 stable, Chrome uses its own DNS
resolver. That resolver has a fixed one second timeout for the
first try, and exponential backoff thereafter.

Consequently, if this code remained in the tree, this code would
only affect system processes.

BUG=chromium:220150
TEST=unit tests

This reverts commit bf667617d573e3af4b808ed317b1d6ca04747ee4.

Conflicts:

connection.cc
connection_unittest.cc
default_profile_unittest.cc
manager.cc
manager.h
mock_resolver.h
resolver.cc
resolver.h
resolver_unittest.cc

Change-Id: Ic96c6c014a973de441ab1771539a0d9f3d5c5967
Reviewed-on: https://gerrit.chromium.org/gerrit/46944
Reviewed-by: Paul Stewart <pstew@chromium.org>
Commit-Queue: mukesh agrawal <quiche@chromium.org>
Tested-by: mukesh agrawal <quiche@chromium.org>
/system/connectivity/shill/default_profile.cc
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/default_profile.cc
5133b71eaa00535739ebbddd8a8f31cd8fcf33a8 19-Feb-2013 Thieu Le <thieule@chromium.org> shill: Add metric to track corrupted profiles

New metric Network.Shill.CorruptedProfile.

BUG=chromium-os:38669
TEST=1. Unit tests
2. Stop shill
Corrupt /var/cache/shill/default.profile by adding junk
Start shill
Verify new metric appears in chrome://histograms

Change-Id: I629ed00884ecd2d2fe90744583bd72bf2e9e6af4
Reviewed-on: https://gerrit.chromium.org/gerrit/43556
Reviewed-by: Thieu Le <thieule@chromium.org>
Tested-by: Thieu Le <thieule@chromium.org>
Commit-Queue: Thieu Le <thieule@chromium.org>
/system/connectivity/shill/default_profile.cc
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/default_profile.cc
4d5efb7d5d130e3e6e52ab732127a273bcb95261 17-Sep-2012 Paul Stewart <pstew@chromium.org> shill: Ignore certan DNS search paths

Add a manager property to provide a list of DNS Search paths
that should be ignored when applying DHCP parameters. This
covers a list of DNS search suffixes that are popularly
provided, but are generally unlikely to provide any useful
results, therefore significantly reducing DNS lookup performance.

BUG=chromium-os:34495
TEST=Unit-tests + Manual: Add a domain to the default search list and make sure it is filtered from the "search" line in resolv.conf.
CQ-DEPENDS: I54bdd33a05bb704d8c3ff05f71e034fe42635e89

Change-Id: Id92b39f1ad0ae64b3ff50c7671cdf388d92a07af
Reviewed-on: https://gerrit.chromium.org/gerrit/33460
Reviewed-by: Christopher Wiley <wiley@chromium.org>
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Commit-Ready: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/default_profile.cc
036dba0c6641acdbe02d52260c6fa6dca84b1af2 07-Aug-2012 Paul Stewart <pstew@chromium.org> shill: Device: Add LinkMonitor

Start link monitoring for technologies for which it is enabled.
Add facilities in the manager and default profile to determine
and persist a list of technologies for which link monitoring
is enabled. Provide a means for the Device to report the current
rolling average LinkMonitor response time.

BUG=chromium-os:32600
TEST=Unit tests

Change-Id: I39dcc8ce2332d7be3c95d9953b4ae7d7172d7df1
Reviewed-on: https://gerrit.chromium.org/gerrit/29731
Commit-Ready: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/default_profile.cc
bf667617d573e3af4b808ed317b1d6ca04747ee4 29-Jun-2012 Paul Stewart <pstew@chromium.org> shill: resolver: Use (even) smaller DNS timeout

Use the new glibc facility for sub-second timeouts, and choose
300 milliseconds for the timeout. However, only do this by
default for Ethernet and WiFi networks, since VPN networks
in particular have trouble with this configuration (due to many
name servers and search domains, as well as the additional
latency inherent to such networks). Also, increase the number
of attempts, so we still spend a reasonable amount of time
overall waiting for a DNS response.

Provide a means to change which technologies are setup in this
manner.

BUG=chromium-os:29124
TEST=Manual: Install connection manager, verify via strace that
gethostbyname now waits 300 ms, and retries 15 times per trial (*).
Ensure Chromium continues to work correctly under light loads.
Also, connect via Verizon and VPN and ensure DNS parameters
are back to the long timeout.
List manager properties and ensure it says "ethernet,wifi" for
ShortDNSTimeoutTechnologies and that this is saved out to the
profile.
New unit tests.
CQ-DEPENDS=Ib9ffc59bbfcd5bf3f57d146965c5a43a936348f8

*: Each trial consists of a nameserver / IP address pair, so
for example, if we have IPv6 connectivity and have two "server"
entries in resolv.conf, we first do 30 tries of IPv6 requests,
alternating between the two servers, then another 30 alternating
IPv4 requests between them. This was tested by intentionally
making the DNS server unreachable and instrumenting the gethostbyname
request via strace.

Change-Id: Idd331b4a9fcf96d457ab9959537aefcb86328e12
Reviewed-on: https://gerrit.chromium.org/gerrit/26493
Commit-Ready: Paul Stewart <pstew@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/default_profile.cc
212d60f4de8a17702dc824f4a56d7de884e18e27 12-Jul-2012 Paul Stewart <pstew@chromium.org> shill: Manager: Take over responsibility for device save

Move the responsibility of saving devices from the default
profile to the Manager. This removes an awkward setup where
the DefaultProfile asks for and iterates the Manager's device
list. Instead, call UpdateDevice on each device on
Manager::Stop().

This has a positive side effect that newly created default
profiles (such as those created during autotests) do not
end up with device entries for all devices, but only the
ones persisted while the profile is in use.

This also allows the Manager to take charge of persisting
device state to disk while deregistering, so that the most
recent snapshot of the device is saved before it is removed
from memory.

BUG=chromium-os:31584
TEST=Expanded unit tests.

Change-Id: Id2eb916b0b33d038847248a88312fb6899b3f717
Reviewed-on: https://gerrit.chromium.org/gerrit/27299
Reviewed-by: Ben Chan <benchan@chromium.org>
Reviewed-by: Darin Petkov <petkov@chromium.org>
Commit-Ready: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/default_profile.cc
e7c6ad35cafed32a0fd1390487c74e66eae1961d 29-Jun-2012 Darin Petkov <petkov@chromium.org> shill: Add Profile and Manager UpdateDevice support.

UpdateDevice persists Devices into profiles. It's similar to UpdateService,
however, only the topmost DefaultProfile handles UpdateDevice. Use UpdateDevice
to persist Device's Enabled and Cellular's AllowRoaming properties. Remove now
unused Manager::SaveActiveProfile method to avoid confusion.

BUG=chrome-os-partner:10178,chromium-os:32230
TEST=unit tests

Change-Id: I1d293fa84e0bce3156943e8e9d313fc98facbde1
Reviewed-on: https://gerrit.chromium.org/gerrit/26405
Tested-by: Darin Petkov <petkov@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Reviewed-by: Ben Chan <benchan@chromium.org>
Commit-Ready: Ben Chan <benchan@chromium.org>
/system/connectivity/shill/default_profile.cc
d408fdf69489e3199c63796a06f7cfbbb4513515 08-May-2012 Paul Stewart <pstew@chromium.org> shill: Add ArpGateway and network-based leases

Add two arguments to the DHCP client:
- Turn on ArpGateway (ARP for default gateway in order to test validity
of lease) by default, and use the same manager flag as flimflam did.

- Use per-network lease files for Ethernet and WiFi. This means that
multiple leases can be held in parallel for different Ethernet devices
and WiFi SSIDs.

Bonus changes: Fix DHCP lease filename template which was broken in flimflam
and ported with full fidelity to shill. Make removal of old lease files
conditional on whether the lease file was non-default.

BUG=chromium-os:25717,chromium-os:16885
TEST=New unit tests + manual: Ensure dhcpcd runs with correct arguments ("-R"
added when ArpGateway is enabled on the manager, no "-R" otherwise), and that
the "set_arpgw" command in crosh works correctly. Monitor dhcpcd command line
for new lease suffix parameter, and ensure that leases are being written out
to those files, and that the files are not being removed on program exit.
CQ-DEPEND=Iac282c1686695239a790bbcc0d110c6a69bf45e0

Change-Id: I68bb3cbd18c95f01003eaf049fa60aad446f8116
Reviewed-on: https://gerrit.chromium.org/gerrit/22065
Commit-Ready: Paul Stewart <pstew@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/default_profile.cc
f284a231d015890de8b02041a9ba9164c66c99d7 01-May-2012 Paul Stewart <pstew@chromium.org> shill: Give Ethernet services an affinity to the default profile

When an ethernet service is created, save it to the default profile
by default. This way, if static IP parameters are assigned to it,
it is shared globally instead of for only the logged-in. This is
a reasonable default for services that are enabled by a physical
connection. RPC callers are free to reassign the ethernet service
to a different profile, and this selection will be honored going
forwards.

BUG=chromium-os:23930
TEST=New unit tests; manual -- plug in ethernet while logged in and
ensure ethernet is added to the global profile.

Change-Id: I24e71bacc8c4bd015c2cdbb0039eb54d85dc5b65
Reviewed-on: https://gerrit.chromium.org/gerrit/21524
Reviewed-by: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
Commit-Ready: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/default_profile.cc
d0a3b812f68e3c3f2e1739c2bb32ad305edc121c 29-Mar-2012 Paul Stewart <pstew@chromium.org> shill: Allow creation and push of DefaultProfile

Add the ability to create a DefaultProfile whose name is not
"default". Add the ability to push a DefaultProfile atop
another DefaultProfile in the Manager. This will enable
autotests to run that can test interactions between profiles
while a user is not logged in.

BUG=chromium-os:24461
TEST=New unit tests; autotests to come

Change-Id: Iccfcff6ec613cf0a8ac55c11c9cc1efac8237807
Reviewed-on: https://gerrit.chromium.org/gerrit/19287
Reviewed-by: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
Commit-Ready: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/default_profile.cc
f555cf8aac732cbe02913293ac6253629ade9be5 15-Mar-2012 Paul Stewart <pstew@chromium.org> shill: Initialize portal list to sane default

BUG=chromium-os:27861
TEST=Modified unit test, verified on real system

Change-Id: I77dafefcfd76cc9b5ffe0b23f0b040ba896c2069
Reviewed-on: https://gerrit.chromium.org/gerrit/18282
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Commit-Ready: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/default_profile.cc
c681fa0742cabc686ccabaf0fdf6ce12dd7046b2 03-Mar-2012 Paul Stewart <pstew@chromium.org> shill: portal: Recheck portal state

Introduce a retry interval for automatically retrying portal
checks. Also provide a Manager API method for immediately
re-checking portal status.

BUG=chromium-os:27335
TEST=New unit tests, tested on real machine, including setting
PortaCheckInterval over DBus, and using Jason's addition to
test-flimflam for 'recheck-portal'.
Change-Id: Idc7def18c6f863859e94f4d4e9f266ab2670679c
Reviewed-on: https://gerrit.chromium.org/gerrit/17367
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Commit-Ready: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/default_profile.cc
e692740c0623d4cb5d92d36214982ee45a03a5db 24-Jan-2012 Paul Stewart <pstew@chromium.org> shill: Add Portal Detection object

Add a utility object that will perform a repeated test of an
HTTP URL and return the result to a callback.

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

Change-Id: I0449dbe51fb1dcef2ecd3bb88de1bcaf2950f749
Reviewed-on: https://gerrit.chromium.org/gerrit/15472
Commit-Ready: Paul Stewart <pstew@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/default_profile.cc
d32f484b91ab583ccc9a14b2a6b5182fda6958f0 12-Jan-2012 Paul Stewart <pstew@chromium.org> shill: Pass a parameter to dhcp client to request a hostname

This will enable dynamic DNS, or at the very least allow DHCP
requests to be identified and distinguished at the server side.

BUG=chromium-os:23741
TEST=New unit tests monitor hostname arg passed to dhcpcd,
and to assure values are being loaded/saved. Also double
checked on real system by doing a dbus-send to set manager.HostName
and checked that the name was persisted, and that the next
DHCP server we connected to stored this hostname.
CQ-DEPEND=Ic807a2235e0cdcb32a08f9c2c760a86c3579431c

Change-Id: Ic127b65d8563b15e55549a0f029385d0632eaf6c
Reviewed-on: https://gerrit.chromium.org/gerrit/14045
Reviewed-by: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
Commit-Ready: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/default_profile.cc
870523b9e568c2b1a906426570cbc65e5149c858 12-Jan-2012 Paul Stewart <pstew@chromium.org> shill: Load values from the global profile into the manager

We persist parts of the manager's state to the global profile.
This CL allows it to load that state back in.

BUG=chromium-os:24991
TEST=New unit tests + manual (stop shill, change profile, restart shill,
make sure newly written out profile retains the change even if new
device entries have been written out)

Change-Id: I375d978be023d62d2a36d7239bc794be44dda593
Reviewed-on: https://gerrit.chromium.org/gerrit/14042
Reviewed-by: Thieu Le <thieule@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/default_profile.cc
b9c00597eb1f6d2560f7e88cb0d1f627228840d4 06-Oct-2011 Chris Masone <cmasone@chromium.org> [shill] Profiles need to own their own storage

We're moving to a model where we rely on the StoreInterface
implementation to maintain profile state, instead of managing
a list of Service objects manually. Thus, we need to allow
Profile to own its own StoreInterface.

BUG=chromium-os:17253
TEST=unit

Change-Id: Ie62462686ecf598efeac08a2d3180cd372430bb9
Reviewed-on: http://gerrit.chromium.org/gerrit/9916
Commit-Ready: Chris Masone <cmasone@chromium.org>
Reviewed-by: Chris Masone <cmasone@chromium.org>
Tested-by: Chris Masone <cmasone@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/default_profile.cc
877ff9894e21c4c78b63777025f6c8d577ccd855 22-Sep-2011 Chris Masone <cmasone@chromium.org> [shill] Enable default profile to persist device info

Make Profile::Save() take a pointer to a vector of DeviceRefPtrs. The base
implementation ignores this pointer, but the DefaultProfile implementation
persists all the devices to disk.

BUG=chromium-os:17254
TEST=unit
STATUS=Verified

Change-Id: I5d72bd2319edfb9ae57366cbd5c766b558ffc8a4
Reviewed-on: http://gerrit.chromium.org/gerrit/8057
Commit-Ready: Chris Masone <cmasone@chromium.org>
Tested-by: Chris Masone <cmasone@chromium.org>
Reviewed-by: Darin Petkov <petkov@chromium.org>
/system/connectivity/shill/default_profile.cc
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/default_profile.cc
aa48237c7b263ae44f94e3631ac9c9c18b0467df 15-Sep-2011 Chris Masone <cmasone@chromium.org> [shill] Save profile specific data

BUG=chromium-os:17253
TEST=unit

Change-Id: I1ae28e1f42f4c0bf132cb28df9f334dfa1ca6795
Reviewed-on: http://gerrit.chromium.org/gerrit/7831
Reviewed-by: Darin Petkov <petkov@chromium.org>
Tested-by: Chris Masone <cmasone@chromium.org>
/system/connectivity/shill/default_profile.cc
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/default_profile.cc
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/default_profile.cc
2ae797d040b7261a5619c750e07037566bcb542b 24-Aug-2011 Chris Masone <cmasone@chromium.org> Re-land "[shill] Provide a cmd line toggle between flimflam and shill storage dirs"

This is so that we can easily switch to (and away from) using
the flimflam profile dir (and user profile dirs) when we start shill.

BUG=chromium-os:17253
TEST=unit

Change-Id: I0264162665607bb180688428c4640e42383ae355
Reviewed-on: http://gerrit.chromium.org/gerrit/6568
Reviewed-by: Chris Masone <cmasone@chromium.org>
Tested-by: Chris Masone <cmasone@chromium.org>
/system/connectivity/shill/default_profile.cc
7156c923c9a9d2240ea9c62045337ac8c8f89e57 24-Aug-2011 Chris Masone <cmasone@chromium.org> Revert "[shill] Provide a cmd line toggle between flimflam and shill storage dirs"

This reverts commit 54c93e972563b713030a15ce3c1c1824800e317f

Change-Id: Id4bf4ee1e7e62efea5d116507d8b49d76a7a9556
Reviewed-on: http://gerrit.chromium.org/gerrit/6567
Reviewed-by: Chris Masone <cmasone@chromium.org>
Tested-by: Chris Masone <cmasone@chromium.org>
/system/connectivity/shill/default_profile.cc
6402e501258c9f64373dcd05271c6c7dd75e20bc 23-Aug-2011 Chris Masone <cmasone@chromium.org> [shill] Provide a cmd line toggle between flimflam and shill storage dirs

This is so that we can easily switch to (and away from) using
the flimflam profile dir (and user profile dirs) when we start shill.

BUG=chromium-os:17253
TEST=unit

Change-Id: I9352cf5c40a8f77bcda8cdc0b5912782b4e342ed
Reviewed-on: http://gerrit.chromium.org/gerrit/6454
Reviewed-by: Chris Masone <cmasone@chromium.org>
Tested-by: Chris Masone <cmasone@chromium.org>
/system/connectivity/shill/default_profile.cc
7df0c672458bee8f4ff33004103351d59a9f4b50 15-Jul-2011 Chris Masone <cmasone@chromium.org> [shill] Start cleaning up some of the naming confusion

We have, so far, not been tidy wrt our objects naming themselves,
for human-readable stuff, RPC-path stuff, etc.

This starts to clean up some of that confusion.

BUG=chromium-os:17744
TEST=unit tests

Change-Id: If4d7f61ba51e527984328a0ccdf4dec461b36074
Reviewed-on: http://gerrit.chromium.org/gerrit/4311
Reviewed-by: Chris Masone <cmasone@chromium.org>
Tested-by: Chris Masone <cmasone@chromium.org>
/system/connectivity/shill/default_profile.cc
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/default_profile.cc
a4766822880815bafdc69778ccaccaf661536181 07-Jul-2011 Darin Petkov <petkov@chromium.org> shill: Support for profile identifiers, and creating persistent storage.

BUG=chromium-os:17252
TEST=unit tests

Change-Id: Iaec7b6b5737a997fde3d5215196fdcbf72eefe09
Reviewed-on: http://gerrit.chromium.org/gerrit/3749
Tested-by: Darin Petkov <petkov@chromium.org>
Reviewed-by: Chris Masone <cmasone@chromium.org>
/system/connectivity/shill/default_profile.cc
88cbd5f509862f746abbfe99df0605dcc0de40b0 03-Jul-2011 Chris Masone <cmasone@chromium.org> [shill] Add properties to Profiles.

There are several properties of the Manager that are reflected only in
the default Profile. We create a subclass for this special type of
profile and hand it a const ref to the properties of the Manager class
so it can provide read-only access to these values via RPC.

BUG=chromium-os:17261
TEST=unit tests
STATUS=Verified

Change-Id: I6fa9f2549a0e1af1b9523206bad8ee17e133f399
Reviewed-on: http://gerrit.chromium.org/gerrit/3620
Reviewed-by: Chris Masone <cmasone@chromium.org>
Tested-by: Chris Masone <cmasone@chromium.org>
/system/connectivity/shill/default_profile.cc