Add parsing rules for IPv4/IPv6 subnet literal constants, addresses #888

This fixes specifying IPv4 subnets in IPv4-mapped-IPv6 format with a
mask length relative to the 128 bits of the mapped IPv6 address.
This commit is contained in:
Jon Siwek 2012-10-22 15:57:21 -05:00
parent 5716545cfa
commit 46d225cc5b
10 changed files with 96 additions and 35 deletions

View file

@ -496,8 +496,15 @@ public:
* @param addr The IP address.
*
* @param length The prefix length in the range from 0 to 128
*
* @param len_is_v6_relative Whether \a length is relative to the full
* 128 bits of an IPv6 address. If false and \a addr is an IPv4
* address, then \a length is expected to range from 0 to 32. If true
* \a length is expected to range from 0 to 128 even if \a addr is IPv4,
* meaning that the mask is to apply to the IPv4-mapped-IPv6 representation.
*/
IPPrefix(const IPAddr& addr, uint8_t length);
IPPrefix(const IPAddr& addr, uint8_t length,
bool len_is_v6_relative = false);
/**
* Copy constructor.