shill: DeviceInfo: Optionally ignore unknown Ethernet

Before CL:224422, any unknown network devices (ones that did not
report a driver symlink) were treated as "Unknown" and were not
managed by shill.  However some broken Ethernet drivers do not
report this.  This change allows a command-line option to revert
this workaround so virtual network interfaces and other such
non-reported devices can be ignored by the manager again.
Additionally, explicitly ignore all devices that appear with a
"veth" prefix.

BUG=chromium:457043,chromium:456104,chromium:451714
TEST=Unit tests

Change-Id: I513c7014c2159d7fea608eed85c0e33b02a893ba
Reviewed-on: https://chromium-review.googlesource.com/247904
Reviewed-by: Zeping Qiu <zqiu@chromium.org>
Commit-Queue: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
diff --git a/manager.h b/manager.h
index 3334e14..d366a0a 100644
--- a/manager.h
+++ b/manager.h
@@ -428,6 +428,11 @@
   // default claimer (with "" as claimer_name).
   void SetPassiveMode();
 
+  // Decides whether Ethernet-like devices are treated as unknown devices
+  // if they do not indicate a driver name.
+  void SetIgnoreUnknownEthernet(bool ignore);
+  bool ignore_unknown_ethernet() const { return ignore_unknown_ethernet_; }
+
  private:
   friend class CellularTest;
   friend class DeviceInfoTest;
@@ -724,6 +729,9 @@
   // Whether Wake on LAN should be enabled for all Ethernet devices.
   bool is_wake_on_lan_enabled_;
 
+  // Whether to ignore Ethernet-like devices that don't have an assigned driver.
+  bool ignore_unknown_ethernet_;
+
   // Maps tags to callbacks for monitoring default service changes.
   std::map<int, ServiceCallback> default_service_callbacks_;
   int default_service_callback_tag_;