shill: Make IPAddress copiable and with prefix

We are finally in a place where it is painful to continue to avoid
using an IPAddress in an STL datatype, since we're going to be
holding on the the list of IP addresses that a given device has.
The RoutingTable code did a bit of gymnastics to get around the
non-copyable hurdle, so clear those now.

Also, in many cases IP addresses are specified with a bit prefix
indicating what portion of the address common to the broadcast
domain for that network.  Allow this to be specified.  Push this
change forward into all the unit tests.

BUG=chromium-os:19744
TEST=Reran unit tests

Change-Id: Iee2f84a5126b4a1162b5d9e0fc416207ba185be0
Reviewed-on: http://gerrit.chromium.org/gerrit/7024
Reviewed-by: Darin Petkov <petkov@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
diff --git a/routing_table_entry.h b/routing_table_entry.h
index b9d6197..727df83 100644
--- a/routing_table_entry.h
+++ b/routing_table_entry.h
@@ -18,47 +18,37 @@
  public:
   RoutingTableEntry()
       : dst(IPAddress::kAddressFamilyUnknown),
-        dst_prefix(0),
         src(IPAddress::kAddressFamilyUnknown),
-        src_prefix(0),
         gateway(IPAddress::kAddressFamilyUnknown),
         metric(0),
         scope(0),
         from_rtnl(false) {}
 
   RoutingTableEntry(const IPAddress &dst_in,
-                    unsigned char dst_prefix_in,
                     const IPAddress &src_in,
-                    unsigned char src_prefix_in,
                     const IPAddress &gateway_in,
                     uint32 metric_in,
                     unsigned char scope_in,
                     bool from_rtnl_in)
-      : dst(dst_in.family(), dst_in.address()),
-        dst_prefix(dst_prefix_in),
-        src(src_in.family(), src_in.address()),
-        src_prefix(src_prefix_in),
-        gateway(gateway_in.family(), gateway_in.address()),
+      : dst(dst_in),
+        src(src_in),
+        gateway(gateway_in),
         metric(metric_in),
         scope(scope_in),
         from_rtnl(from_rtnl_in) {}
 
   RoutingTableEntry(const RoutingTableEntry &b)
-      : dst(b.dst.family(), b.dst.address()),
-        dst_prefix(b.dst_prefix),
-        src(b.src.family(), b.src.address()),
-        src_prefix(b.src_prefix),
-        gateway(b.gateway.family(), b.gateway.address()),
+      : dst(b.dst),
+        src(b.src),
+        gateway(b.gateway),
         metric(b.metric),
         scope(b.scope),
         from_rtnl(b.from_rtnl) {}
 
   RoutingTableEntry &operator=(const RoutingTableEntry &b) {
-    dst.Clone(b.dst);
-    dst_prefix = b.dst_prefix;
-    src.Clone(b.src);
-    src_prefix = b.src_prefix;
-    gateway.Clone(b.gateway);
+    dst = b.dst;
+    src = b.src;
+    gateway = b.gateway;
     metric = b.metric;
     scope = b.scope;
     from_rtnl = b.from_rtnl;
@@ -70,9 +60,7 @@
 
   bool Equals(const RoutingTableEntry &b) {
     return (dst.Equals(b.dst) &&
-            dst_prefix == b.dst_prefix &&
             src.Equals(b.src) &&
-            src_prefix == b.src_prefix &&
             gateway.Equals(b.gateway) &&
             metric == b.metric &&
             scope == b.scope &&
@@ -80,9 +68,7 @@
   }
 
   IPAddress dst;
-  unsigned char dst_prefix;
   IPAddress src;
-  unsigned char src_prefix;
   IPAddress gateway;
   uint32 metric;
   unsigned char scope;