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>
37 files changed