]> git.stg.codes - stg.git/blobdiff - include/stg/user_ips.h
stg-2.409 pre-merge.
[stg.git] / include / stg / user_ips.h
index 264b58960ac2df91e5fa59d991b5583219a8a98a..52e5df77d7dba6e9e702ab634caef19cd3f49325 100644 (file)
@@ -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();
@@ -165,13 +166,19 @@ return false;
 inline
 bool USER_IPS::OnlyOneIP() const
 {
-if (ips.size() == 1 && ips.front().mask == 32)
+if (ips.size() == 1 && ips.front().mask == 32 && ips.front().ip != 0)
     return true;
 
 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);