return turn_ip(ip)-turn_ip(other.ip);
}
-bool operator==(const IP_RANGE& a, const IP_RANGE& b)
-{
- // == even if comparing ranges and nets possible
- return (a.ip==b.ip && a.end==b.end);
-}
-
bool operator<(const IP_RANGE& a, const IP_RANGE& b)
{
return ((IP_RANGE::turn_ip(a.ip) < IP_RANGE::turn_ip(b.ip)) ||
{
friend IP_RANGE operator+(const IP_RANGE &base, const int &ips);
friend bool operator==(const IP_RANGE& a, const IP_RANGE& b);
+ friend bool operator!=(const IP_RANGE& a, const IP_RANGE& b);
friend bool operator<(const IP_RANGE& a, const IP_RANGE& b);
private:
return IP_RANGE::ip_string(ip);
}
+inline bool operator==(const IP_RANGE& a, const IP_RANGE& b)
+{
+ // == even if comparing ranges and nets possible
+ return (a.ip==b.ip && a.end==b.end);
+}
+
+inline bool operator!=(const IP_RANGE& a, const IP_RANGE& b)
+{
+ // == even if comparing ranges and nets possible
+ return !(a.ip==b.ip && a.end==b.end);
+}
+
+bool operator<(const IP_RANGE& a, const IP_RANGE& b);
+
// DEPRECATED!!! use IP_RANGE instead
// mode 0: get network-base-address, other: broadcast-address
inline std::string CalculateNetworkAddresses (int mode, const std::string &ip, const std::string &netmask)