shill: Service: Provide "Tethering" property

Present a service property that indicates whether the service's
connectivity is likely to be provided via a cellular backhaul.

BUG=chromium:323010
TEST=Unit tests; autotest at https://chromium-review.googlesource.com/178577
Manual: list-services with both an iPhone and Nexus in tethering mode.  Note
that both are listed with "Tethering: Suspected".  After connecting to the
Android phone, the "list-services" shows "Tethering: Confirmed".
CQ-DEPEND=CL:178563

Change-Id: Iefde3a71008a0a3d7e452d740cfa3bbb610b502b
Reviewed-on: https://chromium-review.googlesource.com/178575
Reviewed-by: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
Commit-Queue: Paul Stewart <pstew@chromium.org>
diff --git a/device.h b/device.h
index 0c1995a..0e24385 100644
--- a/device.h
+++ b/device.h
@@ -162,6 +162,10 @@
   // no connected service, or if it does not match |service|.
   virtual bool IsConnectedToService(const ServiceRefPtr &service) const;
 
+  // Returns true if the DHCP parameters provided indicate that we are tethered
+  // to a mobile device.
+  virtual bool IsConnectedViaTether() const;
+
   // Restart the portal detection process on a connected device.  This is
   // useful if the properties on the connected service have changed in a
   // way that may affect the decision to run portal detection at all.
@@ -270,6 +274,7 @@
   FRIEND_TEST(DeviceTest, DestroyIPConfigNULL);
   FRIEND_TEST(DeviceTest, EnableIPv6);
   FRIEND_TEST(DeviceTest, GetProperties);
+  FRIEND_TEST(DeviceTest, IsConnectedViaTether);
   FRIEND_TEST(DeviceTest, Load);
   FRIEND_TEST(DeviceTest, Save);
   FRIEND_TEST(DeviceTest, SelectedService);