shill: vpn: Associate VPN device with service and update IP configuration.

BUG=chromium-os:27384,chromium-os:27385
TEST=unit tests

Change-Id: I5b35bebeadd25f50f7044d2e4ec5bc121a56835e
Reviewed-on: https://gerrit.chromium.org/gerrit/17488
Commit-Ready: Darin Petkov <petkov@chromium.org>
Reviewed-by: Darin Petkov <petkov@chromium.org>
Tested-by: Darin Petkov <petkov@chromium.org>
diff --git a/openvpn_driver.h b/openvpn_driver.h
index 256ef62..0707341 100644
--- a/openvpn_driver.h
+++ b/openvpn_driver.h
@@ -46,7 +46,7 @@
   // process by setting up and spawning an external 'openvpn' process. IP
   // configuration settings are passed back from the external process through
   // the |Notify| RPC service method.
-  virtual void Connect(Error *error);
+  virtual void Connect(const VPNServiceRefPtr &service, Error *error);
   virtual bool ClaimInterface(const std::string &link_name,
                               int interface_index);
 
@@ -57,10 +57,12 @@
   FRIEND_TEST(OpenVPNDriverTest, ClaimInterface);
   FRIEND_TEST(OpenVPNDriverTest, Cleanup);
   FRIEND_TEST(OpenVPNDriverTest, Connect);
+  FRIEND_TEST(OpenVPNDriverTest, ConnectTunnelFailure);
   FRIEND_TEST(OpenVPNDriverTest, GetRouteOptionEntry);
   FRIEND_TEST(OpenVPNDriverTest, InitOptions);
   FRIEND_TEST(OpenVPNDriverTest, InitOptionsNoHost);
   FRIEND_TEST(OpenVPNDriverTest, Notify);
+  FRIEND_TEST(OpenVPNDriverTest, NotifyFail);
   FRIEND_TEST(OpenVPNDriverTest, OnOpenVPNDied);
   FRIEND_TEST(OpenVPNDriverTest, ParseForeignOption);
   FRIEND_TEST(OpenVPNDriverTest, ParseForeignOptions);
@@ -116,6 +118,8 @@
   DeviceInfo *device_info_;
   GLib *glib_;
   KeyValueStore args_;
+
+  VPNServiceRefPtr service_;
   scoped_ptr<RPCTask> rpc_task_;
   std::string tunnel_interface_;
   VPNRefPtr device_;