Changeset View
Changeset View
Standalone View
Standalone View
src/netaddress.cpp
Show First 20 Lines • Show All 934 Lines • ▼ Show 20 Lines | bool operator==(const CSubNet &a, const CSubNet &b) { | ||||
return a.valid == b.valid && a.network == b.network && | return a.valid == b.valid && a.network == b.network && | ||||
!memcmp(a.netmask, b.netmask, 16); | !memcmp(a.netmask, b.netmask, 16); | ||||
} | } | ||||
bool operator<(const CSubNet &a, const CSubNet &b) { | bool operator<(const CSubNet &a, const CSubNet &b) { | ||||
return (a.network < b.network || | return (a.network < b.network || | ||||
(a.network == b.network && memcmp(a.netmask, b.netmask, 16) < 0)); | (a.network == b.network && memcmp(a.netmask, b.netmask, 16) < 0)); | ||||
} | } | ||||
bool SanityCheckASMap(const std::vector<bool> &asmap) { | |||||
// For IP address lookups, the input is 128 bits | |||||
return SanityCheckASMap(asmap, 128); | |||||
} |