22 #define LOG_BL LOG_STREAM(err, log_campaignd_bl)
101 LOG_BL <<
"Blacklisted field found: " << str <<
" (" <<
glob <<
")\n";
117 LOG_BL <<
"Blacklisted IP found: " << ip <<
" (" <<
ip_mask <<
")\n";
bool is_in_globlist(const std::string &str, const globlist &glist) const
bool wildcard_string_match(const std::string &str, const std::string &match)
Match using '*' as any number of characters (including none), and '?' as any one character.
utf8::string lowercase(const utf8::string &s)
Returns a lowercased version of the string.
std::vector< glob > globlist
std::pair< unsigned int, unsigned int > ip_mask
bool is_in_ip_masklist(const std::string &ip, const globlist &mlist) const
bool is_blacklisted(const std::string &name, const std::string &title, const std::string &description, const std::string &author, const std::string &ip, const std::string &email) const
Whether an add-on described by these fields is blacklisted.
void parse_str_to_globlist(const std::string &str, globlist &glist)
GLuint const GLchar * name
static lg::log_domain log_campaignd_bl("campaignd/blacklist")
Standard logging facilities (interface).
void read(const config &cfg)
Initializes the blacklist from WML.
std::vector< std::string > split(std::string const &val, const char c, const int flags)
Splits a (comma-)separated string into a vector of pieces.
A config object defines a single node in a WML file, with access to child nodes.
GLsizei const GLcharARB ** string
bool ip_matches(const std::string &ip, const glob &ip_mask) const