shill: Add IPAddress class
Add class that holds IP Addresses. Routing will need these.
Move address family constants out of IPConfig to this new class.
BUG=chromium-os:17277
TEST=New unittest
Change-Id: I69d9c4d551061de890ed6919462597a15ae51857
Reviewed-on: http://gerrit.chromium.org/gerrit/4180
Reviewed-by: Darin Petkov <petkov@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
diff --git a/ipconfig.h b/ipconfig.h
index 4cb040e..200cf8c 100644
--- a/ipconfig.h
+++ b/ipconfig.h
@@ -13,6 +13,7 @@
#include <base/memory/scoped_ptr.h>
#include <gtest/gtest_prod.h> // for FRIEND_TEST
+#include "shill/ip_address.h"
#include "shill/property_store.h"
#include "shill/refptr_types.h"
@@ -25,18 +26,13 @@
// class.
class IPConfig : public base::RefCounted<IPConfig> {
public:
- enum AddressFamily {
- kAddressFamilyUnknown,
- kAddressFamilyIPv4,
- kAddressFamilyIPv6
- };
struct Properties {
- Properties() : address_family(kAddressFamilyUnknown),
+ Properties() : address_family(IPAddress::kAddressFamilyUnknown),
subnet_cidr(0),
mtu(0) {}
- AddressFamily address_family;
+ IPAddress::Family address_family;
std::string address;
int32 subnet_cidr;
std::string broadcast_address;