X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/4f1aca7dfb6adf867713ad48e14ad79080e13cfa..e9cb0683c0b33d8458c1d9b2558bbeb5d101e680:/include/stg/user_ips.h?ds=sidebyside diff --git a/include/stg/user_ips.h b/include/stg/user_ips.h index 264b5896..e55f99fa 100644 --- a/include/stg/user_ips.h +++ b/include/stg/user_ips.h @@ -70,6 +70,7 @@ public: std::string GetIpStr() const; bool IsIPInIPS(uint32_t ip) const; bool OnlyOneIP() const; + bool IsAnyIP() const; size_t Count() const; void Add(const IP_MASK &im); void Erase(); @@ -172,6 +173,12 @@ return false; } //----------------------------------------------------------------------------- inline +bool USER_IPS::IsAnyIP() const +{ + return !ips.empty() && ips.front().ip == 0; +} +//----------------------------------------------------------------------------- +inline void USER_IPS::Add(const IP_MASK &im) { ips.push_back(im);