Browse Source

* backend.[ch]: f2b_backend_{un,}ban()

master
Alex 'AdUser' Z 9 years ago
parent
commit
20d5b34d76
  1. 14
      src/backend.c
  2. 5
      src/backend.h

14
src/backend.c

@ -86,3 +86,17 @@ f2b_backend_destroy(f2b_backend_t *backend) {
dlclose(backend->h);
free(backend);
}
bool
f2b_backend_ban(f2b_backend_t *backend, const char *ip) {
assert(backend != NULL);
return backend->ban(backend->cfg, ip);
}
bool
f2b_backend_unban(f2b_backend_t *backend, const char *ip) {
assert(backend != NULL);
return backend->unban(backend->cfg, ip);
}

5
src/backend.h

@ -20,6 +20,9 @@ typedef struct f2b_backend_t {
} f2b_backend_t;
f2b_backend_t * f2b_backend_create (f2b_config_section_t *config, const char *id);
void f2b_backend_destroy(f2b_backend_t *backend);
void f2b_backend_destroy(f2b_backend_t *b);
bool f2b_backend_ban (f2b_backend_t *b, const char *ip);
bool f2b_backend_unban (f2b_backend_t *b, const char *ip);
#endif /* BACKEND_H_ */

Loading…
Cancel
Save