109   long                tref = (time(NULL) / 3600);
   111   if ((ip == NULL) || (strlen(ip) == 0))
   119   snprintf(key, 
sizeof (key), 
"DNS:Connect:%s", ip);
   120   if (
zeDb_GetRec(&hdb, key, &value, 
sizeof (value))) {
   123     for (i = 0; i < 
DREF; i++) {
   124       if (value.
data[i].
tref + DREF >= tref) {
   152   long                tref = (time(NULL) / 3600);
   153   int                 iref = tref % 
DREF;
   155   if ((ip == NULL) || (strlen(ip) == 0))
   163   if (
zeDb_GetRec(&hdb, key, &value, 
sizeof (value))) {
   165       memset(&value.
data[iref], 0, sizeof (value.
data[iref]));
   167     memset(&value, 0, 
sizeof (value));
   175   res = 
zeDb_AddRec(&hdb, key, &value, 
sizeof (value));
   204   snprintf(k, 
sizeof (k), 
"%s:%s", why, key);
   210     memset(fields, 0, 
sizeof (fields));
   211     if ((r != NULL) && (strlen(v) > 0)) {
   214       for (s = strtok_r(v, 
":", &ptr); s != NULL; s = strtok_r(NULL, 
":", &ptr)) {
   274 static blpool_T     blpool = { 
FALSE, PTHREAD_MUTEX_INITIALIZER };
   276 #define DATA_LOCK() \   277   if (pthread_mutex_lock(&blpool.mutex) != 0) { \   278     ZE_LogSysError("pthread_mutex_lock"); \   281 #define DATA_UNLOCK() \   282   if (pthread_mutex_unlock(&blpool.mutex) != 0) { \   283     ZE_LogSysError("pthread_mutex_unlock"); \   296   if ((
bl == NULL) || (strlen(
bl) == 0)) {
   301   for (i = 0; (i < 
SZPOOL) && (blpool.
bl[i] != NULL); i++) {
   302     if (strcasecmp(
bl, blpool.
bl[i]) == 0)
   325   if ((
bl == NULL) || (strlen(
bl) == 0)) {
   332   i = db_map_get_index(
bl);
   336                       "Blacklist pool is xxxx - consider increasing it's size");
   343                       "Blacklist pool is full - consider increasing it's size");
   348   if ((blpool.
bl[i] != NULL) || 
zeDb_OK(&blpool.
hdb[i])) {
   354   if ((blpool.
bl[i] = strdup(
bl)) == NULL) {
   367   ZE_MessageInfo(9, 
"Database %s created/openned using handler no %d !", 
bl, i);
   385   if ((
bl == NULL) || (strlen(
bl) == 0)) {
   392   i = db_map_get_index(
bl);
   394   if ((i < 0) || (i >= 
SZPOOL)) {
   400   if ((blpool.
bl[i] == NULL) || !
zeDb_OK(&blpool.
hdb[i])) {
   431   for (i = 0; i < 
SZPOOL; i++) {
   464   int                 imin = 0, imax = 
SZPOOL - 1;
   470   if ((
bl == NULL) || (strlen(
bl) == 0)) {
   477   if ((
bl != NULL) && (strlen(
bl) > 0)) {
   478     i = db_map_get_index(
bl);
   482                         "Blacklist pool is xxxx - consider increasing it's size");
   489                         "Blacklist pool is full - consider increasing it's size");
   496   for (i = imin; i <= imax; i++) {
   499     snprintf(k, 
sizeof (k), 
"%s:%s", why, key);
   535   if ((
bl == NULL) || (strlen(
bl) == 0)) {
   542   i = db_map_get_index(
bl);
   544   if ((i < 0) || (i >= 
SZPOOL)) {
   552   snprintf(k, 
sizeof (k), 
"%s:%s", why, key);
 
bool db_map_close(char *bl)
bool zeDb_Unlock(ZEDB_T *h)
Database unlock. 
bool zeDb_AddRec(ZEDB_T *h, char *, void *, size_t)
bool db_check_blacklist(char *ip)
bool db_map_open(char *bl)
bool zeDb_Open(ZEDB_T *h, ZEDB_ENV_T *, char *, int, bool, bool, size_t)
bool zeDb_Close(ZEDB_T *h)
#define ZE_MessageInfo(level,...)
bool zeDb_GetRec(ZEDB_T *h, char *, void *, size_t)
#define ZE_MessageWarning(level,...)
#define ZE_LogSysError(...)
char * cf_get_str(int id)
bool db_blackliste_check(char *why, char *key, db_map_T *r)
bool db_close_blacklist()
bool db_map_check(char *bl, char *why, char *key, char *buf, size_t sz)
bool db_update_blacklist(char *ip, int what)
bool db_map_add(char *bl, char *why, char *key, char *buf)
bool zeDb_Lock(ZEDB_T *h)
Database lock.