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>
diff --git a/modem_info.h b/modem_info.h
index 1d98dea..18faeb3 100644
--- a/modem_info.h
+++ b/modem_info.h
@@ -29,12 +29,12 @@
             Metrics *metrics,
             Manager *manager,
             GLib *glib);
-  ~ModemInfo();
+  virtual ~ModemInfo();
 
-  void Start();
-  void Stop();
+  virtual void Start();
+  virtual void Stop();
 
-  void OnDeviceInfoAvailable(const std::string &link_name);
+  virtual void OnDeviceInfoAvailable(const std::string &link_name);
 
  private:
   friend class ModemInfoTest;