shill: command line support for DHCPv6
Add command line option "--dhcpv6-enabled-devices" to enable DHCPv6
for specific devices. The obtained DHCPv6 configuration is for
informational purpose only, will not be used to setup connection nor
update system configuration by shill.
Note: since shill does not use DHCPv6 configuration to setup any
connection, other IP configuration (DHCPv4 or IPv6 over RDNSS)
is required in order for the device to setup a connection for a
given network service.
BUG=chromium:492764
TEST=USE="dhcpv6 asan clang" emerge-$BOARD shill
TEST=USE="asan clang" emerge-$BOARD shill
TEST=Verify with new DHCPv6 client auotest
Manual Test:
1. Build/install IPv6 enabled dhcpcd and DHCPv6 enabled shill
2. Setup a virtual ethernet pair using:
"ip link add name veth_master type veth peer name slave"
2. Setup a DHCPv6 server on veth_master interface
"/usr/sbin/dhcpd -6 -cf /tmp/dhcp6.conf veth_master"
3. Start shill with DHCPv6 enabled for "slave" interface
4. Verify DHCPv6 configuration via
"/usr/local/lib/flimflam/test/list-ipconfigs slave"
Change-Id: Ic152400f61e5bb4cb02f237b97da971ed24da27f
Reviewed-on: https://chromium-review.googlesource.com/276713
Reviewed-by: Paul Stewart <pstew@chromium.org>
Tested-by: Zeping Qiu <zqiu@chromium.org>
Commit-Queue: Zeping Qiu <zqiu@chromium.org>
diff --git a/manager.h b/manager.h
index c06c6ee..cb029b7 100644
--- a/manager.h
+++ b/manager.h
@@ -476,6 +476,11 @@
void SetAcceptHostnameFrom(const std::string &hostname_from);
virtual bool ShouldAcceptHostnameFrom(const std::string &device_name) const;
+ // Set DHCPv6 enabled device list.
+ void SetDHCPv6EnabledDevices(const std::vector<std::string> &device_list);
+ // Return true if DHCPv6 is enabled for the given device with |device_name|.
+ virtual bool IsDHCPv6EnabledForDevice(const std::string &device_name) const;
+
// Filter the list of prepended DNS servers, copying only those that match
// |family| into |dns_servers|. |dns_servers| is cleared, regardless of
// whether or not there are any addresses that match |family|.
@@ -841,6 +846,9 @@
// Whether any of the services is in connected state or not.
bool is_connected_state_;
+ // List of DHCPv6 enabled devices.
+ std::vector<std::string> dhcpv6_enabled_devices_;
+
DISALLOW_COPY_AND_ASSIGN(Manager);
};