RE-LAND: shill: use DhcpProperties for dhcpv4 config

In some deployments, DHCP properties need to be specified for DHCP
requests.  These properties will be set via the PropertyStore and stored
in the user profile (per service) and the default profile.

To implement this, the manager and service classes will each have an
instance of DhcpProperties to track the property settings stored in the
applicable profile. When a device creates a dhcp_config object to
configure the dhcpcd options, it will merge any applicable
DhcpProperties values set in the default and user profiles.

Users were previously able to set the hostname for DHCP requests using
the Manager.Hostname property.  This value is now included in the new
DhcpProperties object.  Two options are currently supported:
DhcpProperties.Hostname and DhcpProperties.VendorClass.

This change also includes new tests for the new object and the
affiliated functions.  Existing tests were also updated to cover this
new functionality.

Bug: 24162121
TEST="FEATURES=test emerge-daisy shill"
TEST=compiled for brillo

Change-Id: I045ab0dbf866ea0084a8f77b28bfff24970bb92c
diff --git a/manager.h b/manager.h
index 30d9697..77001fa 100644
--- a/manager.h
+++ b/manager.h
@@ -36,6 +36,7 @@
 
 #include "shill/cellular/modem_info.h"
 #include "shill/crypto_util_proxy.h"
+#include "shill/dhcp_properties.h"
 #include "shill/device.h"
 #include "shill/device_info.h"
 #include "shill/event_dispatcher.h"
@@ -381,7 +382,6 @@
   }
 
   bool GetArpGateway() const { return props_.arp_gateway; }
-  const std::string& GetHostName() const { return props_.host_name; }
 
   virtual int GetMinimumMTU() const { return props_.minimum_mtu; }
   virtual void SetMinimumMTU(const int mtu) { props_.minimum_mtu = mtu; }
@@ -389,6 +389,10 @@
   virtual void UpdateEnabledTechnologies();
   virtual void UpdateUninitializedTechnologies();
 
+  const DhcpProperties& dhcp_properties() const {
+    return *dhcp_properties_;
+  }
+
   // Writes the service |to_update| to persistant storage.  If the service's is
   // ephemeral, it is moved to the current profile.
   void SaveServiceToProfile(const ServiceRefPtr& to_update);
@@ -547,6 +551,11 @@
   FRIEND_TEST(CellularCapabilityUniversalMainTest,
               TerminationActionRemovedByStopModem);
   FRIEND_TEST(CellularTest, LinkEventWontDestroyService);
+  FRIEND_TEST(DefaultProfileTest, LoadManagerDefaultProperties);
+  FRIEND_TEST(DefaultProfileTest, LoadManagerProperties);
+  FRIEND_TEST(DefaultProfileTest, Save);
+  FRIEND_TEST(DeviceTest, AcquireIPConfigWithoutSelectedService);
+  FRIEND_TEST(DeviceTest, AcquireIPConfigWithSelectedService);
   FRIEND_TEST(DeviceTest, StartProhibited);
   FRIEND_TEST(ManagerTest, AvailableTechnologies);
   FRIEND_TEST(ManagerTest, ClaimDeviceWhenClaimerNotVerified);
@@ -876,6 +885,9 @@
   // List of DHCPv6 enabled devices.
   std::vector<std::string> dhcpv6_enabled_devices_;
 
+  // DhcpProperties stored for the default profile.
+  std::unique_ptr<DhcpProperties> dhcp_properties_;
+
   DISALLOW_COPY_AND_ASSIGN(Manager);
 };