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>
diff --git a/device.h b/device.h
index 6998f39..27fee74 100644
--- a/device.h
+++ b/device.h
@@ -66,6 +66,7 @@
 
   const std::string &link_name() const { return link_name_; }
   int interface_index() const { return interface_index_; }
+  const ConnectionRefPtr &connection() const { return connection_; }
 
   const std::string &FriendlyName() const;
 
@@ -97,6 +98,12 @@
   // request was successfully sent.
   bool AcquireDHCPConfig();
 
+  // Maintain connection state (Routes, IP Addresses and DNS) in the OS.
+  void CreateConnection();
+
+  // Remove connection state
+  void DestroyConnection();
+
   void HelpRegisterDerivedStrings(const std::string &name,
                                   Strings(Device::*get)(void),
                                   bool(Device::*set)(const Strings&));
@@ -117,6 +124,7 @@
   EventDispatcher *dispatcher_;
   Manager *manager_;
   IPConfigRefPtr ipconfig_;
+  ConnectionRefPtr connection_;
 
  private:
   friend class DeviceAdaptorInterface;