shill: vpn: Parse openvpn IP configuration options.
The options are pushed to shill over DBus through the .Task.notify service
method.
BUG=chromium-os:27056
TEST=unit tests
Change-Id: I98d7d49c275f49daba5a6dbe0af0878bf82038a6
Reviewed-on: https://gerrit.chromium.org/gerrit/17219
Tested-by: Darin Petkov <petkov@chromium.org>
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Commit-Ready: Darin Petkov <petkov@chromium.org>
diff --git a/ip_address.h b/ip_address.h
index 84b5267..f13c303 100644
--- a/ip_address.h
+++ b/ip_address.h
@@ -39,6 +39,10 @@
// Get the length in bytes of addresses of the given family
static size_t GetAddressLength(Family family);
+ // Returns the prefix length given an address |family| and a |mask|. For
+ // example, returns 24 for an IPv4 mask 255.255.255.0.
+ static int GetPrefixLengthFromMask(Family family, const std::string &mask);
+
// Getters and Setters
Family family() const { return family_; }
const ByteString &address() const { return address_; }