History log of /system/connectivity/shill/mock_connection.h
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/mock_connection.h
1e006c610db980bca337121134d2ba54497b7a59 16-Jun-2015 Paul Stewart <pstew@chromium.org> shill: Top-level mocks: Switch pointer/ref spacing

Switch to Chrome style spacing.

BUG=chromium:501026
TEST=Unit tests

Change-Id: I730ed5115e62319c2745dd6cef642e228b0fb66e
Reviewed-on: https://chromium-review.googlesource.com/278036
Reviewed-by: Rebecca Silberstein <silberst@chromium.org>
Commit-Queue: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/mock_connection.h
762bfb8ab200a387fe732ec92423a5f0afe11bcf 06-Feb-2015 Prabhu Kaliamoorthi <kaliamoorthi@chromium.org> shill: Add support in shill to route selected traffic to ThirdPartyVpn

This CL adds capability to shill deamon to route selected network
traffic to ThirdPartyVpn by using multiple routing tables.

It further enables a list of IP blocks in CIDR notation to be excluded
from the VPN traffic rather than a single trusted_ip. The existing
trusted_ip mechanism to do this is removed to avoid redundant approaches
to solve the same problem.

Third party VPN driver is modified to make use of the new interfaces to
exclude and include a list of IP blocks in CIDR format from the VPN
traffic.

BUG=chromium:407541
TEST=Unittests and manual testing

Change-Id: Id185d3e9bf91d018b55899adaa562d3192d261cf
Reviewed-on: https://chromium-review.googlesource.com/247030
Commit-Queue: Prabhu Kaliamoorthi <kaliamoorthi@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Tested-by: Prabhu Kaliamoorthi <kaliamoorthi@chromium.org>
/system/connectivity/shill/mock_connection.h
2cb3fa7317cfa3248cff72d0b9d64c4f2f630472 13-Nov-2014 Paul Stewart <pstew@chromium.org> shill: Device: Support same-net multi-homing

When two interfaces are connected to the same subnet, two
components of ChromeOS system behavior conspire to produce
surprising results. First, the default Linux network behavior
induces the "ARP Flux" effect where the system replies to
ARPs interchangably for both interfaces. Secondly, reverse-
path filtering (setup by default in shill) causes only one
network interface to be able to receive packets for a given
subnet at a time.

This CL adds code to recognize situations where more than
one interface is connected to the same subnet. In such
situtations reverse-path filtering is disabled and ARP
filtering is enabled. This requires the driver to keep
track of the requested reverse-path filtering state.

BUG=chromium:430041
TEST=Unit tests + manual:

(1) Attach both WiFi and Ethernet, but to _different_ IP
networks (subnet addresses should be different). Run
"sysctl -a | egrep '(rp_filter|arp_announce|arp_ignore)'".
Output should be something like:

net.ipv4.conf.all.arp_announce = 0
net.ipv4.conf.all.arp_filter = 0
net.ipv4.conf.all.arp_ignore = 0
net.ipv4.conf.all.rp_filter = 1
net.ipv4.conf.default.arp_announce = 0
net.ipv4.conf.default.arp_filter = 0
net.ipv4.conf.default.arp_ignore = 0
net.ipv4.conf.default.rp_filter = 1
net.ipv4.conf.eth0.arp_announce = 0
net.ipv4.conf.eth0.arp_filter = 0
net.ipv4.conf.eth0.arp_ignore = 0
net.ipv4.conf.eth0.rp_filter = 1
net.ipv4.conf.lo.arp_announce = 0
net.ipv4.conf.lo.arp_filter = 0
net.ipv4.conf.lo.arp_ignore = 0
net.ipv4.conf.lo.rp_filter = 1
net.ipv4.conf.wlan0.arp_announce = 0
net.ipv4.conf.wlan0.arp_filter = 0
net.ipv4.conf.wlan0.arp_ignore = 0
net.ipv4.conf.wlan0.rp_filter = 1

In other words, rp_filter is enabled on all interfaces,
and arp_filter / arp_ignore are left as default.

(2) Attach both WiFi and Ethernet to the same router. Run
"sysctl -a | egrep '(rp_filter|arp_announce|arp_ignore)'".
Output should be something like:

net.ipv4.conf.all.arp_announce = 0
net.ipv4.conf.all.arp_filter = 0
net.ipv4.conf.all.arp_ignore = 0
net.ipv4.conf.all.rp_filter = 1
net.ipv4.conf.default.arp_announce = 0
net.ipv4.conf.default.arp_filter = 0
net.ipv4.conf.default.arp_ignore = 0
net.ipv4.conf.default.rp_filter = 1
net.ipv4.conf.eth0.arp_announce = 2
net.ipv4.conf.eth0.arp_filter = 0
net.ipv4.conf.eth0.arp_ignore = 1
net.ipv4.conf.eth0.rp_filter = 2
net.ipv4.conf.lo.arp_announce = 0
net.ipv4.conf.lo.arp_filter = 0
net.ipv4.conf.lo.arp_ignore = 0
net.ipv4.conf.lo.rp_filter = 1
net.ipv4.conf.wlan0.arp_announce = 2
net.ipv4.conf.wlan0.arp_filter = 0
net.ipv4.conf.wlan0.arp_ignore = 1
net.ipv4.conf.wlan0.rp_filter = 2

In other words, rp_filter is set to "loose mode" on WiFi
and Ethernet. arp_filter and arp_ignore are also enabled
on those interfaces.

Change-Id: Id19e5b7101ba70f94aaa51b3ad6cc163a4bc0005
Reviewed-on: https://chromium-review.googlesource.com/229696
Reviewed-by: Will Drewry <wad@chromium.org>
Commit-Queue: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/mock_connection.h
cc67c52a2c00f90e877971d552208dd99825d84e 03-Sep-2014 Ben Chan <benchan@chromium.org> shill: Include base/macros.h instead of base/basictypes.h

shill no longer uses the integer types from base/basictypes.h. It should
simply include base/macros.h for the DISALLOW_COPY_AND_ASSIGN macro
instead.

BUG=None
TEST=`USE='cellular wimax' FEATURES=test emerge-$BOARD platform2`

Change-Id: I9b350c1bd9eff88e2c87de2ef8d607e90049e102
Reviewed-on: https://chromium-review.googlesource.com/216055
Reviewed-by: Paul Stewart <pstew@chromium.org>
Commit-Queue: Ben Chan <benchan@chromium.org>
Tested-by: Ben Chan <benchan@chromium.org>
/system/connectivity/shill/mock_connection.h
f3a8f9064976d12c4f8ed3c6a5cc9ea4655c686d 20-Aug-2014 Peter Qiu <zqiu@chromium.org> shill: Add IPv6 connection support.

Added support to shill for it to be able to complete portal detection
using IPv6 connection. The IPv6 support is added to AsyncConnection,
DNSClient, and HTTPRequest.

BUG=chromium:394010
TEST=unit tests, manual test with future CL that initiate IPv6 portal
detection.

Change-Id: I20b768211f3ecfcd53406805038c0490a488ee78
Reviewed-on: https://chromium-review.googlesource.com/213273
Reviewed-by: Peter Qiu <zqiu@chromium.org>
Tested-by: Peter Qiu <zqiu@chromium.org>
Commit-Queue: Peter Qiu <zqiu@chromium.org>
/system/connectivity/shill/mock_connection.h
5ea763b83299b5fad76a87183fb39a74c2d3c61d 13-Aug-2014 Ben Chan <benchan@chromium.org> shill: Add C++11 override specifier to destructors of derived classes.

BUG=None
TEST=`USE=wimax FEATURES=test emerge-$BOARD platform2`

Change-Id: I88d4e29165869b26924cccb94ac940dc8961c312
Reviewed-on: https://chromium-review.googlesource.com/212267
Reviewed-by: Alex Vakulenko <avakulenko@chromium.org>
Commit-Queue: Ben Chan <benchan@chromium.org>
Tested-by: Ben Chan <benchan@chromium.org>
/system/connectivity/shill/mock_connection.h
a89154bfedfd8872242083ffe4f084fdc774c078 24-May-2014 Peter Qiu <zqiu@chromium.org> shill: Support of DNS auto fallback

Automatically switch to fallback DNS server when broken DNS setting
is detected. This feature is disabled by default (due to property
defaulting to "false").

BUG=chromium:377056
TEST=unit tests, manual test
1. Manually update the code to allow DNS auto fallback.
2. Connect a chrome device to GoogleGuest.
3. Update the name servers setting to an invalid
DNS server "192.168.1.1"
4. Browse to "chrome://net-internals/#dns", and verify
the nameserver changed from "192.168.1.1" to Google's
DNS servers "8.8.8.8" and "8.8.4.4" within a minute.
CQ-DEPEND=CL:201412

Change-Id: I31dbaf715b5b11dd2f736e0664ee432e55bdeeb9
Reviewed-on: https://chromium-review.googlesource.com/207155
Reviewed-by: Paul Stewart <pstew@chromium.org>
Commit-Queue: Peter Qiu <zqiu@chromium.org>
Tested-by: Peter Qiu <zqiu@chromium.org>
/system/connectivity/shill/mock_connection.h
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/mock_connection.h
7f5d9c0847d08ff4cd1fc7c0c8ae4117421e75c8 04-Dec-2013 Paul Stewart <pstew@chromium.org> shill: VPNService: Report Tethering state

Services should store a copy of their tethering state in the
connection. VPNService should use this stored state to report
the underlying connection's tethering state in response to
queries of the VPNService's own Tethering property.

BUG=chromium:323010
TEST=Unit tests

Change-Id: Idf0a8a6265c9cf78af00da00d638cda37b708fcc
Reviewed-on: https://chromium-review.googlesource.com/178720
Reviewed-by: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
Commit-Queue: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/mock_connection.h
fddc09ac26ba77cabb59810f01b705fca2efd10b 04-Jul-2013 Alex Deymo <deymo@chromium.org> Export the Physical Technology of a VPN service.

Exposes the Type of the lowest service used for a VPN service
through the "PhysicalTechnology" property of a VPN service.

TEST=cros_workon_make shill --test and tested manually.
BUG=chromium:213086

Manual Test procedure.
1. Connect to a wifi network.
2. Connect to a VPN service on that wifi network.
3. Run /usr/local/lib/flimflam/test/list-services on a terminal
and verify the first service on its output contains a service with
a Type "vpn" and a PhysicalTechnology "wifi":

[ /service/6 ]
...
Type = vpn
...
PhysicalTechnology = wifi

Change-Id: Ic843429de3f4d5a4208e271bb779c3e3160f036b
Reviewed-on: https://gerrit.chromium.org/gerrit/61510
Reviewed-by: Paul Stewart <pstew@chromium.org>
Commit-Queue: Alex Deymo <deymo@chromium.org>
Reviewed-by: Alex Deymo <deymo@chromium.org>
Tested-by: Alex Deymo <deymo@chromium.org>
/system/connectivity/shill/mock_connection.h
df3c0a897bc74cb3a9800332b8359a364ca2f753 10-Nov-2012 Paul Stewart <pstew@chromium.org> shill: Service: Sort services based on dependency

If one connected service depends on another for connectivity,
it should be sorted first, overriding technology and priority
ordering. We evaluate this by using the "Lower binder" property
of the service's connection, which is currently the case for
VPNs connections to indicate what underlying link is used. It does
not make sense for a VPN service to be ranked at a lower priority
than its underlying technology, since the fact that it is connected
implies that the VPN is meant to be applied to it.

BUG=chromium-os:36231
TEST=Unit tests.

Change-Id: I74ee5d1213141db2c6a124ed44717c848a0e2701
Reviewed-on: https://gerrit.chromium.org/gerrit/37774
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Commit-Ready: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/mock_connection.h
6c72c972614285b2c01fb38afb2ffe06484a544a 27-Jul-2012 Paul Stewart <pstew@chromium.org> shill: LinkMonitor: Schedule periodic ARP requests

The LinkMonitor performs periodic unicast and broadcast ARP requests
for a connection's gateway IP address. It creates a weighted
average of response time, and can call a failure callback function
whenever the sum of consecutive unicast and broadcast response
failures exceed a threshold.

BUG=chromium-os:32600
TEST=Unit tests

Change-Id: Id5a66ad9ca80c51f227ef4811eb8c3885a70c1b8
Reviewed-on: https://gerrit.chromium.org/gerrit/28610
Commit-Ready: Paul Stewart <pstew@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/mock_connection.h
4a6748d492214afcb7c484668fa8cfd3ad963f10 17-Jul-2012 Paul Stewart <pstew@chromium.org> shill: Connection: Create a link route if we are bound

Due to the behavior of some VPN servers, we may lose our route
to the default gateway of a physical interface due to the routes
assigned by a virtual interfaces. To avert this, set a host route
for the default gateway as we bind a lower connection.

BUG=chromium-os:32643
TEST=New unit tests; tried on a known-misbehaving net (actually
working from there right now); VPN autotests

Change-Id: I68db1da339f61c415f9ba8c2c26d8cdb0276b209
Reviewed-on: https://gerrit.chromium.org/gerrit/27705
Commit-Ready: Paul Stewart <pstew@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/mock_connection.h
10241e32c136ba99e7533ca1370e2e8eca241b7c 24-Apr-2012 Paul Stewart <pstew@chromium.org> shill: Add "IPConfig" property for Services

Add an IPConfig property to services so it can be directly referenced
here instead of indirectly through the device. A side effect of this
is that one can query the IPConfig RPCIdentifier for a VPN service
even though the device is not registered. While we are at it, fix
all the PropertyStore values to be read-only since we never want to
allow these fields to be modified on the IPConfig itself. Later we
will provide a method for individual IPConfig fields to be overridden
but these will be Service properties.

BUG=chromium-os:29540
TEST=Manual: Over DBus, ensure that IPConfig property points at a
readable IPConfig instance, both for OpenVPN, Ethernet and WiFi.
Ensure that in the Chrome UI, the "Network Info" is still available
(basically checking to make sure IPConfigs are still displayable
using the old method) even thought the parameters are now set to
be "Const".

Change-Id: Ib01297ef8dc9bec828ed57361873e9eebc0354bd
Reviewed-on: https://gerrit.chromium.org/gerrit/20983
Commit-Ready: Paul Stewart <pstew@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/mock_connection.h
ce4ec19216ccd15ae349ee42498657afc2c75bd8 14-Mar-2012 Paul Stewart <pstew@chromium.org> shill: vpn: Pin route on default connection

If "trusted_ip" and "gateway" are both specified in the OpenVPN
config, pin a host route to the VPN server. As a bonus change,
add a MockService::connection() and supply a default value so
Service does not need to befriend so many tests.

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

Change-Id: I010fca6336b227c4086efb0481dcb8052245213e
Reviewed-on: https://gerrit.chromium.org/gerrit/18155
Reviewed-by: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
Commit-Ready: Darin Petkov <petkov@chromium.org>
/system/connectivity/shill/mock_connection.h
c681fa0742cabc686ccabaf0fdf6ce12dd7046b2 03-Mar-2012 Paul Stewart <pstew@chromium.org> shill: portal: Recheck portal state

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

BUG=chromium-os:27335
TEST=New unit tests, tested on real machine, including setting
PortaCheckInterval over DBus, and using Jason's addition to
test-flimflam for 'recheck-portal'.
Change-Id: Idc7def18c6f863859e94f4d4e9f266ab2670679c
Reviewed-on: https://gerrit.chromium.org/gerrit/17367
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Commit-Ready: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/mock_connection.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/mock_connection.h
c1dec4d5cad7c6ee2cd8dbc4f47e4d30403dcca1 09-Dec-2011 Paul Stewart <pstew@chromium.org> shill: Assign "Default" status to the best connection

Set the highest-ranked connection to be the "Default".
As a result, the highest priority default route will
move with the highest-ranked connection in the service
list.

Bonus changes:
* Service now formally holds a reference to the Connection
object, so call a "SetConnection" method instead of a
Create/Destroy of the HTTPProxy.
* Actually start the routing table service, and do a couple
minor fixes due to how the kernel actually accepts metric
changes.

BUG=chromium-os:7607,chromium-os:23993
TEST=New Unit Test + Manual (watch routes while inserting
USB-Ethernet on a machine connected to WiFi)

Change-Id: Iddf1ed766238d9e8adc97bb54fc12b527f86239f
Reviewed-on: https://gerrit.chromium.org/gerrit/12685
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Reviewed-by: Gaurav Shah <gauravsh@chromium.org>
Commit-Ready: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/mock_connection.h