static void rrl_log_state(const struct sockaddr_storage *ss, uint16_t flags, uint8_t cls) { #ifdef RRL_ENABLE_LOG char addr_str[SOCKADDR_STRLEN] = {0}; sockaddr_tostr(addr_str, sizeof(addr_str), ss); const char *what = "leaves"; if (flags & RRL_BF_ELIMIT) { what = "enters"; } log_notice("rate limiting, address '%s' class '%s' %s limiting", addr_str, rrl_clsstr(cls), what); #endif }
static void rrl_log_state(const sockaddr_t *a, uint16_t flags, uint8_t cls) { #ifdef RRL_ENABLE_LOG char saddr[SOCKADDR_STRLEN]; memset(saddr, 0, sizeof(saddr)); sockaddr_tostr(a, saddr, sizeof(saddr)); const char *what = "leaves"; if (flags & RRL_BF_ELIMIT) { what = "enters"; } log_server_notice("Address '%s' %s rate-limiting (class '%s').\n", saddr, what, rrl_clsstr(cls)); #endif }