Exemple #1
0
    public bool IsBlackListed(string ipaddress)
    {
      // Check whitelist first.
      if (goodips_.Contains(ipaddress))
      {
        // We're whitelisted.
        return false;
      }

      // Check blacklist next.
      if (badips_.Contains(ipaddress))
      {
        // Blacklisted IP, immediately return.
        return true;
      }

      if (rbl_servers_.Count == 0)
      {
        // We have no RBL to check, return false.
        return false;
      }
      VerifyIP IP = new VerifyIP(ipaddress, rbl_servers_.ToArray());
      if (IP.IPAddr.Valid)
      {
        if (IP.BlackList.IsListed)
        {
          Debug.Write(IP.BlackList.VerifiedOnServer);
          return true;
        }
      }
      return false;
    }
Exemple #2
0
        public bool IsBlackListed(string ipaddress)
        {
            // Check whitelist first.
            if (goodips_.Contains(ipaddress))
            {
                // We're whitelisted.
                return(false);
            }

            // Check blacklist next.
            if (badips_.Contains(ipaddress))
            {
                // Blacklisted IP, immediately return.
                return(true);
            }

            if (rbl_servers_.Count == 0)
            {
                // We have no RBL to check, return false.
                return(false);
            }
            VerifyIP IP = new VerifyIP(ipaddress, rbl_servers_.ToArray());

            if (IP.IPAddr.Valid)
            {
                if (IP.BlackList.IsListed)
                {
                    Debug.Write(IP.BlackList.VerifiedOnServer);
                    return(true);
                }
            }
            return(false);
        }