History log of /system/connectivity/shill/device_info_unittest.cc
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
3a62e235646ec19bee71e8dbee5208282dcd13b5 20-Jan-2016 Alex Vakulenko <avakulenko@google.com> shill: Update libchrome APIs to r369476

The new libchrome has been ported from Chromium and some APIs have
changed. Make necessary changes at call sites.

Change-Id: Ib4c4b5438a2e249777c9c1b6509f085ad5d00049
/system/connectivity/shill/device_info_unittest.cc
8ce932a8ebf3af11f17b814c4e544a305607afca 10-Dec-2015 Christopher Grant <cjgrant@google.com> shill: do not configure blacklisted devices

Devices that aren't managed by shill should not be configured. Pull
configuration out of the Device class constructor, such that DeviceStub
can override with an empty implementation.

Bug: 26112107
TEST=Added new unit test; passed existing tests; manual testing.

Change-Id: Iab697bb27d3894eac8e681269a3a408b0cd07019
/system/connectivity/shill/device_info_unittest.cc
241e3f317fe3089dd7dcb4e7c5a34430926d4e2e 27-Oct-2015 Paul Stewart <pstew@google.com> shill: DeviceInfo: Prefer non-deprecated IPv6 addresses

When choosing a winner in DeviceInfo::GetPrimaryIPv6Address,
consider whether the addresses are deprecated, and prefer
non-deprecated addresses to deprecated ones.

BUG:25291735
TEST:New unit test

Change-Id: Ia1afe1586758fbe5f22d2bbbf431db430bcb58f0
/system/connectivity/shill/device_info_unittest.cc
d84f367304e8eec21f235392c57bfc1a30540609 22-Oct-2015 Paul Stewart <pstew@google.com> shill: Re-enumerate renamed devices if they were blacklisted

In general, shill ignores name changes on devices. For
Chrome OS systems renames never happen unless done in dev
mode from the command line. In other systems than Chrome OS
where shill is used there may be udev rules or other actors
that rename devices while shill is running.

In the case where shill creates a Device instance and is
actively using the device while it is renamed, this causes
a number of problems since the Device instance has changed
names and a number of operations shill performs on the
device will continue to use the defunct name. This CL
does not address this scenario.

Instead, this CL addresses a more easy-to-handle case
where shill first discovers a blacklisted device and
hence does not actively use it. If such a device is
renamed, shill will now act as if the device has been
newly added, possibly undoing the blacklist. This allows
use cases where the role of a device when it appears is
not known ahead of time and some system service will
assign it to a known role later.

To implement this, the code for retrieving a link name
from an RTNL message is factored out and used in a new
helper method that tests whether an incoming RTNL message
indicates a device rename of a previously blacklisted
device.

BUG=chrome-os-partner:42699
TEST: New unit tests + manual:
TEST: Run shill on Edison with "--device-black-list=wlan0" argument
TEST: Run "ip link set wlan0 name wlan0b"
TEST: Observe that shill ignored wlan0 but initialized and used wlan0b

Change-Id: I70975d55292d4f4f330b33ec2d0439a568148588
/system/connectivity/shill/device_info_unittest.cc
a551451a88ec3a4746021c84c646dcf8206b2531 25-Aug-2015 Paul Stewart <pstew@chromium.org> shill: DeviceInfo: Delay test for Tunnel devices [re-land]

It's been observed that tunnel devices can be mis-detected by
shill because the tun_flags sysfs meta-file is created after
the RTNL event arrives to indicate the presence of the device.
To solve this, move detection of tunnel devices to the
DelayedDeviceCreationTask so the meta-file is created by the
time a decision is made about the device type.

Relanding this after a fix to Chrome OS:
https://chromium-review.googlesource.com/301570

BUG=chromium:524164
TEST=Unit tests
TEST=Run "openvpn --mktun --dev tun0" while shill is running.
TEST=Wait 5 seconds. Do an "ifconfig -a". "tun0" should not be there.
TEST=p2p_ShareFiles autotest

Change-Id: Ia2353b2ee9f6f91c35067872615e00f7531458fe
/system/connectivity/shill/device_info_unittest.cc
061002a177b992f82cf97665995c2e9d6c8dfadc 22-Sep-2015 Peter Qiu <zqiu@google.com> Revert "shill: DeviceInfo: Delay test for Tunnel devices"

This reverts commit 2c7e841cca9699698ff4c9377ed0979897d2afdd.

The original CL breaks the p2p (p2p_ShareFiles) autotest,
which uses tuntap interface. This revert will unblock the ebuild
uprev.

Bug: None
TEST=Run p2p_ShareFiles

Change-Id: Idcdd9b3cf08431d7eaa8eafa48638956b537c81b
/system/connectivity/shill/device_info_unittest.cc
bad1c10ffd2d4ac14f7bd9f4ef6a8982e711f566 19-Sep-2015 mukesh agrawal <quiche@google.com> shill: remove references to GLib

There are a number of references to GLib (the object),
even though no one uses GLib in a substantive way.
Remove these obsolete references.

Bug: 23386647
TEST=unit tests

Change-Id: I8d574980bc8e853c8b87ef64b581d64a71491201
/system/connectivity/shill/device_info_unittest.cc
2c7e841cca9699698ff4c9377ed0979897d2afdd 25-Aug-2015 Paul Stewart <pstew@chromium.org> shill: DeviceInfo: Delay test for Tunnel devices

It's been observed that tunnel devices can be mis-detected by
shill because the tun_flags sysfs meta-file is created after
the RTNL event arrives to indicate the presence of the device.
To solve this, move detection of tunnel devices to the
DelayedDeviceCreationTask so the meta-file is created by the
time a decision is made about the device type.

BUG=chromium:524164
TEST=Unit tests
TEST=Run "openvpn --mktun --dev tun0" while shill is running.
TEST=Wait 5 seconds. Do an "ifconfig -a". "tun0" should not be there.

Change-Id: Ieb148cbb4bd6a7aeda0bb5402579e53a14dcadfd
/system/connectivity/shill/device_info_unittest.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/device_info_unittest.cc
3b30ca58d13cf66b75ba0729b222ddc42ae68b33 16-Jun-2015 Paul Stewart <pstew@chromium.org> shill: Top-level unit tests: Switch pointer/ref spacing

Switch to Chrome style spacing.

BUG=chromium:501026
TEST=Unit tests

Change-Id: I86c072b89281e0de18928b47860b99d779af061a
Reviewed-on: https://chromium-review.googlesource.com/278037
Reviewed-by: Rebecca Silberstein <silberst@chromium.org>
Commit-Queue: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/device_info_unittest.cc
1ce231c71932200e4d02c71567f8e93788120781 13-Jun-2015 Paul Stewart <pstew@chromium.org> shill: Manager: Refactor command line setup

In anticipation of a new and different implementation of
shill::Daemon, this CL re-factors the interaction between
the main() function and shill::Daemon by passing a new
Daemon::Settings structure. This way the process of parsing
command line parameters is separated from the task of
delivering this configuration the Daemon object. While here,
the "default_technology_order" field of was unified with the
other parameters passed to the Manager from the Daemon.

However this change is somewhat dwarfed by the technical
debt that needed to be paid off in order to allow this new
change to be tested. The new Daemon::ApplySettings method
makes no new calls to the Manager object but none of these
methods were previously mocked in the MockManager object.
More troublingly the side-effects of these Manager methods
were depended on in MockManager, so a few tests (notably
DeviceTest) needed to be re-architected to deal with mock
functionality instead of assuming the Mock object did what
a real Manager would do.

Lastly, both the Device::PrependDNSServers and
Manager::FilterPrependDNSServersByFamily methods seemed
a bit hard to understand and difficult to test. Minor
changes to these APIs allowed the test changes above to
work a lot smoother, and also to separate the unit tests
to work on individually testing the functionality in each
object.

BUG=chromium:500991
TEST=Unit tests

Change-Id: I04c33c841024c102ff9658e5857236ab2e5bf32f
Reviewed-on: https://chromium-review.googlesource.com/278022
Reviewed-by: Garret Kelly <gdk@chromium.org>
Reviewed-by: Rebecca Silberstein <silberst@chromium.org>
Commit-Queue: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/device_info_unittest.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/device_info_unittest.cc
ebd709e7d7519915930404be7120cd8070b432c4 16-Mar-2015 Peter Qiu <zqiu@chromium.org> shill: only request RTNL dump after manager has started

BUG=chromium:465969
TEST=USE="asan clang" FEATURES=test emerge-$BOARD shill
Manual Test:
1. Restart shill with blacklist device specified:
restart shill BLACKLISTED_DEVICES="foo"
2. Verify RequestDump is not called when shill is started, no log
message such as "RequestDump called while not started...."

Change-Id: I922444939b234ba7008dda9632a30a7f685f856d
Reviewed-on: https://chromium-review.googlesource.com/260460
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/device_info_unittest.cc
900ab5eff3f23a18feb955210e8acc9fb5cfa292 04-Feb-2015 Samuel Tan <samueltan@chromium.org> shill: make netlink message creation context-dependent

Provide shill with context when it parses netlink messages received in
NetlinkManager::OnNlMessageReceived using NetlinkMessageFactory::CreateMessage.
Do this by inferring a NetlinkMessage::MessageContext in NetlinkManager
immediately after receiving the message, and then passing this context along
to NetlinkMessageFactory::CreateMessage and any subsequent functions it invokes
that might use this context to decide how to parse the message.

In this CL, we pass this context through to the Nl80211AttributeWowlanTriggers
constructor, which can use this context to decide how to parse the
NL80211_WOWLAN_TRIG_PKT_PATTERN attribute.

In order to reduce the size and impact of this change,
NetlinkMessage::MessageContext is not passed to functions that do not use it.
In the future, function signatures can be modified to accept a MessageContext
(and new members can be added to the MessageContext struct) if it is required
to properly parse a netlink messages/attributes.

BUG=chromium:455435
TEST=Compile shill and run unit tests.

Change-Id: Ib8858a57ec366408dcf5e6211007c8680e45a7f1
Reviewed-on: https://chromium-review.googlesource.com/246364
Reviewed-by: Samuel Tan <samueltan@chromium.org>
Tested-by: Samuel Tan <samueltan@chromium.org>
Commit-Queue: Samuel Tan <samueltan@chromium.org>
/system/connectivity/shill/device_info_unittest.cc
83d625655edbc7c35fc436b8b8fe744886d0aae1 10-Feb-2015 Paul Stewart <pstew@chromium.org> shill: DeviceInfo: Optionally ignore unknown Ethernet

Before CL:224422, any unknown network devices (ones that did not
report a driver symlink) were treated as "Unknown" and were not
managed by shill. However some broken Ethernet drivers do not
report this. This change allows a command-line option to revert
this workaround so virtual network interfaces and other such
non-reported devices can be ignored by the manager again.
Additionally, explicitly ignore all devices that appear with a
"veth" prefix.

BUG=chromium:457043,chromium:456104,chromium:451714
TEST=Unit tests

Change-Id: I513c7014c2159d7fea608eed85c0e33b02a893ba
Reviewed-on: https://chromium-review.googlesource.com/247904
Reviewed-by: Zeping Qiu <zqiu@chromium.org>
Commit-Queue: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/device_info_unittest.cc
0951ccbfca977a9cf218b2e4308aa26fb4d06ef9 10-Dec-2014 Alex Vakulenko <avakulenko@chromium.org> Update libchrome to r307740 and fix build errors

Updated libchrome, libchrome_crypto, metrics, feedback to the
latest revisions from Chrome (r307740).

Fixed build breaks due to the changes in upstream code:

- scope_ptr no longer needs explicit PassAs<T>() calls.
- scope_ptr<T> no longer has implicit conversion to T*.
Must use scope_ptr<T>::get() instead.
- base/file_util.h moved to base/files/file_util.h
- ARRAYSIZE_UNSAFE() removed in favor of arraysize()
- base::AppendToFile() and base::WriteFileDescriptor() now
return bool instead of the number of bytes written.
- dbus::Bus::AddFilterFunction() now returns void.
- C++11 features are enabled in libchromeos, so all targets
linking with it now have to support C++11
- OVERRIDE macro is removed in favor of native C++11
'override' keyword.

BUG=chromium:416628, chromium:411508
TEST=Build the world on x86, x64, ARM. The following builders
were tried:
x86-generic-full amd64-generic-full arm-generic-full
amd64-generic-asan daisy-full nyan-full pre-cq-group
daisy-release-group sandybridge-release-group
pineview-release-group
CQ-DEPEND=CL:234450,CL:234980

Change-Id: I374bebe2211d533c4431c82efb8be1cdcb1f405d
Reviewed-on: https://chromium-review.googlesource.com/234440
Reviewed-by: Bertrand Simonnet <bsimonnet@chromium.org>
Tested-by: Alex Vakulenko <avakulenko@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Commit-Queue: Alex Vakulenko <avakulenko@chromium.org>
/system/connectivity/shill/device_info_unittest.cc
a06c65fa73e48e6ed02156ba6d62dcea2739a1a2 10-Dec-2014 Paul Stewart <pstew@chromium.org> shill: Ethernet: Do not call Stop() in destructor

In the common case where an Device destructor is called
as the device is being removed by Manager::DeregisterService(),
the device is already explicitly stopped. In the exceptional
case when the Device destructor is called from the Manager
destructor (really the destructor for the vector of DeviceRefPtr
objects), it is unsafe to call Manager::DeregisterService() as
this will traverse a vector that has already been destroyed.

Instead, call the Stop() method explicitly on all devices in
Manager::Stop().

BUG=chromium:440767
TEST=Unit tests

Change-Id: Icc66f3793ccca932ad996b9b280eb89d975e4ae0
Reviewed-on: https://chromium-review.googlesource.com/234407
Reviewed-by: Peter Qiu <zqiu@chromium.org>
Commit-Queue: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/device_info_unittest.cc
3de88a00f446215b3299fe5834d4f120863e3ac7 05-Dec-2014 Paul Stewart <pstew@chromium.org> shill: Ethernet: Retain EthernetService for life

Make the EthernetService held by the Ethernet device remain valid
for the lifetime of the Device. This allows Ethernet services to
be configured whether or not a link is available. To modify this
lifetime, it is necessary to break the reference loop between the
Ethernet device and its Service.

Instead of calling RegisterService and DeregisterService with the
EthernetService, toggle the visibility and autoconnect properties
to allow the service to disconnect and regain L2 connectivity as
link appears and disappears.

BUG=chromium:439176
TEST=The following:
- Unit tests with ASAN
- The following autotests:
+ network_Dhcp*
+ network_VPNConnect
- Manual:
+ Start shill with Ethernet connected, disconnect, reconnect
+ Start shill with Ethernet USB disconnected, connect USB (with Ethernet attached)
+ Start shill with Ethernet USB disconnected, connect USB with Ethernet detached,
then connect Ethernet
+ Monitor "list-services" to make sure the Ethernet service is only visible
(and connects) when both USB and Ethernet are connected.

Change-Id: I7f0ef8397606b69990b8dc03be75f6166aa5c017
Reviewed-on: https://chromium-review.googlesource.com/233770
Trybot-Ready: Paul Stewart <pstew@chromium.org>
Reviewed-by: Peter Qiu <zqiu@chromium.org>
Commit-Queue: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/device_info_unittest.cc
7e8b8ee34816575b9059dd041ef29f91fe1d15c8 25-Nov-2014 Peter Qiu <zqiu@chromium.org> shill: add support for allowing remote dbus service to claim/release devices

Add method ClaimInterface and ReleaseInterface to DBus interface
org.chromium.flimflam.Manager to allow remote DBus service to claim
the ownership of network interfaces from shill.

To reduce complexity, this service will only support one DBus service at a
time, which means disallow a DBus service from claiming interface from shill
if another DBus service currently had ownership to one or more interfaces
from shill.

When an interface is claimed by a remote DBus service, shill will stop any
activities on that interface, deregister it from the manager if it is
registered, and put it in the blacklist to avoid any further usage. Once the
interface is released by the remote DBus service, it will be removed from the
blacklist and a new device will be created/registered when it is detected
through RTNL.

BUG=chromium:435704
TEST=unittests, manual test will be done using apmanager.

Change-Id: Ie01945f083910345d4cbe9e1d2e64711b5d60891
Reviewed-on: https://chromium-review.googlesource.com/231930
Reviewed-by: Peter Qiu <zqiu@chromium.org>
Commit-Queue: Peter Qiu <zqiu@chromium.org>
Tested-by: Peter Qiu <zqiu@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/device_info_unittest.cc
ba24e6fd0f0f2b974e0e73039d7d92bb475f6857 17-Nov-2014 Peter Qiu <zqiu@chromium.org> shill: Disable automatic symbol exports from libshill-net

Using -fvisibility=default flag in libshill-net causes a lot of uneeded
symbols to be exported from the shared library.

Removed the flag from the GYP file for libshill-net and instead added
SHILL_EXPORT macro to be added to classes, variables and methods to be
exported from the libraries explicitly.

Also added SHILL_PRIVATE attribute to explicitly hide a symbol which
can be used on some member of a class that is otherwise exported.

BUG=chromium:433600
TEST=USE="clang asan" FEATURES=test emerge-$BOARD shill

Change-Id: I16928737dde6bc5b97785773f6ed0f940f301f62
Reviewed-on: https://chromium-review.googlesource.com/230220
Reviewed-by: Peter Qiu <zqiu@chromium.org>
Commit-Queue: Peter Qiu <zqiu@chromium.org>
Tested-by: Peter Qiu <zqiu@chromium.org>
/system/connectivity/shill/device_info_unittest.cc
2240e8c03451c6b6f21eb8944d8a1c0747ac10b3 06-Nov-2014 Ben Chan <benchan@chromium.org> shill: vpn: Move vpn 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=`USE='vpn' FEATURES=test emerge-$BOARD shill`
TEST=`USE='vpn clang asan' FEATURES=test emerge-$BOARD shill`

Change-Id: I02d23511a80655098d50e248321c77d23f8caaa9
Reviewed-on: https://chromium-review.googlesource.com/229870
Reviewed-by: Paul Stewart <pstew@chromium.org>
Commit-Queue: Ben Chan <benchan@chromium.org>
Tested-by: Ben Chan <benchan@chromium.org>
/system/connectivity/shill/device_info_unittest.cc
c54afe521739065a5d77e7c049acdb5e603f0592 05-Nov-2014 Ben Chan <benchan@chromium.org> shill: cellular: Move cellular 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=`USE='cellular' FEATURES=test emerge-$BOARD shill`
TEST=`USE='cellular clang asan' FEATURES=test emerge-$BOARD shill`

Change-Id: I783e85d8c606426ce2ded093588c1243fd0eef97
Reviewed-on: https://chromium-review.googlesource.com/229799
Reviewed-by: Thieu Le <thieule@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Commit-Queue: Ben Chan <benchan@chromium.org>
Tested-by: Ben Chan <benchan@chromium.org>
/system/connectivity/shill/device_info_unittest.cc
c3d707d1ae4198d5538ff4deccd729a83f1bc805 31-Oct-2014 Ben Chan <benchan@chromium.org> shill: wimax: Move wimax 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=`USE='wimax' FEATURES=test emerge-$BOARD shill`
TEST=`USE='wimax clang asan' FEATURES=test emerge-$BOARD shill`

Change-Id: I6b2be3550026cb2e176c0107d10da1e29d2606b0
Reviewed-on: https://chromium-review.googlesource.com/229798
Reviewed-by: Paul Stewart <pstew@chromium.org>
Commit-Queue: Ben Chan <benchan@chromium.org>
Tested-by: Ben Chan <benchan@chromium.org>
/system/connectivity/shill/device_info_unittest.cc
02e3dc3bc6e9fdb475bd13944f1c6764c921abbb 31-Oct-2014 Peter Qiu <zqiu@chromium.org> shill: Move netlink functionality to libshill-net shared library

By exporting netlink functionality to a shared library, other
applications can use the interfaces provided by this library
to communicate with the cfg80211 kernel module and mac80211 drivers.

To use this library, add dependency for libshill-net-<(libbase_ver) in
your gyp file, and include the headers from <shill/net/*>

BUG=chromium:427982
TEST=unittests, run wifi_matfunc suite for shill regression test

Change-Id: Ia8ea063daaa63de27fe81e153458e149586086ec
Reviewed-on: https://chromium-review.googlesource.com/226830
Reviewed-by: Paul Stewart <pstew@chromium.org>
Commit-Queue: Peter Qiu <zqiu@chromium.org>
Tested-by: Peter Qiu <zqiu@chromium.org>
/system/connectivity/shill/device_info_unittest.cc
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/device_info_unittest.cc
da8cbeef4735df05dd3a9a069c6ecccf37803e60 20-Oct-2014 Paul Stewart <pstew@chromium.org> shill: DeviceInfo: Default unknown to Ethernet

For devices with a uevent file but no device driver symlink, if
the device type doesn't match any known types, default this to
Ethernet.

BUG=chrome-os-partner:33128
TEST=Unit test

Change-Id: I5c2200e6a24b1577683cf2130524d708df591a63
Reviewed-on: https://chromium-review.googlesource.com/224422
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Commit-Queue: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/device_info_unittest.cc
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/device_info_unittest.cc
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/device_info_unittest.cc
9f5159e07028a01e1353d68bc19da9817a6785fe 13-Sep-2014 Peter Qiu <zqiu@chromium.org> shill: Add a metric for tracking device removed event

Device removed events are being tracked per technology type.

BUG=chromium:411512
TEST=unit tests, manual test
Manual Test:
1. Start a peppy device, then reload the wifi (ath9k) driver with
"rmmod ath9k_btcoex" then "modprobe ath9k_btcoex".
2. Browse to "chrome://histograms", verify there is a histogram
"Network.Shill.DeviceRemovedEvent" with hit for bucket 2 (wifi).

Change-Id: Ib48202fb3aecf40e82de973526b26b6ac9702450
Reviewed-on: https://chromium-review.googlesource.com/217969
Tested-by: Peter Qiu <zqiu@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Commit-Queue: Peter Qiu <zqiu@chromium.org>
/system/connectivity/shill/device_info_unittest.cc
11c213f3cf64f27a0e42ee6da95e98bd1d4b3202 05-Sep-2014 Ben Chan <benchan@chromium.org> Update code to include base/files/file_util.h

file_util.h was moved from base to base/files
(https://codereview.chromium.org/468253002). This CL updates platform2
code to include base/files/file_util.h instead of base/file_util.h.

BUG=chromium:411001
TEST=Trybot run on paladin, release, and chromiumos-sdk builders.

Change-Id: I488925b54615e131e508a460dc1a27f88168f936
Reviewed-on: https://chromium-review.googlesource.com/216851
Reviewed-by: Alex Vakulenko <avakulenko@chromium.org>
Tested-by: Ben Chan <benchan@chromium.org>
Commit-Queue: Ben Chan <benchan@chromium.org>
/system/connectivity/shill/device_info_unittest.cc
5412de0a46893b44f60fee4058c5b0d744b74b4d 16-Aug-2014 Samuel Tan <samueltan@chromium.org> shill: netlink_manager: add support for Nl80211 Ack handlers (reland)

Add support for Nl80211 Ack handlers. This allows Nl80211 Ack
responses to be explicitly handled rather than being dropped.

Add use of ack handlers to wake-on-packet connection functions
in wifi.cc.

BUG=chromium:401576
TEST='TEST=P2_TEST_FILTER="shill::*" USE="clang asan" FEATURES="test"
emerge-squawks platform2' suceeds; manual testing on squawks

Change-Id: I90b73f3e5d29c3e2e251eeb4d35a2127993b4ae2
Reviewed-on: https://chromium-review.googlesource.com/213874
Tested-by: Samuel Tan <samueltan@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Commit-Queue: Samuel Tan <samueltan@chromium.org>
/system/connectivity/shill/device_info_unittest.cc
29740cbbea0d215e3d1d2fb97719976fde875f2e 22-Aug-2014 Alex Deymo <deymo@chromium.org> Revert "shill: netlink_manager: add support for Nl80211 Ack handlers"

The reverted CL kills ASAN builders, please test it on asan builders.

This reverts commit 13b5ef0b6c55ad713347f81236bb9419bb6c3a01.

BUG=chromium:406232
TEST=P2_TEST_FILTER="shill::*" USE="clang asan" FEATURES="test" emerge-link platform2

Change-Id: I7b77bfe8f56722834d810e473e4c987341f98db8
Reviewed-on: https://chromium-review.googlesource.com/213770
Reviewed-by: Alex Deymo <deymo@chromium.org>
Commit-Queue: Alex Deymo <deymo@chromium.org>
Tested-by: Alex Deymo <deymo@chromium.org>
Reviewed-by: Ben Chan <benchan@chromium.org>
Commit-Queue: Ben Chan <benchan@chromium.org>
Tested-by: Ben Chan <benchan@chromium.org>
/system/connectivity/shill/device_info_unittest.cc
6c29ce37de356500dae65413a8778d142e1ff65d 16-Aug-2014 Samuel Tan <samueltan@chromium.org> shill: netlink_manager: add support for Nl80211 Ack handlers

Add support for Nl80211 Ack handlers. This allows Nl80211 Ack
responses to be explicitly handled rather than being dropped.

Add use of ack handlers to wake-on-packet connection functions
in wifi.cc.

BUG=chromium:401576
TEST='emerge-squawks platform2' suceeds; unit tests;
manual testing on squawks

Change-Id: I159bc9d314731ce6603aba83c665fb6818d1496b
Reviewed-on: https://chromium-review.googlesource.com/212747
Tested-by: Samuel Tan <samueltan@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Commit-Queue: Samuel Tan <samueltan@chromium.org>
/system/connectivity/shill/device_info_unittest.cc
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/device_info_unittest.cc
9855170e6e2de08db343640c82795c9b4020a166 28-Jul-2014 Peter Qiu <zqiu@chromium.org> shill: IPv6 DNS server addresses changed notification.

Setup DeviceInfo to subscribe to RDNSS messages, and notify Device when there
is an update.

BUG=chromium:394010
TEST=unit tests, manual test.
Manual Test:
1. Update code to log the lifetime and DNS server IP addresses in Device's
callback function (OnIPv6DnsServerAddressesChanged).
2. Run network_Ipv6SimpleNegotiation on the DUT.
3. Verify the lifetime and DNS server IP addresses in net.log.

Change-Id: I6ce462388bbb168ed0816db24be349584f3ae51f
Reviewed-on: https://chromium-review.googlesource.com/210039
Reviewed-by: Peter Qiu <zqiu@chromium.org>
Commit-Queue: Peter Qiu <zqiu@chromium.org>
Tested-by: Peter Qiu <zqiu@chromium.org>
/system/connectivity/shill/device_info_unittest.cc
6fbf64f493a9aae7d743888039c61a57386203db 22-May-2014 Ben Chan <benchan@chromium.org> shill: Update to build against libchrome-271506.

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

Change-Id: Ib7c8b2b290caa261cbb61d30cf8a361a1e3345e1
Reviewed-on: https://chromium-review.googlesource.com/201211
Tested-by: Ben Chan <benchan@chromium.org>
Commit-Queue: Ben Chan <benchan@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/device_info_unittest.cc
d4f26486b237fae831d4b682481de785fc99c66e 26-Apr-2014 Paul Stewart <pstew@chromium.org> shill: Device: Report IPv6 address

Have the Device query DeviceInfo for the primary IPv6 address
every time DeviceInfo notifies it of a change. Use the output
of this to add another IPConfig object to the list reported if
this address exists.

While here, emit a property change event from the "IPConfigs"
property if either the IPv4 or IPv6 ipconfigs change.

BUG=chromium:365883
TEST=Unit tests, upcoming change to network_Ipv6SimpleNegotiation
(CL:197394). Manual: list-ipconfigs while connected to a network
that supplies IPv6 global prefixes.

Change-Id: I28771acd3e990a9bea7f5988cc382a5cd9e91f1f
Reviewed-on: https://chromium-review.googlesource.com/197304
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Commit-Queue: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/device_info_unittest.cc
d55f6ae45047f984457508d78c70abcd837307ea 25-Apr-2014 Paul Stewart <pstew@chromium.org> shill: DeviceInfo: Report IPv6 address changes to Device

In the current scheme of operation, shill is responsible for
launching negotiation and configuring IPv4 addresses into the
kernel. However the kernel is responsible for negotiating and
configuring IPv6 addressess via neighbor discovery. This CL
provides a means for DeviceInfo to report IPv6 address changes
back to the Device. The Device can then choose to report this
state over the RPC interface.

BUG=chromium:365883
TEST=Unit tests

Change-Id: I9b25891907e2bb160b82ea2449fd225d4967c6bc
Reviewed-on: https://chromium-review.googlesource.com/196960
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Commit-Queue: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/device_info_unittest.cc
62ba51cf8fed1be8f51092ecce6a9588a842cd29 19-Apr-2014 mukesh agrawal <quiche@chromium.org> shill: re-enable unused-result warning

Eliminate code that violates no-unused-result, and remove
-Wno-unused-result from the c++ compiler flags in the gyp
file.

BUG=chromium:293668
TEST=unit tests

Change-Id: I2edb193e0cf43c2ca70545ada11229a1737f5d0c
Reviewed-on: https://chromium-review.googlesource.com/195763
Tested-by: mukesh agrawal <quiche@chromium.org>
Reviewed-by: Ben Chan <benchan@chromium.org>
Commit-Queue: mukesh agrawal <quiche@chromium.org>
/system/connectivity/shill/device_info_unittest.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/device_info_unittest.cc
5742b24ab984464701fef0cc7024af2637357b04 19-Dec-2013 Ben Chan <benchan@chromium.org> shill: Completely exclude ModemInfo when built with USE=-cellular.

Instead of having a shallow implementation of ModemInfo, this CL
completely excludes ModemInfo when building shill without cellular
support. This addresses the following compilation issues when building
shill with USE=-cellular:

modem_info.cc:35:12: error: unused variable 'kCromoService'
modem_info.cc:36:12: error: unused variable 'kCromoPath'
modem_info.cc:38:12: error: unused variable 'kCellularOperatorInfoPath'
mock_modem_info.cc:32: error: undefined reference to shill::ModemInfo::set_pending_activation_store(shill::PendingActivationStore*)'
mock_modem_info.cc:36: error: undefined reference to shill::MockCellularOperatorInfo::MockCellularOperatorInfo()'
mock_modem_info.cc:36: error: undefined reference to shill::ModemInfo::set_cellular_operator_info(shill::CellularOperatorInfo*)'
mock_modem_info.cc:66: error: undefined reference to 'mobile_provider_open_db'

BUG=chromium:329715
TEST=Tested the following with {x86,amd64,arm}-generic:
1. `FEATURES=test emerge-${BOARD} platform2`
2. `USE='-debugd -cellular' emerge-${BOARD} platform2`
3. Run network_3GSmoke test with shill built with cellular support.

Change-Id: I348486604ceaaca5e90dd15df40edeaa6e6b6d68
Reviewed-on: https://chromium-review.googlesource.com/180800
Reviewed-by: Gaurav Shah <gauravsh@chromium.org>
Tested-by: Gaurav Shah <gauravsh@chromium.org>
Commit-Queue: Ben Chan <benchan@chromium.org>
Tested-by: Ben Chan <benchan@chromium.org>
/system/connectivity/shill/device_info_unittest.cc
a0db0fff6ae05e1ba3facfdf3d5049ca1a277be4 09-Dec-2013 Paul Stewart <pstew@chromium.org> shill: DeviceInfo: Add utility for address reachability

Add a method to DeviceInfo to query whether an IP address is local
to an interface.

BUG=chromium:326518
TEST=Unit tests

Change-Id: I582e59aa009d476c25b2d14560150c1c49d8dfbb
Reviewed-on: https://chromium-review.googlesource.com/179275
Reviewed-by: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
Commit-Queue: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/device_info_unittest.cc
6950ba51e9a35b91687103fdc451e1539cdfb35d 05-Dec-2013 Paul Stewart <pstew@chromium.org> shill: DeviceInfo: Query ARP table for a peer IP

Add a DeviceInfo method which queries the ARP table for a peer.
This uses the SIOCGARP socket ioctl instead of using RTNL so that
the call can be made synchronously as opposed to using RTNL.

BUG=chromium:326518
TEST=Unit tests + addition to TDLS autotest (CL:179158)

Change-Id: I8d468955be894f44409babd33fdffffc93ad6fb3
Reviewed-on: https://chromium-review.googlesource.com/179159
Reviewed-by: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
Commit-Queue: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/device_info_unittest.cc
520eb176ecc8548a9eb6a340fb46c06618ee8308 31-Oct-2013 Ben Chan <benchan@chromium.org> shill: Disable WiMAX support when built with USE='-gdmwimax -wimax'.

BUG=chromium:313512
CQ-DEPEND=CL:175208,CL:175219,CL:175218,CL:*147371
TEST=Tested the following with lumpy and daisy with a WiMAX module:
1. `USE='gdmwimax wimax' FEATURES=test emerge-$BOARD platform2`
2. `USE='-gdmwimax -wimax' FEATURES=test emerge-$BOARD platform2`
3. When built with WiMAX support, verify that shill detects and supports
the WiMAX module properly. Run network_WiMaxSmoke to confirm.
4. When built without WiMAX support, verify that shill ignores the WiMAX
module.

Change-Id: Ia38f0ac0aa04c06facaf3016716b700efb466976
Reviewed-on: https://chromium-review.googlesource.com/175204
Reviewed-by: Ben Chan <benchan@chromium.org>
Commit-Queue: Ben Chan <benchan@chromium.org>
Tested-by: Ben Chan <benchan@chromium.org>
/system/connectivity/shill/device_info_unittest.cc
b87d22b774fe15b6580d13638d5f0514bde031fd 29-Jul-2013 Paul Stewart <pstew@chromium.org> shill: Manager: Map between Technology and Provider

Create a map between Technology::Identifier and the Provider, so
most operations on provders are done either by iterating through
the map or by selecting the provider by its technology. There
are some exceptions remaining, namely the methods called in
ConfigureServiceForProfile, which will be fixed in an upcoming
CL, and a few methods where the Manager explicitly calls
non-generic methods on the WiFiProvider.

BUG=chromium:265518
TEST=Unit tests

Change-Id: I43f217c6050d68d1f94800d08b06a7dcf1e5bafc
Reviewed-on: https://gerrit.chromium.org/gerrit/63605
Commit-Queue: Paul Stewart <pstew@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/device_info_unittest.cc
b00c13d6444ba67154acffec537bdb466099f7b1 30-Jul-2013 Arman Uguray <armansito@chromium.org> shill: Make Manager.UninitializedTechnologies and others mutually exclusive.

If there is at least one device of a particular technology that is
enabled or enabling then it shouldn't be contained in
Manager.UninitializedTechnologies.

BUG=chromium:265002
TEST=1. Build and run unit tests.
2. On a device that contains a built in modem:
- stop modemmanager/cromo
- Run pseudomodem. Make sure that cellular is enabled.
- Check via DBus that Manager.UninitializedTechnologies does not
contain "cellular".

Change-Id: I85e6b06782967255d68a6c73d660fd5e00092d9e
Reviewed-on: https://gerrit.chromium.org/gerrit/63684
Reviewed-by: Ben Chan <benchan@chromium.org>
Commit-Queue: Arman Uguray <armansito@chromium.org>
Tested-by: Arman Uguray <armansito@chromium.org>
/system/connectivity/shill/device_info_unittest.cc
0f90e0b62322ae95c1a419d5efef47438b4617c9 27-Jun-2013 Ben Chan <benchan@chromium.org> shill: cellular: Recognize cellular devices using cdc_mbim driver.

BUG=chromium:254820
TEST=Tested the following:
1. Build and run unit tests.
2. Verify that shill creates a Cellular object for a device using the
cdc_mbim driver.

Change-Id: I6cf3b594ebca9991551dd9331bd01b18979d0b2c
Reviewed-on: https://gerrit.chromium.org/gerrit/60185
Reviewed-by: Darin Petkov <petkov@chromium.org>
Commit-Queue: Ben Chan <benchan@chromium.org>
Tested-by: Ben Chan <benchan@chromium.org>
/system/connectivity/shill/device_info_unittest.cc
4eb4ddf7f26286e6b4d112f014718336559dfb7a 21-Jun-2013 Ben Chan <benchan@chromium.org> shill: Identify modem devices supported by the cdc_ncm driver.

This CL applies the same logic for checking cdc_ether devices to also
handle cdc_ncm devices.

BUG=chromium:252608
TEST=Tested the following:
1. Build and run unit tests.
2. Verify that shill correctly identifies a modem supported by the
cdc_ncm driver.

Change-Id: I30f03add1b97f44d4f60683796e2dd9af906a33c
Reviewed-on: https://gerrit.chromium.org/gerrit/59526
Reviewed-by: Darin Petkov <petkov@chromium.org>
Tested-by: Ben Chan <benchan@chromium.org>
Commit-Queue: Ben Chan <benchan@chromium.org>
/system/connectivity/shill/device_info_unittest.cc
7347bf2b466ae8058e47b29aaf0583390405d866 30-Apr-2013 Wade Guthrie <wdg@chromium.org> shill: Adds message-type-specific netlink callbacks.

SendMessage calls are now Send*Message where '*' is the message type
(e.g., Nl80211, Control). They now take 2 response handlers: 1) a
message-type-specific handler for the expected results and 2) an
auxilliary message handler for error messages and multi-part done
messages and the like.

BUG=chromium:236882
TEST=unittest

Change-Id: I418edf8b5edeca2608e5c9f0bf67fa2fa549d7ad
Reviewed-on: https://gerrit.chromium.org/gerrit/57653
Commit-Queue: Wade Guthrie <wdg@chromium.org>
Reviewed-by: Wade Guthrie <wdg@chromium.org>
Tested-by: Wade Guthrie <wdg@chromium.org>
/system/connectivity/shill/device_info_unittest.cc
2ddf2c63751546aa554335a6733314a3859d5c2e 16-Apr-2013 Paul Stewart <pstew@chromium.org> shill: DeviceInfo: Decide between WiFi interface types

When a WiFi device appears, use the nl80211 "get interface"
call to retrieve the interface type, deferring creation of
the Device instance until a reply to this message is received.
Only create a WiFi device if the interface is in "station"
mode.

BUG=chrome-os-partner:18698
TEST=Unit tests; run on system with kernel-next patches for
chromeos-partner:18698 comment #5 applied, and
https://gerrit.chromium.org/gerrit/47863 reverted, ensure
only one WiFi device appears in list-devices (mlan0)

Change-Id: Ia559e0931a8bd4aaa067d71aae5d1bd1bf1ceedc
Reviewed-on: https://gerrit.chromium.org/gerrit/48250
Commit-Queue: Paul Stewart <pstew@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/device_info_unittest.cc
c3505a569e3f98ce56e4017300a3ce46bc714e4c 18-Mar-2013 Darin Petkov <petkov@chromium.org> shill: vpn: Conditionally build VPN support into shill.

VPN is disabled if SHILL_VPN=0 is passed to the Makefile.

BUG=chromium-os:39329
TEST=Together with I9e4d5741cbdcd99c9c109259167d87dbff04ee7a:
- FEATURES=test emerge-lumpy shill;
- After unmerging dependencies, FEATURES=test USE=-vpn emerge-lumpy shill
- Connected to OpenVPN successfully with default USE flags.
- Tested connectivity with shill with no VPN support.

Change-Id: I480a5911a4310ff9f80ca312db2a1bc3fe67bbd1
Reviewed-on: https://gerrit.chromium.org/gerrit/45740
Reviewed-by: Paul Stewart <pstew@chromium.org>
Commit-Queue: Darin Petkov <petkov@chromium.org>
Tested-by: Darin Petkov <petkov@chromium.org>
/system/connectivity/shill/device_info_unittest.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/device_info_unittest.cc
b061f89e7088c7fba50b49ee5ac876619c9e8a7e 28-Feb-2013 Ben Chan <benchan@chromium.org> Add a traffic monitor to detect abnormal scenarios.

This CL implements a traffic monitor to detect abnormal scenarios on an
network connection. The traffic monitor can be conditionally enabled on
a device. It starts periodically sampling the receive and transmit byte
counts on a enabled device after the device establishes a connection.
When it sees that there is outgoing traffic but no incoming traffic for
some sampling periods, it invokes a callback to notify such a scenario.

BUG=chromium-os:39433
TEST=Built and ran unit tests.

Change-Id: I22b43fae53365544f595a630bff1b8d90b478e95
Reviewed-on: https://gerrit.chromium.org/gerrit/44403
Reviewed-by: Paul Stewart <pstew@chromium.org>
Commit-Queue: Ben Chan <benchan@chromium.org>
Tested-by: Ben Chan <benchan@chromium.org>
/system/connectivity/shill/device_info_unittest.cc
5ad1606ad8b3f74b2b7960a3003a2d1ca75d52b8 22-Feb-2013 Paul Stewart <pstew@chromium.org> shill: Compile against libchrome-180609

Made the following fixes to allow compile against a new libchrome:

- ScopedVector::reset() was renamed to "clear".
- Hack in base to add "using base::FilePath;" has been removed.
- Convert MessageLoop::current()->RunAllPending() to
base::RunLoop().RunUntilIdle().
- MessageLoopProxy::PostDelayedTask() now takes a base::TimeDelta().
- scoped_refptr::release() no longer exists.
- base/eintr_wrapper.h -> base/posix/eintr_wrapper.h
- base/scoped_temp_dir.h -> base/files/scoped_temp_dir.h
- base/string_tokenizer.h -> base/strings/string_tokenizer.h
- New scoped_ptr does compile check for naughty people making scoped_ptrs
of refcounted objects.
- base::SplitString() now returns an empty vector when given an empty
string (instead of a single-element vector with an empty string).

CQ-DEPEND=CL:43774
BUG=chromium-os:38931
TEST=Unit tests, run on real hardware

Change-Id: I6f1f5807e81fb2d52f197871d32ccbccc3038a7c
Reviewed-on: https://gerrit.chromium.org/gerrit/43775
Commit-Queue: Paul Stewart <pstew@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/device_info_unittest.cc
6c1e3bbca64d642cb30ed9952203626942bc1451 07-Feb-2013 Thieu Le <thieule@chromium.org> shill: cellular: Add Network.Shill.Cellular.DropsPerHour.

BUG=chromium-os:38557
TEST=Unit tests, manually lose LTE signal and check chrome://histograms

Change-Id: I82aa1edabd21c5dfde4834cd36a34a12b629ba8f
Reviewed-on: https://gerrit.chromium.org/gerrit/42813
Reviewed-by: Arman Uguray <armansito@chromium.org>
Commit-Queue: Thieu Le <thieule@chromium.org>
Tested-by: Thieu Le <thieule@chromium.org>
/system/connectivity/shill/device_info_unittest.cc
5086b9744e8330e7f3bd8ab91fe20b53dda28a1c 16-Jan-2013 Ben Chan <benchan@chromium.org> shill: Add Manager.UninitializedTechnologies property.

This CL adds an UninitializedTechnologies property to the Manager
interface to include the technologies of uninitialized devices that have
been detected by shill but may not have finished initialization and
created a Device object. This allows the CrOS network UI to show the
the technologies of uninitialized devices as 'initializing'.

BUG=chromium-os:37877
TEST=Tested the following:
1. Build and run unit tests.
2. Verify that CrOS network UI shows the cellular technology as
initializing shortly after the modem is detected but before it
is fully initialized.

Change-Id: Ibf5d8eebb734207c015636cad0ca0cd9e62c7ea9
Reviewed-on: https://gerrit.chromium.org/gerrit/41350
Commit-Queue: Ben Chan <benchan@chromium.org>
Reviewed-by: Ben Chan <benchan@chromium.org>
Tested-by: Ben Chan <benchan@chromium.org>
/system/connectivity/shill/device_info_unittest.cc
4f68fe902dfab18d7db3bcecd3fd61eee7807807 16-Jan-2013 Ben Chan <benchan@chromium.org> Revert "shill: Include pre-enabled technologies in EnabledTechnologies property."

This reverts commit 08a8e0583f02479b02a72175caf07600269e5f2c

Change-Id: Icc97434b2121fae5137bb9e3a5d9db4bc87b167a
Reviewed-on: https://gerrit.chromium.org/gerrit/41340
Commit-Queue: Ben Chan <benchan@chromium.org>
Reviewed-by: Ben Chan <benchan@chromium.org>
Tested-by: Ben Chan <benchan@chromium.org>
/system/connectivity/shill/device_info_unittest.cc
08a8e0583f02479b02a72175caf07600269e5f2c 15-Jan-2013 Ben Chan <benchan@chromium.org> shill: Include pre-enabled technologies in EnabledTechnologies property.

This CL changes the EnabledTechnologies property of the Manager
interface to include the technologies of 'pre-enabled' devices that have
been detected by shill but may not have finished initialization and
created a Device object. This allows the CrOS network UI to show the
the technologies of pre-enabled devices as 'initializing'.

BUG=chromium-os:37877
TEST=Tested the following:
1. Build and run unit tests.
2. Verify that CrOS network UI shows the cellular technology as
initializing shortly after the modem is detected but before it
is fully initialized.

Change-Id: I6a98527750eda06cb533908a22c0cca09cea5cad
Reviewed-on: https://gerrit.chromium.org/gerrit/41307
Commit-Queue: Ben Chan <benchan@chromium.org>
Reviewed-by: Ben Chan <benchan@chromium.org>
Tested-by: Ben Chan <benchan@chromium.org>
/system/connectivity/shill/device_info_unittest.cc
5f06a0e6d4e64db78546fdefbd3bc5ebfb36c583 20-Dec-2012 Paul Stewart <pstew@chromium.org> shill: InputHandler: Add error callback

Input IOHandler owners now must supply a callback for handling
input exceptions. This allows individual modules to decide
whether or not this is a fatal error or not.

BUG=chromium-os:37415
TEST=New unit tests, Manual: Make sure HTTPProxy and HTTPRequest
continue to work normally

Change-Id: Idf9c106d5f2a4985fb4720f54ddb6d66c60f9173
Reviewed-on: https://gerrit.chromium.org/gerrit/40021
Commit-Queue: Paul Stewart <pstew@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/device_info_unittest.cc
4b28586abe9edee0179ea7672ac5ea9d9dc13ac7 11-Oct-2012 Ben Chan <benchan@chromium.org> shill: wimax: Obtain MAC address after WiMax device DBus object appears.

BUG=chrome-os-partner:10674
TEST=Tested with corresponding changes in wimax-manager and verified
that shill obtains the correct MAC address of the WiMAX device the
system resumes from suspend.

Change-Id: I762681f0cbcf77685e4bcd9c55fe0ef0d5fc3ab6
Reviewed-on: https://gerrit.chromium.org/gerrit/35254
Commit-Ready: Ben Chan <benchan@chromium.org>
Reviewed-by: Ben Chan <benchan@chromium.org>
Tested-by: Ben Chan <benchan@chromium.org>
/system/connectivity/shill/device_info_unittest.cc
226d46a2e03d316e8a36f93cb261f708219aef07 11-Oct-2012 Ben Chan <benchan@chromium.org> shill: cellular: Recognize cellular devices using qmi_wwan driver.

BUG=chromium-os:35211
TEST=Tested the following:
1. Build and run unit tests.
2. Verify that shill creates a Cellular object for a device using the
qmi_wwan driver.

Change-Id: If72a52f9ca26f97feb32c0bb34660038c407fb7b
Reviewed-on: https://gerrit.chromium.org/gerrit/35256
Reviewed-by: Darin Petkov <petkov@chromium.org>
Commit-Ready: Ben Chan <benchan@chromium.org>
Tested-by: Ben Chan <benchan@chromium.org>
/system/connectivity/shill/device_info_unittest.cc
fc34925d45add6f1c81a42a7632621e69bfdc43e 30-Aug-2012 Han Shen <shenhan@google.com> Fix shill unittest build problem for gcc 4.7.

gcc 4.7 is more strict about type conversion in initilization list,
for example -

const char apple[] = {0xff, 0xfe};

The above compiles ok prior to gcc 4.7, but fails on gcc 4.7 with
-Wall -Werror. The reason is that 0xff is out of bound for (signed)
char type.

TEST=Built/tested using gcc 4.7
BUG=None

Change-Id: I597cac783954b856726494b757d69ddbc6c4436b
Reviewed-on: https://gerrit.chromium.org/gerrit/31908
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Commit-Ready: Han Shen <shenhan@chromium.org>
Tested-by: Han Shen <shenhan@chromium.org>
/system/connectivity/shill/device_info_unittest.cc
4178023c4d627410777bdc259bfc7a31f2a4b8e9 01-Aug-2012 Gary Morain <gmorain@chromium.org> shill: Clean up of DeviceInfo::GetMACAddressFromKernel

- Simplified GetMACAddressFromKernel by removing unnecessary code.
- Use the Sockets class.
- Add unit tests for GetMACAddressFromKernel.
- Add comments and a unit test for a "gotcha" case in ByteString.
- Add HANDLE_EINTR to Sockets.

BUG=None
TEST=All unit tests pass. Mobile, WiFi, and Ethernet work on alex.

Change-Id: I3f55daf916edb62332b4c6a2aee224d53eefd2df
Reviewed-on: https://gerrit.chromium.org/gerrit/28865
Commit-Ready: Gary Morain <gmorain@chromium.org>
Reviewed-by: Gary Morain <gmorain@chromium.org>
Tested-by: Gary Morain <gmorain@chromium.org>
/system/connectivity/shill/device_info_unittest.cc
b691efd71561246065eae3cdd73a96ca1b8a528d 09-Aug-2012 Christopher Wiley <wiley@chromium.org> shill: Rename SMLOG to SLOG

Rewrite SMLOG as SLOG, thus saving many edits. Change the location of
the SLOG macro to be memory_log.h, requiring includes to be rewritten
and reordered. While we're rewriting includes, moving all assorted
logging includes into a generic shill/logging.h, thus saving future
logging changes from altering these includes ever again.

BUG=chromium-os:31145
TEST=Builds, unit tests still pass

Change-Id: Ie5129fcbdda87f3149460209a682c698b876b09a
Reviewed-on: https://gerrit.chromium.org/gerrit/29650
Commit-Ready: Christopher Wiley <wiley@chromium.org>
Reviewed-by: Christopher Wiley <wiley@chromium.org>
Tested-by: Christopher Wiley <wiley@chromium.org>
/system/connectivity/shill/device_info_unittest.cc
05a42c23f1d37daa8689fc4240034e62ed89f8fc 03-Aug-2012 Paul Stewart <pstew@chromium.org> shill: Connection: If IP Address changes, flush everything

If a new IP configuration arrives which changes the address
assigned to the family of this IPConfig, flush addresses
and routes before applying the new configuration. Otherwise,
we end up adding the new address inclusively as a secondary
IP address and userspace programs continue to use the old
address.

BUG=chromium-os:33066
TEST=New unit tests. Manual: Change DHCP server configuration,
unplug and replug to the same network. The old DHCP configuration
is loaded (since the lease is still valid and the gateway is
reachable) but when the new DHCP information arrives, ensure that
the new IP address (and only that address) is configured, and the
routes are sane (i.e., both LAN interface route and default route
exist).

Change-Id: Ic746368d97c503271995ff30b6818d770f4340c5
Reviewed-on: https://gerrit.chromium.org/gerrit/29170
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Commit-Ready: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/device_info_unittest.cc
1ac4e84148e03752d99aecea4f743abb094f28b0 10-Jul-2012 Paul Stewart <pstew@chromium.org> shill: DeviceInfo: Track link byte tx/rx statistics

Poll for and parse the received and transmitted byte counts for
each interface and provide this information to Devices. Devices
will then persistently track these statistics until they are
reset over the control API.

BUG=chromium-os:31584
TEST=New unit tests; list-devices on a real machine

Change-Id: Id7c08c3cb3470931227759a30cb56cde47bbde3d
Reviewed-on: https://gerrit.chromium.org/gerrit/27155
Reviewed-by: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
Commit-Ready: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/device_info_unittest.cc
050cfc068fda2bd77df2ba08f7b2897bf0e0a6e0 07-Jul-2012 Paul Stewart <pstew@chromium.org> shill: device_info: Postpone cdc_ether device discovery

We test cdc_ether devices at boot to decide whether they
are cellular or plain-Ethernet devices. The method used
to do so is to figure out if there is a tty device bound
to the same USB host as the cdc_ethernet devices. With
some systems, however, the tty devices are discovered some
time after the cdc_ether device. To acommodate this,
postpone calling CreateDevice on such entries to allow
time for device discovery in the kernel to complete.

BUG=chromium-os:31504
TEST=Unit tests; test on physical device.

Change-Id: Ic0e18db6463519f87dde199ee7b804b2010992c6
Reviewed-on: https://gerrit.chromium.org/gerrit/26866
Commit-Ready: Paul Stewart <pstew@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/device_info_unittest.cc
da798623389b981130cd1922f880736f1e0e36ba 05-Jun-2012 Joshua Kroll <joshkroll@chromium.org> Remove the the TechnologyIs method from Device, associated classes, and everything else.

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

Change-Id: I581f1b0062a2a171705bc3a72e72f13d2157bf24
Reviewed-on: https://gerrit.chromium.org/gerrit/24538
Commit-Ready: Joshua Kroll <joshkroll@chromium.org>
Tested-by: Joshua Kroll <joshkroll@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/device_info_unittest.cc
c63dcf0b428ea99e8a9a88bc964a51e65b6dddf0 24-May-2012 Darin Petkov <petkov@chromium.org> shill: wimax: Refactor service management out of WiMax into WiMaxProvider.

This allows WiMAX service management to be independent from the
availability of WiMAX devices.

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

Change-Id: I52ad31ed8ef1d271b04bbd2cfc17729a5c112831
Reviewed-on: https://gerrit.chromium.org/gerrit/23511
Commit-Ready: Darin Petkov <petkov@chromium.org>
Reviewed-by: Darin Petkov <petkov@chromium.org>
Tested-by: Darin Petkov <petkov@chromium.org>
/system/connectivity/shill/device_info_unittest.cc
e4b270274cba2a1976c7be6c733bd899e009c1d1 16-May-2012 Darin Petkov <petkov@chromium.org> shill: Complete interaction between DeviceInfo and WiMaxProvider.

WiMaxProvider now creates/registers and destroys/deregisters devices
based on DeviceInfo and RPC callbacks. Also, add missing DeviceInfo
WiMax unit tests, and implement WiMaxService's GetDeviceRpcIdentifier
and GetStorageIdentifier.

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

Change-Id: I9dbf8f785ef824ca5628b96a2e22ec0ef6336b97
Reviewed-on: https://gerrit.chromium.org/gerrit/22807
Commit-Ready: Ben Chan <benchan@chromium.org>
Reviewed-by: Ben Chan <benchan@chromium.org>
Tested-by: Ben Chan <benchan@chromium.org>
Reviewed-by: Darin Petkov <petkov@chromium.org>
/system/connectivity/shill/device_info_unittest.cc
8c116a90d3a3536430b808b15e73275060918434 03-May-2012 Paul Stewart <pstew@chromium.org> shill: device_info: Revamp address/route flushing

The route flushing for devices ended up floating around in the device
code with a number of changes and lodged itself in a place where it
might not even be called in some situations. The address flush code
was only being called on connection close, and only applied to
addresses that were active before the system started up.

Implemented the following fixes:

- Move FlushRoutes out of Device to the initialization code in
DeviceInfo.

- Add Address flushing code in the same place.

- Capture the list of IP addresses per-interface earlier at startup
so they can be flushed at device discovery. This involved re-ordering
the RTNL "Dump" path to dump addresses before links, and adding code
in DeviceInfo to capture these addresses in its Info structures before
the actual link was discovered. This way, when the link is discovered,
it's possible to flush the old addresses.

- Use the NLM_ECHO flag when creating and deleting IP addresses in RTNL,
so RTNL events are generated even for operations that originate from
shill, and the tables are better kept up to date, so when Connections
flush IP addresses on disconnect, this properly includes those that
were created locally.

- Break apart DeviceInfo::AddLinkMsgHandler so it can be tested.

BUG=chromium-os:30358
TEST=New unit tests + plug/unplug between different networks / kill/restart
shill.

Change-Id: Ie1a38e0e86ba3a52aaaaf9c3f0e0dfcb3c8fc276
Reviewed-on: https://gerrit.chromium.org/gerrit/21719
Commit-Ready: Paul Stewart <pstew@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/device_info_unittest.cc
abc5403270e26fa898181301911a905758f8d758 20-Apr-2012 Jason Glasgow <jglasgow@chromium.org> shill: device: Add a special pseudo device to allow for VM testing of cellular

Recognize devices pseduomodem* as cellular devices so that we can use
a python modem manager to test the modem code using autotest in a VM.

BUG=none
TEST=unit tests and in progress fake-modem.py
Change-Id: I6c2895ce32df6d11fff891115559a9a3175320e0
Reviewed-on: https://gerrit.chromium.org/gerrit/20766
Commit-Ready: Jason Glasgow <jglasgow@chromium.org>
Reviewed-by: Jason Glasgow <jglasgow@chromium.org>
Tested-by: Jason Glasgow <jglasgow@chromium.org>
/system/connectivity/shill/device_info_unittest.cc
f8046b8f975417255baf5cc7cdd025c63aa2f918 24-Apr-2012 Darin Petkov <petkov@chromium.org> shill: vpn: Create a VPN device for L2TP/IPSec and apply IP configuration.

Also, implement a new DeviceInfo API for retrieving the interface
index based on the interface name.

BUG=chromium-os:18496,chromium-os:29912
TEST=unit tests

Change-Id: I7d9e667d2c63baa96ed2b01dfa580de7d361b5f3
Reviewed-on: https://gerrit.chromium.org/gerrit/20931
Tested-by: Darin Petkov <petkov@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Reviewed-by: Ben Chan <benchan@chromium.org>
Commit-Ready: Darin Petkov <petkov@chromium.org>
/system/connectivity/shill/device_info_unittest.cc
d20cf7562b87ea2dbe33892de407cc4fa42a1e00 23-Apr-2012 Paul Stewart <pstew@chromium.org> shill: DeviceInfoTest: Remove leftover log

BUG=None
TEST=Rerun unit test
TBR=None

Change-Id: I04070888fbf05db30cbb40291ec7fba3f4982450
Reviewed-on: https://gerrit.chromium.org/gerrit/20858
Reviewed-by: Thieu Le <thieule@chromium.org>
Commit-Ready: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/device_info_unittest.cc
ca876ee6b11b38a3df7a8ab03efe9ed0bcab41d8 21-Apr-2012 Paul Stewart <pstew@chromium.org> shill: Add support for detecting PPP devices

Use the device ARP Hardware Type to detect both PPP devices. Fix
up loopback to use the same. Also add unit tests for
DeviceInfo::GetDeviceTechnology().

BUG=chromium-os:29771
TEST=New unit tests. Manual: Run on device for loopback, ppp, tunnel and wifi

Change-Id: I8b39bcf68926757d10756b9cbc1692ec891e117f
Reviewed-on: https://gerrit.chromium.org/gerrit/20802
Reviewed-by: Darin Petkov <petkov@chromium.org>
Commit-Ready: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/device_info_unittest.cc
b27beee2e85a1ad3d68a1218c8c4fef4214626e8 20-Apr-2012 Thieu Le <thieule@chromium.org> shill: Generalize detection of cdc_ether modem device tty interface.

Previously, shill looked for the tty interface in a cdc_ether modem
device sysfs directory tree at a particular directory depth. Some cdc_ether
modem devices (eg. E362) have the tty interface one directory lower. This CL
changes the code to look for the tty directory at all directory levels
relative to the USB device directory.

BUG=chromium-os:28499
TEST=Unit test, manually tested on Y3300 and E362

Change-Id: I4a67bfa21322bbb3aabf2799008e513e193a0744
Reviewed-on: https://gerrit.chromium.org/gerrit/20695
Commit-Ready: Thieu Le <thieule@chromium.org>
Reviewed-by: Thieu Le <thieule@chromium.org>
Tested-by: Thieu Le <thieule@chromium.org>
Reviewed-by: Jason Glasgow <jglasgow@chromium.org>
/system/connectivity/shill/device_info_unittest.cc
8f1c835d879f82261a08257eb6f9677e6be51fda 16-Apr-2012 Thieu Le <thieule@chromium.org> shill: Differentiate between various cdc_ether devices.

Add code to distinguish between a cdc_ether cellular device and a
cdc_ether ethernet device.

BUG=chromium-os:28499
TEST=New unit tests, manually verify detection of cdc_ether modem devices
on y3300 and y3400.

Change-Id: I5ca68b68edaac25bdb4b86abb96366c13f0e6e23
Reviewed-on: https://gerrit.chromium.org/gerrit/20317
Reviewed-by: Jason Glasgow <jglasgow@chromium.org>
Commit-Ready: Thieu Le <thieule@chromium.org>
Tested-by: Thieu Le <thieule@chromium.org>
/system/connectivity/shill/device_info_unittest.cc
e81eb700f66563cb695b6e3682f20ac5a0cdb8c0 12-Apr-2012 Paul Stewart <pstew@chromium.org> shill: deviceinfo: Mark all loopback devices up

We largely ignore loopback interfaces, but mark the link up.

BUG=chromium-os:29334
TEST=New unit test plus test on machine by setting lo down and starting shill

Change-Id: I46b7eb21280ff88ed935b940273901f334b78c4e
Reviewed-on: https://gerrit.chromium.org/gerrit/20023
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Commit-Ready: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/device_info_unittest.cc
3e20a2341d0aeb7681e4ee0f89eae6817ade2b3b 16-Feb-2012 Eric Shienbrood <ers@chromium.org> shill: Convert code to use the newest version of libchrome.

The biggest change is a switch from using the deprecated
Task and CallbackN mechanisms to using the new Callback
mechanism.

Note: Original CL was https://gerrit.chromium.org/gerrit/16156.
This is logically another patch to that CL, but since the
latter was already merged, and is considered closed by
Gerrit, it's necessary to create a new CL.

BUG=chromium-os:15330
TEST=Build shill and run it on a zgb with a modem. Build and
run unit tests.
CQ-DEPEND=I37628863370323d30cac493764ea28f8ffd42637

Change-Id: I3ae78a3aa44ec167b79f2170d07650ece888254f
Reviewed-on: https://gerrit.chromium.org/gerrit/18030
Reviewed-by: Eric Shienbrood <ers@chromium.org>
Tested-by: Eric Shienbrood <ers@chromium.org>
Commit-Ready: Eric Shienbrood <ers@chromium.org>
/system/connectivity/shill/device_info_unittest.cc
b5c8940ae68f85c8c822936f41f4993c51624dcf 13-Mar-2012 Eric Shienbrood <ers@chromium.org> Revert "shill: Convert code to use the newest version of libchrome."

This reverts commit ffebe0c489e0ecccf497547d7078c30cbc8072e2

Unit tests ran on local machine, but wouldn't run on CQ because of some kind of environment difference.

Change-Id: Ia876c0c17f4cd84bca5e2f1bacd7e24a81832d4d
Reviewed-on: https://gerrit.chromium.org/gerrit/17969
Reviewed-by: Eric Shienbrood <ers@chromium.org>
Tested-by: Eric Shienbrood <ers@chromium.org>
/system/connectivity/shill/device_info_unittest.cc
08a4ffb4ecf5893eb55c523d528bf3e52c66facf 16-Feb-2012 Eric Shienbrood <ers@chromium.org> shill: Convert code to use the newest version of libchrome.

The biggest change is a switch from using the deprecated
Task and CallbackN mechanisms to using the new Callback
mechanism.

This cannot be submitted until vapier submits his CL that
slot-enables the libchrome build
(https://gerrit.chromium.org/gerrit/15415).

BUG=chromium-os:15330
TEST=Build shill and run it on a zgb with a modem. Build and
run unit tests.
CQ-DEPEND=Ic24bb16aac3e1d130a784f34e848e308719a43be

Change-Id: I081a7aa66bee391b867a43e08db2eacdff760945
Reviewed-on: https://gerrit.chromium.org/gerrit/16156
Tested-by: Eric Shienbrood <ers@chromium.org>
Commit-Ready: Eric Shienbrood <ers@chromium.org>
Reviewed-by: Eric Shienbrood <ers@chromium.org>
/system/connectivity/shill/device_info_unittest.cc
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/device_info_unittest.cc
26b327e559583d5a84b7e1605c29a4dcbc87d2a9 19-Oct-2011 Paul Stewart <pstew@chromium.org> shill: A couple of naming cleanups

Rename shill_event.* -> event_dispatcher.*. This is more
consistent with correct style. Also rename IOInputHandler ->
InputHandler.

BUG=None
TEST=Rerun unit tests

Change-Id: I13d56b857c85b32ba1418e894de68afc5a23f00d
Reviewed-on: http://gerrit.chromium.org/gerrit/10326
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Reviewed-by: Darin Petkov <petkov@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/device_info_unittest.cc
1830fa1f2e8691073f4d07b0883f059a290a9cc2 26-Sep-2011 mukesh agrawal <quiche@chromium.org> shill: enable (don't disable) -Wunused

having fixed an unused parameter in the dbus-c++ headers, those
headers no longer have unused parameters. so, if we fix up unused
parameters in shill code, we can compile with -Wunused. (this is
implied by -Wall, as long as we don't override with -Wno-unused.)

BUG=chromium-os:20779
TEST=unittests

- comment out unused parameters in function definitions
- remove some unused local variables
- also: fix an old-style cast

Change-Id: Ie654a7b34d622cecb0f26bd47c17813fe8423001
Reviewed-on: http://gerrit.chromium.org/gerrit/8365
Tested-by: mukesh agrawal <quiche@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/device_info_unittest.cc
fdd1607e26db6c10585f7eefa0e02546274ea8f5 16-Sep-2011 Paul Stewart <pstew@chromium.org> shill: Add Technology class

Move Technology enum out into its own class, and create static
functions for converting between these and strings.

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

Change-Id: I9e3aea44e5d0b14d844328f023b01d7f8ea04c42
Reviewed-on: http://gerrit.chromium.org/gerrit/8204
Reviewed-by: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/device_info_unittest.cc
7355ce1937c504d836a303ac809bd436272212b3 02-Sep-2011 Paul Stewart <pstew@chromium.org> shill: Naming and lint cleanup pass

Reduce some double-speak in IPAddress constants. Do a cursory
glint pass and clean up a few no-brainer issues.

BUG=None
TEST=Re-run unit tests

Change-Id: I063cd72111bd1f6321f81c6c6591b9f51d87434d
Reviewed-on: http://gerrit.chromium.org/gerrit/7181
Reviewed-by: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/device_info_unittest.cc
9a908080fc2a72dbf06f995b878fc8a3693b725a 31-Aug-2011 Paul Stewart <pstew@chromium.org> shill: Add IP Address tracking to DeviceInfo

Subscribe to IP Address messages in DeviceInfo, and create a
per-device list of assigned IP Addresses. Provide a method
to flush all globally scoped addresses from a device.

As a result, we can now flush assigned IP addresses when a
Connection is terminated. There is also some incidental cleanup
in RTNLHandler to remove some vestiges of hand-baked RTNL
message encoding.

BUG=chromium-os:19744
TEST=Run new unit tests. Test using ethernet on a netbook to make sure
addresses are added and removed correctly.

Change-Id: I63fd09088e71c43cb1f11a89a8ef15e11074976c
Reviewed-on: http://gerrit.chromium.org/gerrit/7180
Reviewed-by: Darin Petkov <petkov@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/device_info_unittest.cc
3285296e6624fa0b1b10699f2fa6466d4be10742 30-Aug-2011 Paul Stewart <pstew@chromium.org> shill: Rename address -> mac_address

Rename the "address" field in DeviceInfo::Info to "mac_address",
since this struct will now also hold IP addresses.

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

Change-Id: I724e389c32ca6a730d476d825f916461161e1442
Reviewed-on: http://gerrit.chromium.org/gerrit/7179
Reviewed-by: Darin Petkov <petkov@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/device_info_unittest.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/device_info_unittest.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/device_info_unittest.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/device_info_unittest.cc
626719f89881a949d8b5a8fa808beb924496489f 19-Aug-2011 Chris Masone <cmasone@chromium.org> Re-land "[shill] Add hardware address to Device objects."

Forgot some headers...

BUG=chromium-os:17744
TEST=unit

This reverts commit 0fda552b0fec3498403336acb9e89dd7799cac74.

Change-Id: I1cd05e47d29bc7ea2a065cabf1d81dd37f74c0f8
Reviewed-on: http://gerrit.chromium.org/gerrit/6270
Reviewed-by: Chris Masone <cmasone@chromium.org>
Tested-by: Chris Masone <cmasone@chromium.org>
/system/connectivity/shill/device_info_unittest.cc
0fda552b0fec3498403336acb9e89dd7799cac74 19-Aug-2011 Chris Masone <cmasone@chromium.org> Revert "[shill] Add hardware address to Device objects."

This reverts commit 1f694d095374fddb9a258b376cffb54ed73981d5

forgot some files

Change-Id: Ifcf5e6551b993354f91fab1e4ef8d337917dfc15
Reviewed-on: http://gerrit.chromium.org/gerrit/6269
Reviewed-by: Chris Masone <cmasone@chromium.org>
Tested-by: Chris Masone <cmasone@chromium.org>
/system/connectivity/shill/device_info_unittest.cc
b17d42d5743f7b9bf4d5f1d77d3eedd3a1edbab5 19-Aug-2011 Chris Masone <cmasone@chromium.org> [shill] Add hardware address to Device objects.

BUG=chromium-os:17744
TEST=unit

Change-Id: I78bf578aa1ebf3151c33c357b0cbc0b1bfd75d75
Reviewed-on: http://gerrit.chromium.org/gerrit/6260
Tested-by: Chris Masone <cmasone@chromium.org>
Reviewed-by: Darin Petkov <petkov@chromium.org>
/system/connectivity/shill/device_info_unittest.cc
e3e1cfaadc69ea67db55f11e55f404b11a70e354 11-Aug-2011 Darin Petkov <petkov@chromium.org> shill: DeviceInfo::GetAddress can be used now to lookup the device MAC address.

Also enhance ByteString with a HexEncode method used for logging.

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

Change-Id: Ie64ebb0d009ce7fb3ed16948a7789ef721b56039
Reviewed-on: http://gerrit.chromium.org/gerrit/5766
Reviewed-by: Darin Petkov <petkov@chromium.org>
Tested-by: Darin Petkov <petkov@chromium.org>
/system/connectivity/shill/device_info_unittest.cc
e6193c042652831cac90c3bbf2233877754b1eef 11-Aug-2011 Darin Petkov <petkov@chromium.org> shill: Cache link status flags in DeviceInfo.

This allows the rest of the system to obtain current device flags at any given
point without going through RPC.

BUG=chromium-os:19027
TEST=unit tests

Change-Id: I8430f33bb1915115f1673944a1fb74fb8caefb1e
Reviewed-on: http://gerrit.chromium.org/gerrit/5762
Reviewed-by: Darin Petkov <petkov@chromium.org>
Tested-by: Darin Petkov <petkov@chromium.org>
/system/connectivity/shill/device_info_unittest.cc
2aa9707f114ab8166f45df5726bf05278df2aef6 10-Aug-2011 Chris Masone <cmasone@chromium.org> [shill] Migrate to RTNLMessage instead of nlmsghdr

Now, RTNLHandler deals with nlmsghdrs internally, and passes parsed RTNLMessage
objects to everyone else.

Also, move some code out of device_info_unittest.cc that was testing
RTNLHandler::ParseRTNL

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

Change-Id: I8e1546ea8e996a0e2302fe5e5937b03c13cb1a61
Reviewed-on: http://gerrit.chromium.org/gerrit/5612
Reviewed-by: Chris Masone <cmasone@chromium.org>
Tested-by: Chris Masone <cmasone@chromium.org>
/system/connectivity/shill/device_info_unittest.cc
65c40f5c1b1a53e351c6487de72b616854dfdc47 08-Aug-2011 Paul Stewart <pstew@chromium.org> Fix issue with request flags leak between tests

Reset request flags of RTNLHandler on Stop(). Make Stop() private, but
call it in teardown of all unit tests that call Start().

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

Change-Id: I83d32abc561e80c9dc72239825907cb5d5155bca
Reviewed-on: http://gerrit.chromium.org/gerrit/5461
Reviewed-by: Darin Petkov <petkov@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/device_info_unittest.cc
75e89d2d5ecb3c42a869f485d4483fd2176381c0 01-Aug-2011 Paul Stewart <pstew@chromium.org> shill: Add routing table RTNL message handler

Maintain a copy of the routing table state. This achieved by
a singleton that maintains an in-process copy of the routing
table on a per-interface basis. It offers the ability for
other modules to make modifications to the routing table,
centered around setting the default route for an interface or
modifying its metric (priority), but also providing more
granular control for services/devices that may need more control,
like VPN.

BUG=chromium-os:17277
TEST=New unittest

Change-Id: Ifcda0ab2cb8775bca677979ca98ac3fcf7adfdde
Reviewed-on: http://gerrit.chromium.org/gerrit/5163
Reviewed-by: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/device_info_unittest.cc
8f317b600a218afe05f2d73c59204bb98269a950 15-Jul-2011 mukesh agrawal <quiche@chromium.org> shill: add ability to blacklist devices

BUG=chromium-os:16787
TEST=ebuild + manual

manual testing: set up mac80211_hwsim and hostapd on a device.
run shill, observe that it core dumps. run shill again, with
"--black-list=mon.wlan1", observe that it does not core dump.

Change-Id: Id43ed8badc2d8ac414c8a2ceb7487ecb85dc851c
Reviewed-on: http://gerrit.chromium.org/gerrit/4414
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Tested-by: mukesh agrawal <quiche@chromium.org>
/system/connectivity/shill/device_info_unittest.cc
887f2983bc84acc15139df257e43217fec1f6cdb 15-Jul-2011 Darin Petkov <petkov@chromium.org> shill: Add a ModemInfo object that's a peer of DeviceInfo.

ModemInfo is responsible for managing ModemManager instances. Each ModemManager
instance watches for and handles an individual ModemManager DBus service. Each
ModemManager will be responsible for creating cellular devices associated with
that ModemManager.

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

Change-Id: Ie9946cba4465aea8671305e32596fc9f6cca96e2
Reviewed-on: http://gerrit.chromium.org/gerrit/4124
Reviewed-by: Darin Petkov <petkov@chromium.org>
Tested-by: Darin Petkov <petkov@chromium.org>
/system/connectivity/shill/device_info_unittest.cc
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/device_info_unittest.cc
633ac6f0d56a62f8fd21ba7d9a15818fe080fb2f 08-Jul-2011 Darin Petkov <petkov@chromium.org> shill: Add a mockable layer for socket.h.

Mock the layer in device_info_unittest.cc. Some cleanup.

BUG=chromium-os:17394
TEST=unit tests

Change-Id: I2ddcb2fd0e01418a463596bf4e3a804b3e3023b2
Reviewed-on: http://gerrit.chromium.org/gerrit/3807
Reviewed-by: Darin Petkov <petkov@chromium.org>
Tested-by: Darin Petkov <petkov@chromium.org>
/system/connectivity/shill/device_info_unittest.cc
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/device_info_unittest.cc
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/device_info_unittest.cc
d0ceb8c66779819ab12b8abb488aed22b7d04fd3 02-Jun-2011 Chris Masone <cmasone@chromium.org> [shill] Add signal emitting to adaptor interfaces

BUG=chromium-os:16063
TEST=unit tests

Change-Id: Ib94cd3c27af5fb64202da42594f98b864b0e158b
Reviewed-on: http://gerrit.chromium.org/gerrit/2009
Reviewed-by: Chris Masone <cmasone@chromium.org>
Tested-by: Chris Masone <cmasone@chromium.org>
/system/connectivity/shill/device_info_unittest.cc
a3c56f9f49e6c72ff55cc1224cccd60538e9b788 26-May-2011 Paul Stewart <pstew@chromium.org> Split off rtnl facility from device_info

Create an "rtnl_handler" singleton for conversing with rtnl socket.
Create "listener" objects that hold callbacks to interested parties.

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

Change-Id: Ica845b39ce6a0885a4e6d2560146ff8f5f45b900
Reviewed-on: http://gerrit.chromium.org/gerrit/1632
Reviewed-by: Chris Masone <cmasone@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/device_info_unittest.cc
46eaaf53d5e5b92f418b8d7cbfe7e847b575791f 24-May-2011 Chris Masone <cmasone@chromium.org> [shill] Build is broken...bad merge??

BUG=None
TEST=FEATURES=test emerge-x86-generic shill

Change-Id: I78e646c1d532adc374a7db28628238c8c4c30bdb
Reviewed-on: http://gerrit.chromium.org/gerrit/1471
Tested-by: Chris Masone <cmasone@chromium.org>
Reviewed-by: Darin Petkov <petkov@chromium.org>
/system/connectivity/shill/device_info_unittest.cc
b50f0b9837c398b8edd5dc568eb01bdcff9a4d65 17-May-2011 Paul Stewart <pstew@chromium.org> Perform device discovery and registration in device_info

Also, do device classification, and create the beginnings of
Device subclasses for WiFi and Ethernet.

BUG=chromium-os:12933
TEST=Added unit tests. Also manual on a testbed machine to confirm WiFi
device detection.

Change-Id: I48b8fa2b3b966b22acf80f693d9522bff0221884
Reviewed-on: http://gerrit.chromium.org/gerrit/1084
Reviewed-by: Chris Masone <cmasone@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/device_info_unittest.cc
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/device_info_unittest.cc