shill: add a whitelist invocation option

To compliment the blacklisting approach, add a whitelist option.  If
specified, shill will manage only device specified by the whitelist.
Allow only one of blacklist, whitelist or passive mode to be specified.

Bug: 26424002
TEST=Manual testing, new unit tests.

Change-Id: I9149543b56f6bcb464a1ba09da56abcdd9a34b2e
diff --git a/manager.h b/manager.h
index be7d5f3..c76dd9e 100644
--- a/manager.h
+++ b/manager.h
@@ -126,6 +126,12 @@
 
   virtual void SetBlacklistedDevices(
       const std::vector<std::string>& blacklisted_devices);
+  virtual void SetWhitelistedDevices(
+      const std::vector<std::string>& whitelisted_devices);
+
+  // Returns true if |device_name| is either not in the blacklist, or in the
+  // whitelist, depending on which list was supplied in startup settings.
+  virtual bool DeviceManagementAllowed(const std::string& device_name);
 
   virtual void Start();
   virtual void Stop();
@@ -905,6 +911,9 @@
   // List of blacklisted devices specified from command line.
   std::vector<std::string> blacklisted_devices_;
 
+  // List of whitelisted devices specified from command line.
+  std::vector<std::string> whitelisted_devices_;
+
   // List of DHCPv6 enabled devices.
   std::vector<std::string> dhcpv6_enabled_devices_;