History log of /system/connectivity/shill/virtual_device.cc
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
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/virtual_device.cc
1a212a6b98b22ad1d69652bb26a9e94138635476 16-Jun-2015 Paul Stewart <pstew@chromium.org> shill: Top-level files n-v: Switch pointer/ref spacing

Switch to Chrome style spacing.

BUG=chromium:501026
TEST=Unit tests

Change-Id: I8bd6f66ea185ca3a2687986f6f2fd99be957dffe
Reviewed-on: https://chromium-review.googlesource.com/278070
Reviewed-by: Rebecca Silberstein <silberst@chromium.org>
Commit-Queue: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/virtual_device.cc
3c3c36a37a885d0a2e180998587af8390744f757 17-Dec-2014 Samuel Tan <samueltan@chromium.org> shill: do not report suspend readiness on gateway ARP

Pass a boolean from DHCPConfig::ProcessEventSignal to
IPConfig::UpdateProperties and Device::OnIPConfigUpdated that
indicates if a gateway ARP was received, and use this boolean
to determine whether or not to report suspend readiness when
WiFi::OnIPConfigUpdated is called in dark resume. This allows
us to accept both a Gateway ARP and BOUND event during dark
resume, and only report suspend readiness when the latter event
is received.

BUG=chromium:442610
TEST=Compile shill and run unit tests using:

P2_TEST_FILTER="shill::*" FEATURES="test" USE="clang asan" \
emerge-samus shill

Manual testing as follows:

1) Boot into a samus test image.
2) Run 'ff_debug +wifi; ff_debug --level -3'
3) Run 'echo 0 > /var/lib/power_manager/disable_dark_resume; restart \
powerd'
4) Enable all wake on WiFi features with the following command:
dbus-send --system --print-reply --dest=org.chromium.flimflam \
/device/wlan0 org.chromium.flimflam.Device.SetProperty \
string:WakeOnWiFiFeaturesEnabled \
variant:string:"packet_and_ssid"
5) Set the wake-to-scan frequency to 30 seconds with the
following command:
dbus-send --system --print-reply --dest=org.chromium.flimflam \
/device/wlan0 org.chromium.flimflam.Device.SetProperty \
string:WakeToScanFrequency variant:uint32:30
6) Connect samus to an AP.
7) Disable the AP. Verify that the samus is fully disconnected by the WiFi
icon state (a cross over empty WiFi bars).
8) Run 'powerd_dbus_suspend' to suspend the system.
9) Wait ~10 seconds for the system to fully suspend, then immediately re-enable
the AP.
10) Wait for another ~20 seconds for the system to enter dark resume (light bar
will turn on in dark resume).
11) After the dark resume concludes (~10 more seconds; light bar should turn
off), wait another 30 seconds and verify that the system does not enter
dark resume again (i.e. light bar does not light up again). This signifies
that the system has established a connection in the last dark resume. If
the system enters dark resume, repeat this step until the system no longer
enters dark resume again.
12) Wake the samus by pressing any way, and verify that the WiFi icon is in the
fully connected state.
13) Open /var/log/net.log
14) Search for the log messages containing "Gateway ARP received" and
"IPv4 DHCP lease obtained". Verify that the former is logged before the
latter, and that the two events are logged within the same second.
15) Verify that the log message containing the substring "OnDHCPLeaseObtained"
appears immediately after the "IPv4 DHCP lease obtained message".

Change-Id: I8185c8683ed1a5e65779d67cca100faafbad6654
Reviewed-on: https://chromium-review.googlesource.com/236099
Tested-by: Samuel Tan <samueltan@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Commit-Queue: Samuel Tan <samueltan@chromium.org>
/system/connectivity/shill/virtual_device.cc
c9c31d8497c3f053c2160408cc386010fc125fad 22-Oct-2014 Rebecca Silberstein <silberst@chromium.org> shill: add object id to scoped log messages

Add object identifier (DBus::Path) string to scoped logging messages. If
the logging message is called from a static method, SLOG will be called
with nullptr and the log will use (anon) for the object id. Objects
without identifying information will use the (class_name) as their logged
identifier.

BUG=chromium:403996
TEST=ran unit tests and manually inspected net.log

Change-Id: Idf23911a303f5edc4b82917bf1e2cea3f8e44e60
Reviewed-on: https://chromium-review.googlesource.com/224812
Tested-by: Rebecca Silberstein <silberst@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Commit-Queue: Rebecca Silberstein <silberst@chromium.org>
/system/connectivity/shill/virtual_device.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/virtual_device.cc
a41ab517725d036b63420f8445550246f8f50b99 23-Jul-2014 Alex Vakulenko <avakulenko@chromium.org> shill: Sort headers alphabetically (build/include_alpha)

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

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

Change-Id: I113ed7f9dd3f465a3f660599320cdb434e7cc214
Reviewed-on: https://chromium-review.googlesource.com/209636
Tested-by: Alex Vakulenko <avakulenko@chromium.org>
Reviewed-by: Ben Chan <benchan@chromium.org>
Commit-Queue: Alex Vakulenko <avakulenko@chromium.org>
/system/connectivity/shill/virtual_device.cc
8a5322984f2d81bcbfd8d44c59747a11bd9b904b 17-Jun-2014 Alex Vakulenko <avakulenko@chromium.org> shill: Fix most of warnings from cpplint

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

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

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

Change-Id: Ic2e31896aa13d20eeb1a85dee74f3db8cccfde2e
Reviewed-on: https://chromium-review.googlesource.com/204164
Tested-by: Alex Vakulenko <avakulenko@chromium.org>
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Commit-Queue: Alex Vakulenko <avakulenko@chromium.org>
/system/connectivity/shill/virtual_device.cc
c5099532b82fe201fe2510c43b529944a0930d2e 12-Dec-2013 Paul Stewart <pstew@chromium.org> shill: IPConfig: Don't reset StaticIP on failure

If the IP address associated with an IPConfig is provided by
StaticIP, the entire configuration should be retained even if
the automatic configuration method fails. Otherwise,
configuration parameters provided outside of the automatic
configuration mechanism will be lost.

To accomplish this cleanly, we need to change the contract
between IPConfig and Device objects. The failure and success
events are now split into separate callbacks. Intead of
passing a bool parameter to OnIPConfigUpdated, failure cases
are handled by a separate method. Further, there is no
expectation in the failure case that the IPConfig resets
itself, so the IPConfig provides a public method for the
Device to call if it chooses.

BUG=chromium:318290
TEST=Unittest, new autotest network_DhcpFailureWithStaticIP (CL:179783)
All other network_Dhcp* unit tests run.

Change-Id: I55ed5a7adfc5d97e45ce832e25caab97ff39cea6
Reviewed-on: https://chromium-review.googlesource.com/179786
Reviewed-by: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
Commit-Queue: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/virtual_device.cc
4a165582f3a9d425ba1c5fde717b0b76f03dbf3f 03-Aug-2013 mukesh agrawal <quiche@chromium.org> shill: add yet more unit tests for ppp dongle support

This time, the lucky winner is VirtualDevice.

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

Change-Id: I1c87afa29ba9ebed1a95c2e5132fbe90161aaced
Reviewed-on: https://gerrit.chromium.org/gerrit/64401
Commit-Queue: mukesh agrawal <quiche@chromium.org>
Tested-by: mukesh agrawal <quiche@chromium.org>
Reviewed-by: mukesh agrawal <quiche@chromium.org>
/system/connectivity/shill/virtual_device.cc
0381f9a7b4c0d27387bae44ea2f3b048fad1830c 12-Jul-2013 mukesh agrawal <quiche@chromium.org> shill: cellular: improve handling of CellularService state

As noted in crbug.com/246456#c1, when using a PPP dongle,
we don't let the Cellular object SelectService on the CellularService.

That avoids potential conflicts where both Cellular and PPPDevice
are trying to manage the IP configuration of the Service. However,
there are some state change events that need to be propagated to
the Service. In particular, when the modem disconnects, we need to
move the Service to the idle state.

Fix this by overriding the various service-state-setting methods
with versions that punt over to PPPDevice, when appropriate.

While there:
- mark Cellular::OnNoNetworkRouting as override-ing
- move cleanup of MockCellularService to CellularTest:TearDown
(instead of being the responsibility of individual tests)

BUG=chromium:252067
TEST=new unit tests, manual (see below)

Manual testing
--------------
1. plug in ppp dongle
2. wait for dongle to connect
3. chrome://settings -> Mobile data -> <provider> -> Disconnect
4. wait for disconnect to complete
5. "Mobile data" should show "Not connected"
6. chrome://network should show the Cellular service in "idle" state.
7. ifconfig should not show any ppp device (e.g. ppp0, ppp1)
8. Mobile data -> <provider> -> Connect
9. connect should succeed

Change-Id: I512c98ef8cc187fa039e58ad66da604ff1739063
Reviewed-on: https://gerrit.chromium.org/gerrit/61625
Reviewed-by: Ben Chan <benchan@chromium.org>
Commit-Queue: mukesh agrawal <quiche@chromium.org>
Tested-by: mukesh agrawal <quiche@chromium.org>
/system/connectivity/shill/virtual_device.cc
6813e7624f1047872eeceec14db45373e30e268e 11-Jul-2013 mukesh agrawal <quiche@chromium.org> shill: improve logging, and comment out unused args

1) Add some more context for a few logging calls.
2) Comment out some unused args, to make it obvious that they're
unused.

BUG=None
TEST=unit tests

Change-Id: I0a71a8d2311a17859f96793a88f950c3636cd91e
Reviewed-on: https://gerrit.chromium.org/gerrit/61601
Commit-Queue: mukesh agrawal <quiche@chromium.org>
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Tested-by: mukesh agrawal <quiche@chromium.org>
/system/connectivity/shill/virtual_device.cc
9da07771df3dbbc99ff99114c26317d01f29f7fc 15-May-2013 mukesh agrawal <quiche@chromium.org> shill: support 3G dongles with PPP interface

Assuming the 3G dongle has been switched to modem mode (with
usb_modeswitch or similar), and an activated SIM is present,
shill will automatically connect to the cellular network.

The primary change, as far as the Cellular/Modem logic goes,
is that we take the absence of a link name to mean that the
modem is a PPP dongle. Instead of bailing out, we create the
Cellular object, and register it with the manager as any other
Cellular device.

When the Cellular connection is complete, CellularCapabilityUniversal
checks the Bearer's IPConfig method, as indicated by modemmanager1.
If the method is specified as PPP, the capability asks the Cellular
device to start PPP.

When PPP setup completes, Cellular passes the IP configuration
information to the PPPDevice. At that point, the PPPDevice is
assigned an IP address, and routing is updated appropriately.

Notable changes:
- Moved VPN to VirtualDevice, changed OpenVPNDriver to use it,
created a new subclass PPPDevice.
- Moved PPP code out of L2TPIPSecDriver, and into PPPDevice.
- Changed L2TPIPSecDriver to use PPPDevice.

While there:
- Got rid of VPNDriver::OnDisconnected, and changed callers to
use DropConnection instead.
- Made Load and Save of VirtualDevices no-ops. This eliminates
the confusingly named "device_" stanzas in the default profile.
We lose VPN byte counts by doing this, but they weren't sensible
anyway (they'd be shared across potentially different VPNs).

New units will follow in another CL (TBW).

BUG=chromium:240051
TEST=unit tests, manual

Manual testing
--------------
1. Get 3G PPP dongle.
2. Install activated SIM.
3. Plug dongle into USB port.
4. Wait for the dongle to switch to modem mode.
(I used a manually installed usb_modeswitch, but this will
soon be handled by mist.)
5. Wait for the dongle to connect. With the Huawei E303, this
takes about 35 seconds.

Change-Id: I916bef451ee6e8dcf1af8135ecf6787251acf19b
Reviewed-on: https://gerrit.chromium.org/gerrit/51356
Commit-Queue: mukesh agrawal <quiche@chromium.org>
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Tested-by: mukesh agrawal <quiche@chromium.org>
/system/connectivity/shill/virtual_device.cc