History log of /system/connectivity/shill/device_info.h
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
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.h
c0beca55d290fe0b1c96d78cbbcf94b05c23f5a5 03-Sep-2015 Peter Qiu <zqiu@google.com> License shill to Apache2

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

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

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

Change-Id: If41ede586c2465f5831fb7fee270ff41dbfdb596
/system/connectivity/shill/device_info.h
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/device_info.h
208a97ed32c62bc11b0a20eaf01833482e8c0fbc 13-May-2015 Paul Stewart <pstew@chromium.org> shill: Device: Perform validation of accepted hostname

The hostname retrieved from the DHCP server may be too large.
Try to be smart about truncating the hostname so that one can
be successfully set.

BUG=chromium:475699
TEST=New unit tests + network_DhcpRequestHostname

Change-Id: Ic60c86919590f394de32a611296f9b9fbe454fb0
Reviewed-on: https://chromium-review.googlesource.com/270579
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.h
1a72f5444e077ed21b8e085b17d7f9f1bc44fa5e 15-Apr-2015 Peter Qiu <zqiu@chromium.org> shill: compiler option support for wifi and wired 802.1x

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

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

Change-Id: I6abaa150657f6ca0f6d5c37229fde9a2c0bb36aa
Reviewed-on: https://chromium-review.googlesource.com/265774
Tested-by: Zeping Qiu <zqiu@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Commit-Queue: Zeping Qiu <zqiu@chromium.org>
/system/connectivity/shill/device_info.h
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.h
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.h
127b341755731bd6ecc19e44b63c23c79e0b7cd1 16-Oct-2014 Prabhu Kaliamoorthi <kaliamoorthi@chromium.org> shill: Third party VPN driver and DBus bindings

This CL adds Third party VPN driver and DBus bindings to Shill daemon

BUG=chromium:407541
TEST=Compilation test, basic functionality test with autotest framework and trybots (beaglebone-paladin, lumpy-paladin, falco-paladin, daisy-paladin, x86-generic-paladin, amd64-generic-paladin)

Change-Id: I98095a784843df325fc41dc25498938cd1ec9e75
Reviewed-on: https://chromium-review.googlesource.com/223690
Reviewed-by: Paul Stewart <pstew@chromium.org>
Commit-Queue: Prabhu Kaliamoorthi <kaliamoorthi@chromium.org>
Tested-by: Prabhu Kaliamoorthi <kaliamoorthi@chromium.org>
/system/connectivity/shill/device_info.h
8d6b59704591ba9fad57751858835dc332dbdd37 28-Oct-2014 Peter Qiu <zqiu@chromium.org> shill: export a shared library for RTNL interface.

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

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

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

Change-Id: I7f5c183b8a347c02e80ffed5e3497f691dde517c
Reviewed-on: https://chromium-review.googlesource.com/226110
Reviewed-by: Peter Qiu <zqiu@chromium.org>
Tested-by: Peter Qiu <zqiu@chromium.org>
Commit-Queue: Peter Qiu <zqiu@chromium.org>
/system/connectivity/shill/device_info.h
cd47732488cd101eaf0d3558dde5a7d4e4fc260b 17-Oct-2014 Ben Chan <benchan@chromium.org> shill: Replace scoped_ptr with std::unique_ptr.

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

Change-Id: Id9737d9a9c75ecb6abb466b5559ff06dcf0751cd
Reviewed-on: https://chromium-review.googlesource.com/224138
Tested-by: Ben Chan <benchan@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Commit-Queue: Ben Chan <benchan@chromium.org>
/system/connectivity/shill/device_info.h
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.h
7fab89734d88724a288e96a9996b15548c5294c7 11-Aug-2014 Ben Chan <benchan@chromium.org> shill: Use integer types from stdint.h

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

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

Change-Id: I3d4c195881203dd2a47dbb5af150b6c90b9c206e
Reviewed-on: https://chromium-review.googlesource.com/211770
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Commit-Queue: Ben Chan <benchan@chromium.org>
Tested-by: Ben Chan <benchan@chromium.org>
/system/connectivity/shill/device_info.h
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.h
c45688bb3881f0c2216e6ec0e19ebda0be33e871 03-Jul-2014 Ben Chan <benchan@chromium.org> shill: Fix header guards to conform to coding style.

BUG=chromium:385849
TEST=Tested the following:
1. `USE='cellular wimax' FEATURES=test emerge-$BOARD platform2`
2. `cpplint.py --filter=-build/include_order shill/*.h` reports no
'build/header_guard' issue.

Change-Id: I1a3972a1f88e5001550eccd561633bd4e5c5faba
Reviewed-on: https://chromium-review.googlesource.com/206680
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.h
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.h
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.h
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.h
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.h
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.h
12533ad51178dd83d1899ab738c9f7aeb564fe03 02-Aug-2013 mukesh agrawal <quiche@chromium.org> shill: add yet more unit tests for ppp dongle support

This time, we add a test for Modem.

BUG=chromium:246826
TEST=unit tests (old+new)

Change-Id: I8d7118868d16eef370e5a95e8212ca510efe393e
Reviewed-on: https://gerrit.chromium.org/gerrit/64288
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Tested-by: mukesh agrawal <quiche@chromium.org>
Commit-Queue: mukesh agrawal <quiche@chromium.org>
/system/connectivity/shill/device_info.h
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.h
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.h
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.h
0e1cdeae24dd678a5fe27c840802582c0ca45ec0 28-Feb-2013 Albert Chaulk <achaulk@chromium.org> shill: Implement Service.Remove & delete DHCP leases

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

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

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

Change-Id: Ic6eee17b9d81cd0be8d09c683d85d6a4d19278c9
Reviewed-on: https://gerrit.chromium.org/gerrit/44339
Tested-by: Albert Chaulk <achaulk@chromium.org>
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Commit-Queue: Albert Chaulk <achaulk@chromium.org>
/system/connectivity/shill/device_info.h
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.h
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.h
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.h
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.h
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.h
e049cc5ad0db026c66cf448cecc48330b9e59360 10-Sep-2012 Christopher Wiley <wiley@chromium.org> shill: Special case virtual ethernet devices

This lets shill start up its autoconfiguration logic on a virtual
ethernet device. We use this to test dhcpcd<->shill interactions.

BUG=chromium-os:32809
TEST=shill starts dhcpcd on virtual ethernet devices with special name

Change-Id: I1785a115a50a7312a4c0c3ac4195388e621c7116
Reviewed-on: https://gerrit.chromium.org/gerrit/32803
Tested-by: Christopher Wiley <wiley@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Commit-Ready: Christopher Wiley <wiley@chromium.org>
/system/connectivity/shill/device_info.h
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.h
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.h
bf74a67a6dec2f438e6826a3f39c4e1100d1f016 31-Jul-2012 Gary Morain <gmorain@chromium.org> shill: Use real MAC address for cellular devices.

Read the MAC address for cellular devices from the kernel at
the time of device creation instead of using the MAC address
from the RTNL link-add message.

The MAC address in the link-add message for usb-based devices
may not be consistent from one reboot to another. The MAC
address is used in the shill profile's entry for the device,
and so if the MAC address changes from one reboot to another,
ChromeOS does not use the existing entry in the profile but
instead creates another, with input from the user.

BUG=chromium-os:33006
TEST=Run all unit tests. Test with Gobi 2k (which exhibits the problem
of 33006), Gobi 3k, and E362.

Change-Id: I2147139c2f33a0ee9909516933e500cefb7dc2bc
Reviewed-on: https://gerrit.chromium.org/gerrit/28738
Reviewed-by: Paul Stewart <pstew@chromium.org>
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Commit-Ready: Gary Morain <gmorain@chromium.org>
Tested-by: Gary Morain <gmorain@chromium.org>
/system/connectivity/shill/device_info.h
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.h
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.h
5a850476dd0d049fa07e54015430c4d19d3d6ae8 06-Jun-2012 Darin Petkov <petkov@chromium.org> shill: vpn: Implement a ProcessKiller singleton.

This class may be used to terminate and reap child processes
asynchronously and robustly. Also:

- Use ProcessKiller to kill spawned "openvpn" and "l2tpipsec_vpn"
processes.

- Delete the associated OpenVPN tunnel interfaces cleanly after the
openvpn process dies.

- Fix a somewhat harmless bug where shill was sending SIGTERM to
already dead VPN processes from child watch callbacks.

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

Change-Id: If15f08e76c51dac33a434551ef4ba11ca66d0401
Reviewed-on: https://gerrit.chromium.org/gerrit/24610
Tested-by: Darin Petkov <petkov@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Commit-Ready: Darin Petkov <petkov@chromium.org>
/system/connectivity/shill/device_info.h
4e64d2d72eed1947ab1d15e6ce25a47c37a9e10c 16-May-2012 Ben Chan <benchan@chromium.org> shill: Identify WiMAX device in DeviceInfo.

BUG=chrome-os-partner:9734
TEST=Build and run unit tests

Change-Id: Ib0b28e858adaaa0ae54e2dc22513d57ca158c32e
Reviewed-on: https://gerrit.chromium.org/gerrit/22793
Reviewed-by: Darin Petkov <petkov@chromium.org>
Tested-by: Darin Petkov <petkov@chromium.org>
Commit-Ready: Darin Petkov <petkov@chromium.org>
/system/connectivity/shill/device_info.h
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.h
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.h
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.h
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.h
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.h
93a29ed675f5c75250d09e192d72fe6804c10111 18-Apr-2012 mukesh agrawal <quiche@chromium.org> shill: avoid virtio_net race condition

With the virtnet driver, it's possible for the kernel's IPv6 code
to transmit frames before virtnet_probe completes. This seems to confuse
the driver, making the device unable to transmit. To make use of the
device, one then has to unload and reload (rmmod+modprobe) the driver.
This makes difficult to run shill in a VM. That means that a patch
to enable shill as the default CM won't make it through the commit queue.

Work around the virtnet+IPv6 problem by sleeping before bringing
up the virtual ethernet device. Empirically, it takes about 7ms
from the time shill gets the notification about the virtnet device
being available, until the time when virtnet_probe completes.
We sleep 2 seconds (2000ms) to leave lots of slack.

Collateral change: declare some Ethernet methods as virtual.
They're already virtual (by virtual of their base class declarations),
but declaring them virtual in Ethernet makes this explicit.

BUG=chromium-os:29494
TEST=trybots, manual testing (see below)

Trybots: ran on 10 trybots, with 20 iterations of VMTest
each. (Using https://gerrit.chromium.org/gerrit/#change,19560.)
Saw no failures.

Manual testing: Ran shill in VM, verified that ethernet
was identified as using virtio driver. Ran shill on an
Alex (with linksys usb ethernet adapter), verified that
ethernet was not identified as using virtio driver.

Change-Id: I48727e65c2f64f9973faaf9eeaedfbcf452b0b82
Reviewed-on: https://gerrit.chromium.org/gerrit/20415
Reviewed-by: Paul Stewart <pstew@chromium.org>
Commit-Ready: mukesh agrawal <quiche@chromium.org>
Tested-by: mukesh agrawal <quiche@chromium.org>
/system/connectivity/shill/device_info.h
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.h
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.h
fa1d31d532535043460dfcffd1e9f487d52bd3c4 20-Mar-2012 David Rochberg <rochberg@chromium.org> Split Modem into ModemClassic and Modem1

Along the way:

Restructure ModemManagerXxx to use the split modem classes.

Add new mocks to limit scope of modem tests

Change modem state enum to a neutral format and convert from MM1 and
MMClassic to this format.

Fix a bug where we weren't properly releasing a callback in
DBusObjectManagerProxy.

Add new DBus property matchers

BUG=chromium-os:27935,chromium-os:27936
TEST=unit tests

Change-Id: Ib78c7dfd9e30fe556f09a4427fd71c9d785210c9
Reviewed-on: https://gerrit.chromium.org/gerrit/19228
Commit-Ready: David Rochberg <rochberg@chromium.org>
Reviewed-by: David Rochberg <rochberg@chromium.org>
Tested-by: David Rochberg <rochberg@chromium.org>
/system/connectivity/shill/device_info.h
5e628a5c722c196ad240af0ff3c717e9613d3ef5 21-Mar-2012 Eric Shienbrood <ers@chromium.org> Don't try to create cellular device if modem interface is blacklisted.

Shill does honor the presence of usb0 on the blacklist at the time the
RTNL message is received indicating the presence of the interface.
However, there is another path that can lead to creation of a Cellular
device: when ModemManager is detected, shill calls EnumerateDevices to
get a list of modems known to ModemManager. In response, shill goes
ahead and creates a Cellular device for each modem, without checking
the blacklist.

BUG=chromium-os:28215
TEST=manual testing, with and without usb0 on the blacklist

Change-Id: I7ef4348610027d6c815b3c4d382f646666725930
Reviewed-on: https://gerrit.chromium.org/gerrit/18771
Reviewed-by: Darin Petkov <petkov@chromium.org>
Commit-Ready: Eric Shienbrood <ers@chromium.org>
Tested-by: Eric Shienbrood <ers@chromium.org>
/system/connectivity/shill/device_info.h
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.h
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.h
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.h
ca6abd4635507fa5b8f4b8819a37819fb560c464 02-Mar-2012 Paul Stewart <pstew@chromium.org> shill: vpn: Claim interface from DeviceInfo

Maintain a list in the VPNProvider of all services created by it.
When DeviceInfo alerts it of a new tunnel interface, VPNProvider
will find a service->driver() to accept this interface. If not
found, delete the interface (cleaning up after crash). Also,
in OpenVPNDriver, create a tunnel device and hold enough state
to be able to claim it later.

BUG=chromium-os:26841,chromium-os:27156,chromium-os:27158
TEST=New unit tests. Manual: Ensure tunnel devices get cleaned up on a
real system.

Change-Id: Iaaa44dc26830a2e8bf5dfea00d165ab8c034e6e9
Reviewed-on: https://gerrit.chromium.org/gerrit/17191
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.h
cba0f7f604b28b1fe85a16b16b0731860dfff753 01-Mar-2012 Paul Stewart <pstew@chromium.org> shill: vpn: Add support for creating a tunnel interface

Use the ioctl inteface for creating a TUN device (no RTNL interface
for this appears available). Also create a means for removing
interfaces, using the RTNL interface.

BUG=chromium-os:26841
TEST=New unit test for RTNL interface, manual testing for ioctl
interface and for TUN interface detection and handling.

Change-Id: If70eeeecd5d2a2e3c348b56c297c0f3dd4226b8f
Reviewed-on: https://gerrit.chromium.org/gerrit/17127
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.h
e908949fa87c32ed97073d3e79fb7f450541cb95 23-Feb-2012 Jason Glasgow <jglasgow@chromium.org> shill: modem: unregister the cellular device when deleting a modem

Unregister the cellular device so that the chain of refences to the
device are all dropped when the modem disappears. The references are
from DeviceInfo, Manager, Modem and Service. Calling deregister
remove the device info reference, and will cause the manager to stop
the device, which will in turn clean up the service. Deleting the
modem will drop the last reference.

BUG=chromium-os:26796, chromium-os:26300
TEST=run shill, list-devices, stop cromo, list-devices, start cromo,
/opt/Qualcomm/bin/powercycle-all-gobis

Change-Id: Ia10932cc3c644bbf5accd69e02b85c75dc783b11
Reviewed-on: https://gerrit.chromium.org/gerrit/16546
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.h
3426c8fc7a3943f2d8fcb2ec78f0593088b42bed 12-Jan-2012 Thieu Le <thieule@chromium.org> shill: Move Metrics from singleton to Shill daemon

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

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

Change-Id: I556a1bd11f21f0b93ecfeaae8855dfb99ed5e5f9
Reviewed-on: https://gerrit.chromium.org/gerrit/14099
Commit-Ready: Thieu Le <thieule@chromium.org>
Reviewed-by: Thieu Le <thieule@chromium.org>
Tested-by: Thieu Le <thieule@chromium.org>
/system/connectivity/shill/device_info.h
2001a42edf1d42ec828a9baf3157496c20fefd49 15-Dec-2011 Paul Stewart <pstew@chromium.org> shill: Ignore WiFi devices in "monitor" mode

Ignore WiFi devices setup for capture. These are useful
for debugging, and shill should not try to manage them as
client interfaces or cause wpa_supplicant to try to convert
them. In the future we could use these internall in shill
for debugging, so create a new interface type for them.

BUG=chromium-os:24289
TEST=Start up with mon0, install mon0 while shill is running

Change-Id: I91e2d2c4a691d2cf9b25588a6ce6675e60b73df9
Reviewed-on: https://gerrit.chromium.org/gerrit/12991
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.h
c8f4bef3c2a277d052f96ae06e67d3e7ab44a592 13-Dec-2011 Paul Stewart <pstew@chromium.org> shill: Enable and disable reverse-path filtering

When an http proxy request is active (as well as portal check, when
that gets written), we need to initiate connections over a non-default
network interface. For this we temporarily disable reverse-path
filtering on the interface during the duration of the request.

BUG=chromium-os:24141
TEST=New unit tests for HTTPProxy and Connection

Change-Id: Ife2ad775fd8a3d2fb48f860e804eeb442dc5c58a
Reviewed-on: https://gerrit.chromium.org/gerrit/12889
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.h
9364c4c9a1e1f4bbb59c8d32ac97c928505fc8cb 07-Dec-2011 Paul Stewart <pstew@chromium.org> shill: Clean up GetDeviceTechnology

Make GetDeviceTechnology more libbasey. This has the bonus
of losing the fd leak that the previous code had.

BUG=chromium-os:23849
TEST=Rerun unit tests (for regression), run on a real system:
- Ensure lo is treated as "Unknown", usb0 (gobi) treated as cellular
and wlan0 treated as wifi. Ensure correct VLOC messages displayed in
each case.
- Ensure (via monitoring of /proc/###/fd) that fd list for shill
process remains constant over multiple plug/unplug events.

Change-Id: I3c4fea5a74efa7d3a45b6a23c55806c1486cde8a
Reviewed-on: https://gerrit.chromium.org/gerrit/12525
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.h
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.h
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.h
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.h
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.h
bf1861b28b61d2338116e4416ac8f2a45f7045ce 24-Aug-2011 Paul Stewart <pstew@chromium.org> shill: Set IPv6 privacy flags on discovered interfaces

Set the IPv6 "use_tempaddr" flag on newly discovered interfaces.
This allows the globally scoped IPv6 address to be disassociated
from the MAC address and reduce the ability for the host to
be tracked. Although this parameter can be set on the interface
using /etc/sysctl.conf, the evaluation of this file does not
happen early enough to catch the first interfaces brought up
by shill. Therefore we need to do write out these settings
at device-discovery time for shill.

BUG=chromium-os:16085
TEST=Manual -- observe IP address list, ensure netstat output on
client connected peer shows anonymized address. Reran unit tests.

Change-Id: I6091ef9853f6be572e493cd4f964404944c93a44
Reviewed-on: http://gerrit.chromium.org/gerrit/6699
Reviewed-by: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/device_info.h
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.h
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.h
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.h
0828f5f7b1e4b970967e5a499c3279b47f834c11 11-Aug-2011 Darin Petkov <petkov@chromium.org> shill: Bring the interface up when the modem is connected.

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

Change-Id: I91581fbedc959bf4dce63f09d64b920f12a14b53
Reviewed-on: http://gerrit.chromium.org/gerrit/5925
Tested-by: Darin Petkov <petkov@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/device_info.h
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.h
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.h
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.h
6f9eaa30b850ee4a22e71fd1b6ab13c873ec7110 10-Aug-2011 Darin Petkov <petkov@chromium.org> shill: Add Cellular devices to DeviceInfo.

This allows DeviceInfo to handle link messages for Cellular devices, so that we
can bring their interfaces up and down.

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

Change-Id: I7d642c7302472472c56042f731f746c8b997a149
Reviewed-on: http://gerrit.chromium.org/gerrit/5604
Tested-by: Darin Petkov <petkov@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/device_info.h
67d8ecfd1d6ff5ea75b9d5c7167d9c16891d3d4b 27-Jul-2011 Darin Petkov <petkov@chromium.org> shill: Fix a crash on creation of Cellular device.

Main fix is that DeviceInfo doesn't create/manage kCellular devices thus
avoiding D-Bus path collisions. Also, create the Cellular device in a delayed
task because the WiFi comments say that D-Bus objects can't be registered in
signal callbacks.

Fixes bad dispatcher_ member initialization and missing manager_ initialization.

Adds a DispatchPendingEvents method to the event dispatcher useful for testing.

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

Change-Id: Ib8859dfe59f7a3fd7b3978793dc8f38f22609db5
Reviewed-on: http://gerrit.chromium.org/gerrit/4771
Tested-by: Darin Petkov <petkov@chromium.org>
Reviewed-by: mukesh agrawal <quiche@chromium.org>
/system/connectivity/shill/device_info.h
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.h
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.h
c1e50412f45518e23d51ba8bb8694c366943d945 07-Jun-2011 Chris Masone <cmasone@chromium.org> [shill] Start replacing bare pointers with scoped_refptrs where appropriate

BUG=chromium-os:16259
TEST=unit tests

Change-Id: I5e1531b726bbb40917d25dc3ae44da9a6a420e00
Reviewed-on: http://gerrit.chromium.org/gerrit/2236
Tested-by: Chris Masone <cmasone@chromium.org>
Reviewed-by: Darin Petkov <petkov@chromium.org>
/system/connectivity/shill/device_info.h
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.h
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.h
9be4a9d1e87d64f850f15061123b2a4334477fa2 17-May-2011 Chris Masone <cmasone@chromium.org> [shill] the beginnings of the data model

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

BUG=chromium-os:15347
TEST=unit tests

Change-Id: Iae5280f56bf58cf1580f0b87c465f4905459f07a
Reviewed-on: http://gerrit.chromium.org/gerrit/966
Reviewed-by: Chris Masone <cmasone@chromium.org>
Tested-by: Chris Masone <cmasone@chromium.org>
/system/connectivity/shill/device_info.h
487b8bfc46a91e29bb23aaf3c59cfe67033bfc8b 14-May-2011 Chris Masone <cmasone@chromium.org> [shill] Roll forward to new libchrome

Basically just a bunch of header renames.

BUG=chromium-os:14304
TEST=emerge with FEATURES=test

Change-Id: I426d66048731ac17719ab7b1ede318f7a15f294b
Reviewed-on: http://gerrit.chromium.org/gerrit/883
Reviewed-by: Chris Masone <cmasone@chromium.org>
Tested-by: Chris Masone <cmasone@chromium.org>
/system/connectivity/shill/device_info.h
0e1d10405dd18d5d3cf5fb6be8cf907469c2bded 10-May-2011 Chris Masone <cmasone@chromium.org> [shill] Switch from home-grown EventQueue to Chrome's MessageLoop

Many other chrome os daemons have borrowed chrome's message loop abstraction,
which supports posting Task and DelayedTask objects to the loop for later
processing. There are also Callback* objects in there that we can use for
other things, as I've done with the GlibIOInputHandler. Unit tests contain
some trivial examples.

More documentation in:
base/message_loop.h
base/task.h
base/callback.h

BUG=chromium-os:15105
TEST=build, unit tests

Change-Id: Ia53dcbdf70da45e4ceda7eed1debbc4bb507446e
Reviewed-on: http://gerrit.chromium.org/gerrit/713
Tested-by: Chris Masone <cmasone@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/device_info.h
0af98bf87e8fc3cf29293f62d7f3b73cd9adb571 11-May-2011 Paul Stewart <pstew@chromium.org> shill: First step for rtnl code -- device discovery

Add device_info object and add it to the manager. Once started,
this will perform rtnl enumeration. Current tests just assert
that each enumeration completes successfully, but since our code
does not yet store any information based on what it sees, this
cannot be tested yet.

BUG=chromium-os:12933
TEST=New unit tests added

Change-Id: Ie1958222d9831c6117d0ace127857340a11b0bb1
Reviewed-on: http://gerrit.chromium.org/gerrit/655
Reviewed-by: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/device_info.h