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

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

Change-Id: Ib4c4b5438a2e249777c9c1b6509f085ad5d00049
/system/connectivity/shill/routing_table.cc
c0beca55d290fe0b1c96d78cbbcf94b05c23f5a5 03-Sep-2015 Peter Qiu <zqiu@google.com> License shill to Apache2

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

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

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

Change-Id: If41ede586c2465f5831fb7fee270ff41dbfdb596
/system/connectivity/shill/routing_table.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/routing_table.cc
77e768323e57058b4660bb72ba2544a1cbe6d435 13-Feb-2015 Prabhu Kaliamoorthi <kaliamoorthi@chromium.org> shill: Setup Iptable entries for ThirdPartyVpn using PermissionBroker

This CL makes shill setup iptables entries to mark traffic from user
dynamically using a proxy to permission broker.

BUG=chromium:458075
TEST=Manual testing
CQ-DEPEND=CL:249140

Change-Id: Ic376c67b588ae0f82abeb6b7fab31051cd6d08a4
Reviewed-on: https://chromium-review.googlesource.com/250290
Reviewed-by: Paul Stewart <pstew@chromium.org>
Tested-by: Prabhu Kaliamoorthi <kaliamoorthi@chromium.org>
Commit-Queue: Prabhu Kaliamoorthi <kaliamoorthi@chromium.org>
/system/connectivity/shill/routing_table.cc
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/routing_table.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/routing_table.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/routing_table.cc
cd47732488cd101eaf0d3558dde5a7d4e4fc260b 17-Oct-2014 Ben Chan <benchan@chromium.org> shill: Replace scoped_ptr with std::unique_ptr.

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

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

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

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

Change-Id: I488925b54615e131e508a460dc1a27f88168f936
Reviewed-on: https://chromium-review.googlesource.com/216851
Reviewed-by: Alex Vakulenko <avakulenko@chromium.org>
Tested-by: Ben Chan <benchan@chromium.org>
Commit-Queue: Ben Chan <benchan@chromium.org>
/system/connectivity/shill/routing_table.cc
7fab89734d88724a288e96a9996b15548c5294c7 11-Aug-2014 Ben Chan <benchan@chromium.org> shill: Use integer types from stdint.h

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

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

Change-Id: I3d4c195881203dd2a47dbb5af150b6c90b9c206e
Reviewed-on: https://chromium-review.googlesource.com/211770
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Commit-Queue: Ben Chan <benchan@chromium.org>
Tested-by: Ben Chan <benchan@chromium.org>
/system/connectivity/shill/routing_table.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/routing_table.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/routing_table.cc
6fbf64f493a9aae7d743888039c61a57386203db 22-May-2014 Ben Chan <benchan@chromium.org> shill: Update to build against libchrome-271506.

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

Change-Id: Ib7c8b2b290caa261cbb61d30cf8a361a1e3345e1
Reviewed-on: https://chromium-review.googlesource.com/201211
Tested-by: Ben Chan <benchan@chromium.org>
Commit-Queue: Ben Chan <benchan@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/routing_table.cc
6db7b24348e69639e19cd6c408388b10d6ee54fe 03-May-2014 Paul Stewart <pstew@chromium.org> shill: Remove trivial use of iterators

Move trivial iterations through containers from using an iterator
to using range-based for loops. In instances where it makes sense
also use "auto" for iterators in non-trivial for loops as well.

BUG=None
TEST=Unit tests

Change-Id: I840d90fb62dc96d45f63144462b9a53b28c25ee9
Reviewed-on: https://chromium-review.googlesource.com/198051
Reviewed-by: Paul Stewart <pstew@chromium.org>
Commit-Queue: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/routing_table.cc
a0ddf46e466bd4ba3d20952f0a6988c680c1af14 06-Feb-2014 Ben Chan <benchan@chromium.org> shill: Update to build against libchrome-242728.

BUG=chromium:341521
CQ-DEPEND=CL:193660
TEST=Tested the following:
1. `FEATURES=test USE='cellular wimax' emerge-$BOARD platform2`
2. Run the following tests:
- network_3GSmokeTest
- network_VPNConnect.*
- network_WiMaxSmoke
- wifi_matfunc

Change-Id: Ic1553c182ab7a833a68c45f012f646b8930cb095
Reviewed-on: https://chromium-review.googlesource.com/193606
Reviewed-by: Ben Chan <benchan@chromium.org>
Tested-by: Ben Chan <benchan@chromium.org>
Commit-Queue: Ben Chan <benchan@chromium.org>
/system/connectivity/shill/routing_table.cc
0e1cdeae24dd678a5fe27c840802582c0ca45ec0 28-Feb-2013 Albert Chaulk <achaulk@chromium.org> shill: Implement Service.Remove & delete DHCP leases

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

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

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

Change-Id: Ic6eee17b9d81cd0be8d09c683d85d6a4d19278c9
Reviewed-on: https://gerrit.chromium.org/gerrit/44339
Tested-by: Albert Chaulk <achaulk@chromium.org>
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Commit-Queue: Albert Chaulk <achaulk@chromium.org>
/system/connectivity/shill/routing_table.cc
a6bfe87a2c0bcb68d789473ca10988243229667b 26-Sep-2012 Ben Chan <benchan@chromium.org> shill: Clean up "Create a IPv6 blackhole route for IPv4 L2TP/IPsec VPN".

BUG=chromium-os:34383
TEST=Build and run unit tests.

Change-Id: I3f587b2dd8fae6cec6fd9c534438af76def638cf
Reviewed-on: https://gerrit.chromium.org/gerrit/34113
Commit-Ready: Ben Chan <benchan@chromium.org>
Tested-by: Ben Chan <benchan@chromium.org>
Reviewed-by: Darin Petkov <petkov@chromium.org>
/system/connectivity/shill/routing_table.cc
a016312b7470e124774aec197e3b43bc795637c3 26-Sep-2012 Ben Chan <benchan@chromium.org> shill: vpn: Create a IPv6 blackhole route for IPv4 L2TP/IPsec VPN.

BUG=chromium-os:34383
TEST=Tested the following:
1. Build and run unit tests.
2. Manually test IPv4 LT2P/IPsec VPN on an network interface with IPv4
and IPv6 addresses as follows:
- Before connecting to the VPN, run `ip -6 route` to verify that no
blackhole route exists. Confirm via http://ipv6test.google.com that
IPv6 connectivity is available.
- After connecting to the VPN, run `ip -6 route` to verify that the
blackhole route is installed. Confirm via
http://ipv6test.google.com that IPv6 connectivity is not available.
- After disconnecting from the VPN, run `ip -6 route` to verify that
no blackhole route exists. Confirm via http://ipv6test.google.com
that IPv6 connectivity is available.

Change-Id: I7ae4fab5319b5f06a6a3f5a28f439551f2825044
Reviewed-on: https://gerrit.chromium.org/gerrit/34053
Commit-Ready: Ben Chan <benchan@chromium.org>
Reviewed-by: Ben Chan <benchan@chromium.org>
Tested-by: Ben Chan <benchan@chromium.org>
/system/connectivity/shill/routing_table.cc
b691efd71561246065eae3cdd73a96ca1b8a528d 09-Aug-2012 Christopher Wiley <wiley@chromium.org> shill: Rename SMLOG to SLOG

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

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

Change-Id: Ie5129fcbdda87f3149460209a682c698b876b09a
Reviewed-on: https://gerrit.chromium.org/gerrit/29650
Commit-Ready: Christopher Wiley <wiley@chromium.org>
Reviewed-by: Christopher Wiley <wiley@chromium.org>
Tested-by: Christopher Wiley <wiley@chromium.org>
/system/connectivity/shill/routing_table.cc
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/routing_table.cc
e78ec548060d969fecdb488d6fed711d843bba91 09-Jun-2012 Paul Stewart <pstew@chromium.org> shill: connection: Flush routes when default connection changes

Also be more verbose with address configuration.

BUG=None
TEST=Unit tests

Change-Id: I7a419f416e6ed6b583d57a06b7be42ed37933593
Reviewed-on: https://gerrit.chromium.org/gerrit/24936
Commit-Ready: Paul Stewart <pstew@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/routing_table.cc
13e6d55b9dd86148ae68588f367c48e81ad33b74 09-May-2012 Darin Petkov <petkov@chromium.org> shill: Add a facility for objects to bind to connections.

The Connection::Binder class allows objects (e.g., connections,
devices, services) to bind to connections and get notified when the
bound connection is destroyed or disconnects. Use the Binder to bind
upper to lower connections. When the lower connection is destroyed or
disconnects, the upper connection notifies any objects that are bound
to it that it's also disconnected.

BUG=chromium-os:27467,chromium-os:30774
TEST=unit tests

Change-Id: I6773182314d429b4574c695cd6ef048080ed43ae
Reviewed-on: https://gerrit.chromium.org/gerrit/22235
Commit-Ready: Darin Petkov <petkov@chromium.org>
Reviewed-by: Darin Petkov <petkov@chromium.org>
Tested-by: Darin Petkov <petkov@chromium.org>
/system/connectivity/shill/routing_table.cc
abf6d289b2d29487f0a51b6138a127707a38507a 08-May-2012 Darin Petkov <petkov@chromium.org> shill: Add a query-route callback to RoutingTable::RequestRoutToHost.

The callback will be used by VPN connections to handle underlying
connection disconnects gracefully.

BUG=chromium-os:28080
TEST=unit tests

Change-Id: I1217ae58f7626c41680a81d0f6261b883e17df85
Reviewed-on: https://gerrit.chromium.org/gerrit/22103
Tested-by: Darin Petkov <petkov@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Commit-Ready: Darin Petkov <petkov@chromium.org>
/system/connectivity/shill/routing_table.cc
bbed76d275058c8f9a42c5c71efdcc1223617bdc 28-Apr-2012 Paul Stewart <pstew@chromium.org> shill: routing_table: Don't create pinned routes without gateway

When we ask for a route, ignore those without a gateway since
local routes do not require a gateway (and end up confusing the
table).

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

Change-Id: Iea6930741c73ef0eddfbf98e5f183d2c1af5b18c
Reviewed-on: https://gerrit.chromium.org/gerrit/21433
Reviewed-by: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
Commit-Ready: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/routing_table.cc
e93b038972d43fd703b3c68603fb4d02bec6504e 24-Apr-2012 Paul Stewart <pstew@chromium.org> shill: Connection: UnPin routes on destruction

Tag pinned routes with the interface index associated with the request,
so they can be removed when the connection is destroyed. Also move
PinHostRoute() out of the VPN code and into the Connection.

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

Change-Id: I46019255276469929642db4a6395e64f53e3b7d5
Reviewed-on: https://gerrit.chromium.org/gerrit/20982
Commit-Ready: Paul Stewart <pstew@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/routing_table.cc
bbdef5fc35b48d9b43ba0dc005384abd36b72213 23-Apr-2012 Ben Chan <benchan@chromium.org> shill: Ignore missing-field-initializers warning on LAZY_INSTANCE_INITIALIZER.

When compiling with -Wextra, GCC gives a missing-field-initializers
warning (which is promoted to an error by -Werror) on the
LAZY_INSTANCE_INITIALIZER macro defined in base/lazy_instance.h.

This CL adds -Wno-missing-field-initializers to CXXFLAGS in Makefile to
ignore the warning on LAZY_INSTANCE_INITIALIZER.

BUG=chromium-os:29866
TEST=Build and run unit tests.

Change-Id: I8533f3b89780d1ec2b2c7222be3f5e26aa0e3b83
Reviewed-on: https://gerrit.chromium.org/gerrit/20888
Reviewed-by: Darin Petkov <petkov@chromium.org>
Tested-by: Ben Chan <benchan@chromium.org>
Commit-Ready: Ben Chan <benchan@chromium.org>
/system/connectivity/shill/routing_table.cc
fad4a0b7e55dd82d3815ee96862b6e546727eb6e 19-Apr-2012 Ben Chan <benchan@chromium.org> shill: Replace VLOG with SLOG.

This CL replaces all uses of VLOG(level) with SLOG(scope, level) with
the same verbose level and an appropriate scope for each affected
logging statement.

BUG=chromium-os:29641
TEST=Build and run unit tests. Test scope logging with ff_debug.

Change-Id: Ifdcf1faa2a309bcbd9ee369a66179ce9c7f1ad19
Reviewed-on: https://gerrit.chromium.org/gerrit/20629
Commit-Ready: Ben Chan <benchan@chromium.org>
Reviewed-by: Ben Chan <benchan@chromium.org>
Tested-by: Ben Chan <benchan@chromium.org>
/system/connectivity/shill/routing_table.cc
5b7ba8c2e9e5ab5e67c68d0cde963141beb501d8 18-Apr-2012 Paul Stewart <pstew@chromium.org> shill: connection: Work around broken netmasks

It has been observed in the field that some network infrastructures
send a gateway/netmask pair that is inconsistent and prevents the
client from contacting the gateway. Work around this by expanding
the netmask, assuming that this parameter is incorrect. However,
use sane defaults for maximum expansion of the netmask, so that
we do not completely break things.

BUG=chromium-os:29416
TEST=New unit tests.

Change-Id: Id4730a8c1555fb09033175bdf2bfba1abe93a125
Reviewed-on: https://gerrit.chromium.org/gerrit/20465
Commit-Ready: Paul Stewart <pstew@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/routing_table.cc
536820ddd33f63e1d95e6e04e1757bd0248bbe38 20-Mar-2012 Paul Stewart <pstew@chromium.org> shill: vpn: Last systems bits for OpenVPN test

This performs the following tasks in completing the first pass
of OpenVPN support:

- Uses any interface for requesting a route to the VPN server.
- Only offers the VPN device to VPNProvider the first time
DeviceInfo sees a message for it.
- Use RTNLHandler::SetInterfaceFlags() to bring the interface
link state up on VPN::Start().
- Allow RTNLHandler::SetInterfaceFlags() to be called from unit
tests.

BUG=chromium-os:22063
TEST=Autotest for network_VPN/network_VPN.000VPNGenesis runs
successfully

Change-Id: I1dd79a43f9de276f337ed1ebcde5893da66f55a9
Reviewed-on: https://gerrit.chromium.org/gerrit/18500
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
Commit-Ready: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/routing_table.cc
3f68bb1e3768969a1db686325ae9a84c8fd06005 15-Mar-2012 Paul Stewart <pstew@chromium.org> shill: routing table: Apply routes from IPConfig

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

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

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

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

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

Change-Id: I3ae78a3aa44ec167b79f2170d07650ece888254f
Reviewed-on: https://gerrit.chromium.org/gerrit/18030
Reviewed-by: Eric Shienbrood <ers@chromium.org>
Tested-by: Eric Shienbrood <ers@chromium.org>
Commit-Ready: Eric Shienbrood <ers@chromium.org>
/system/connectivity/shill/routing_table.cc
f748a36f2cde2b1ac7fc543cc710c81cb431cc2f 07-Mar-2012 Paul Stewart <pstew@chromium.org> shill: Connection: Add facility to add host routes

This requires a facility for tracking outstanding RTNL route requests,
and adding routes when they the response arrives. A few small fixes
to RTNL handling needed to be added.

BUG=chromium-os:27483
TEST=New Unit Tests, manual: Assocated my new Neptune proto to test
network.

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

This reverts commit ffebe0c489e0ecccf497547d7078c30cbc8072e2

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

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

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

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

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

Change-Id: I081a7aa66bee391b867a43e08db2eacdff760945
Reviewed-on: https://gerrit.chromium.org/gerrit/16156
Tested-by: Eric Shienbrood <ers@chromium.org>
Commit-Ready: Eric Shienbrood <ers@chromium.org>
Reviewed-by: Eric Shienbrood <ers@chromium.org>
/system/connectivity/shill/routing_table.cc
bf14e94cbd47d6320eec846f1ca4def026840e14 02-Mar-2012 mukesh agrawal <quiche@chromium.org> shill: logging improvements

BUG=None
TEST=unit tests

Change-Id: I0b91fc7c2b44a0866d0bb53d546a7a87bb7ccccd
Reviewed-on: https://gerrit.chromium.org/gerrit/17743
Commit-Ready: mukesh agrawal <quiche@chromium.org>
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Tested-by: mukesh agrawal <quiche@chromium.org>
/system/connectivity/shill/routing_table.cc
fb46caf4f23a41e73dfd87547121b5fb0230295a 08-Mar-2012 Thieu Le <thieule@chromium.org> shill: Delete existing routes when the device is started.

BUG=chromium-os:27358
TEST=Unit tests, network_WiFiManager, manually add foreign routes and
ensure they are deleted, also test to make sure default route remains
after DHCP renewal

Change-Id: Ic26b70d685491f31699ff4684ed289e76af8a9ca
Reviewed-on: https://gerrit.chromium.org/gerrit/17640
Commit-Ready: Thieu Le <thieule@chromium.org>
Reviewed-by: Thieu Le <thieule@chromium.org>
Tested-by: Thieu Le <thieule@chromium.org>
/system/connectivity/shill/routing_table.cc
caef8936381e9ae1fd765866e4759d42bbb19ad9 29-Feb-2012 Thieu Le <thieule@chromium.org> shill: Delete foreign route entries when adding new default route.

BUG=chromium-os:26587
TEST=Unit test, network_WiFiManager, manually add foreign route and
verify that shill deletes it

Change-Id: I9fa11c227dbdf21baab3a2c7af95b2b4f6f6511e
Reviewed-on: https://gerrit.chromium.org/gerrit/17024
Commit-Ready: Thieu Le <thieule@chromium.org>
Tested-by: Thieu Le <thieule@chromium.org>
Reviewed-by: Thieu Le <thieule@chromium.org>
/system/connectivity/shill/routing_table.cc
d4ef677ad36ef34f59529af557adbe77b2c29c80 22-Feb-2012 mukesh agrawal <quiche@chromium.org> shill: when updating the metric for a route, make sure to
update RoutingTable's internal state (in addition to updating
kernel state).

It seems the kernel doesn't echo our routing changes back to
us. So we need to explicitly update this ourselves.

BUG=chromium-os:26529
TEST=updated unit test, manual

manual testing:
- set up device with WiFi config, and plug in Ethernet
- "restart flimflam" five times, observe that every time,
metric for route on Ethernet interface is 1.

Change-Id: Ib82f8be58b81e316e893e7952345f86f5489cfca
Reviewed-on: https://gerrit.chromium.org/gerrit/16405
Commit-Ready: mukesh agrawal <quiche@chromium.org>
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Tested-by: mukesh agrawal <quiche@chromium.org>
/system/connectivity/shill/routing_table.cc
2c15d2c7ae814d95673ea48ec8f4eb582ef3652e 22-Feb-2012 mukesh agrawal <quiche@chromium.org> shill: logging improvements (routing-related)

BUG=None
TEST=unit tests

Change-Id: I948017ae3ddc88f2c67dd80776f87887bbd3883b
Reviewed-on: https://gerrit.chromium.org/gerrit/16404
Commit-Ready: mukesh agrawal <quiche@chromium.org>
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Tested-by: mukesh agrawal <quiche@chromium.org>
/system/connectivity/shill/routing_table.cc
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/routing_table.cc
7355ce1937c504d836a303ac809bd436272212b3 02-Sep-2011 Paul Stewart <pstew@chromium.org> shill: Naming and lint cleanup pass

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

BUG=None
TEST=Re-run unit tests

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

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

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

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

Change-Id: I63fd09088e71c43cb1f11a89a8ef15e11074976c
Reviewed-on: http://gerrit.chromium.org/gerrit/7180
Reviewed-by: Darin Petkov <petkov@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/routing_table.cc
9e3fcd7141240bc5efd0bf1513b9e78aa79d90eb 27-Aug-2011 Paul Stewart <pstew@chromium.org> shill: Make IPAddress copiable and with prefix

We are finally in a place where it is painful to continue to avoid
using an IPAddress in an STL datatype, since we're going to be
holding on the the list of IP addresses that a given device has.
The RoutingTable code did a bit of gymnastics to get around the
non-copyable hurdle, so clear those now.

Also, in many cases IP addresses are specified with a bit prefix
indicating what portion of the address common to the broadcast
domain for that network. Allow this to be specified. Push this
change forward into all the unit tests.

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

Change-Id: Iee2f84a5126b4a1162b5d9e0fc416207ba185be0
Reviewed-on: http://gerrit.chromium.org/gerrit/7024
Reviewed-by: Darin Petkov <petkov@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/routing_table.cc
e613202d36e3bfb06a40eea1888694413210ef7e 16-Aug-2011 Paul Stewart <pstew@chromium.org> shill: Add connection to device

Also in the process, do a few bits like setting up a run path in
the manager so it can initialize the resolver output path.

BUG=chromium-os:19095
TEST=Ran unit tests (for regression), tested that DNS and routes applied
for Ethernet on real system.

Change-Id: If505200643efa6c3152f6e61db3b91a04e739c18
Reviewed-on: http://gerrit.chromium.org/gerrit/6087
Reviewed-by: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/routing_table.cc
0d2ada3971075e78fb9900d0753c9ad94c15add4 10-Aug-2011 Paul Stewart <pstew@chromium.org> Move away from Singleton

Move from Singleton to LazyInstance for one-of classes in Shill.
This will allow them to be subclassed (mocked).

BUG=chromium-os:18986
TEST=Re-run unit tests

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

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

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

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

Change-Id: I8e1546ea8e996a0e2302fe5e5937b03c13cb1a61
Reviewed-on: http://gerrit.chromium.org/gerrit/5612
Reviewed-by: Chris Masone <cmasone@chromium.org>
Tested-by: Chris Masone <cmasone@chromium.org>
/system/connectivity/shill/routing_table.cc
75e89d2d5ecb3c42a869f485d4483fd2176381c0 01-Aug-2011 Paul Stewart <pstew@chromium.org> shill: Add routing table RTNL message handler

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

BUG=chromium-os:17277
TEST=New unittest

Change-Id: Ifcda0ab2cb8775bca677979ca98ac3fcf7adfdde
Reviewed-on: http://gerrit.chromium.org/gerrit/5163
Reviewed-by: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/routing_table.cc