23 #define LOG_BL LOG_STREAM(err, log_campaignd_bl)
77 const std::string& title,
78 const std::string& description,
79 const std::string& author,
80 const std::string& ip,
81 const std::string& email)
const
98 for(
const std::string& glob : glist)
102 LOG_BL <<
"Blacklisted field found: " << str <<
" (" << glob <<
")";
115 for(
const std::string&
ip_mask : mlist)
118 LOG_BL <<
"Blacklisted IP found: " << ip <<
" (" <<
ip_mask <<
")";
static lg::log_domain log_campaignd_bl("campaignd/blacklist")
bool ip_matches(const std::string &ip, const std::string &ip_mask) const
void read(const config &cfg)
Initializes the blacklist from WML.
void parse_str_to_globlist(const std::string &str, globlist &glist)
std::vector< std::string > globlist
bool is_in_globlist(const std::string &str, const globlist &glist) const
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.
A config object defines a single node in a WML file, with access to child nodes.
Standard logging facilities (interface).
std::string lowercase(const std::string &s)
Returns a lowercased version of the string.
bool wildcard_string_match(const std::string &str, const std::string &match)
Match using '*' as any number of characters (including none), '+' as one or more characters,...
std::vector< std::string > split(const config_attribute_value &val)
std::pair< unsigned int, unsigned int > ip_mask