@ -9,6 +9,9 @@
#include "config.h"
#include "appconfig.h"
#include <pwd.h>
#include <grp.h>
f2b_appconfig_t appconfig = {
.coredumps = false,
.daemon = false,
@ -7,9 +7,6 @@
#ifndef F2B_APPCONFIG_H_
#define F2B_APPCONFIG_H_
typedef struct f2b_appconfig_t {
bool daemon;
bool coredumps;
@ -5,8 +5,12 @@
* published by the Free Software Foundation.
*/
#include "common.h"
#include "log.h"
#include "backend.h"
#include <dlfcn.h>
#define BACKEND_LIBRARY_PARAM "load"
f2b_backend_t *
#ifndef F2B_BACKEND_H_
#define F2B_BACKEND_H_
/**
* @file
* This header describes backend module definition and related routines
@ -9,10 +9,8 @@
#include <assert.h>
#include <ctype.h>
#include <errno.h>
#include <fcntl.h>
#include <limits.h>
#include <limits.h> /* PATH_MAX */
#include <stdarg.h>
#include <stdbool.h>
#include <stdint.h>
@ -5,20 +5,24 @@
#include <getopt.h>
#include <signal.h>
#include <sys/resource.h>
#include "ipaddr.h"
#include "jail.h"
#include "matches.h"
#include "source.h"
#include "filter.h"
#include "statefile.h"
#include "buf.h"
#include "commands.h"
#include "csocket.h"
* @def SA_REGISTER
* Register signal handler
@ -6,10 +6,15 @@
#include <sys/socket.h>
#include <arpa/inet.h> /* struct in_addr */
#include <sys/un.h>
void usage() {
fprintf(stderr, "Usage: filter-test <filter.conf> <regexps.txt> [<file.log>]\n");
exit(EXIT_FAILURE);
#define REGEX_LINE_MAX 256
#define HOST_TOKEN "<HOST>"
#define FILTER_LIBRARY_PARAM "load"
#ifndef F2B_FILTER_H_
#define F2B_FILTER_H_
* This header describes filter module definition and related routines
@ -5,8 +5,11 @@
#include <arpa/inet.h>
f2b_ipaddr_t *
f2b_ipaddr_create(const char *addr) {
f2b_ipaddr_t *a = NULL;
@ -7,17 +7,11 @@
#ifndef F2B_IPADDR_H_
#define F2B_IPADDR_H_
#include <netinet/in.h>
* This file contains definition of ipaddr struct and related routines
* @def IPADDR_MAX
* Maximum text length of address
@ -5,6 +5,15 @@
#define DEFAULT_BANTIME 3600 /* in seconds, 1 hour */
@ -7,15 +7,6 @@
#ifndef F2B_JAIL_H_
#define F2B_JAIL_H_
* This header describes jail definition and related routines
@ -7,7 +7,7 @@
#include "syslog.h"
#include <sys/syslog.h>
static log_msgtype_t minlevel = log_info;
static enum { log_stderr = 0, log_file = 1, log_syslog = 2 } dest = log_stderr;
@ -5,6 +5,11 @@
#define SOURCE_LIBRARY_PARAM "load"
#ifndef F2B_SOURCE_H_
#define F2B_SOURCE_H_
* This header describes source module definition and related routines
@ -7,6 +7,7 @@
@ -1,5 +1,6 @@
#include "../src/common.h"
#include "../src/log.h"
#include "../src/matches.h"
#include "../src/ipaddr.h"
#include "../src/filters/filter.h"
@ -1,6 +1,9 @@
int main() {
bool res = false;
f2b_ipaddr_t *list = NULL;
@ -1,4 +1,5 @@
#include "../src/statefile.h"