Comparing an IP against a "block"

Discussion of ideas for features and new projects based on POCO.
Posts: 163
Joined: 18 May 2009, 17:38

Comparing an IP against a "block"

Postby aderouineau » 27 Feb 2010, 00:51

Have a new class "IPBlock" that can be defined either as a range, a vector of IP's, or combination*s* of both (and support v4 and v6):
IPBlock::addIP(IPAddress ip)
IPBlock::addNetwork(ip, (bit)mask)
IPBlock::addRange(ip_start, ip_end)
IPBlock::removeRange(ip_start, ip_end)

For a quick use, have two possible constructors: one that takes an IP and a mask; one that takes two ip's to form a range.

And one would be able to see if an IP is in that block with IPBlock::contains(ip)
or perhaps also if another block is contained: IPBlock::contains(IPBlock block)

Also, how come ipv6 masks aren't supported?

Return to “Wishlist”

Who is online

Users browsing this forum: No registered users and 1 guest