shill: Add ArpGateway and network-based leases

Add two arguments to the DHCP client:
  - Turn on ArpGateway (ARP for default gateway in order to test validity
    of lease) by default, and use the same manager flag as flimflam did.

  - Use per-network lease files for Ethernet and WiFi.  This means that
    multiple leases can be held in parallel for different Ethernet devices
    and WiFi SSIDs.

Bonus changes: Fix DHCP lease filename template which was broken in flimflam
and ported with full fidelity to shill.  Make removal of old lease files
conditional on whether the lease file was non-default.

BUG=chromium-os:25717,chromium-os:16885
TEST=New unit tests + manual: Ensure dhcpcd runs with correct arguments ("-R"
added when ArpGateway is enabled on the manager, no "-R" otherwise), and that
the "set_arpgw" command in crosh works correctly.  Monitor dhcpcd command line
for new lease suffix parameter, and ensure that leases are being written out
to those files, and that the files are not being removed on program exit.
CQ-DEPEND=Iac282c1686695239a790bbcc0d110c6a69bf45e0

Change-Id: I68bb3cbd18c95f01003eaf049fa60aad446f8116
Reviewed-on: https://gerrit.chromium.org/gerrit/22065
Commit-Ready: Paul Stewart <pstew@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
diff --git a/dhcp_provider_unittest.cc b/dhcp_provider_unittest.cc
index d028935..042cea5 100644
--- a/dhcp_provider_unittest.cc
+++ b/dhcp_provider_unittest.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium OS Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
@@ -15,6 +15,8 @@
 namespace {
 const char kDeviceName[] = "testdevicename";
 const char kHostName[] = "testhostname";
+const char kStorageIdentifier[] = "teststorageidentifier";
+const bool kArpGateway = false;
 }  // namespace {}
 
 class DHCPProviderTest : public Test {
@@ -31,7 +33,10 @@
 };
 
 TEST_F(DHCPProviderTest, CreateConfig) {
-  DHCPConfigRefPtr config = provider_->CreateConfig(kDeviceName, kHostName);
+  DHCPConfigRefPtr config = provider_->CreateConfig(kDeviceName,
+                                                    kHostName,
+                                                    kStorageIdentifier,
+                                                    kArpGateway);
   EXPECT_TRUE(config.get());
   EXPECT_EQ(&glib_, config->glib_);
   EXPECT_EQ(kDeviceName, config->device_name());