Browse Source

* reorganize #include's

master
Alex 'AdUser' Z 3 years ago
parent
commit
1b09022d6b
  1. 3
      src/appconfig.c
  2. 3
      src/appconfig.h
  3. 4
      src/backend.c
  4. 3
      src/backend.h
  5. 4
      src/common.h
  6. 20
      src/daemon.c
  7. 5
      src/filter-test.c
  8. 4
      src/filter.c
  9. 3
      src/filter.h
  10. 3
      src/ipaddr.c
  11. 6
      src/ipaddr.h
  12. 9
      src/jail.c
  13. 9
      src/jail.h
  14. 2
      src/log.c
  15. 5
      src/source.c
  16. 3
      src/source.h
  17. 1
      src/statefile.c
  18. 1
      t/t_filters.c
  19. 3
      t/t_ipaddr.c
  20. 1
      t/t_statefile.c

3
src/appconfig.c

@ -9,6 +9,9 @@
#include "config.h"
#include "appconfig.h"
#include <pwd.h>
#include <grp.h>
f2b_appconfig_t appconfig = {
.coredumps = false,
.daemon = false,

3
src/appconfig.h

@ -7,9 +7,6 @@
#ifndef F2B_APPCONFIG_H_
#define F2B_APPCONFIG_H_
#include <pwd.h>
#include <grp.h>
typedef struct f2b_appconfig_t {
bool daemon;
bool coredumps;

4
src/backend.c

@ -5,8 +5,12 @@
* published by the Free Software Foundation.
*/
#include "common.h"
#include "config.h"
#include "log.h"
#include "backend.h"
#include <dlfcn.h>
#define BACKEND_LIBRARY_PARAM "load"
f2b_backend_t *

3
src/backend.h

@ -7,9 +7,6 @@
#ifndef F2B_BACKEND_H_
#define F2B_BACKEND_H_
#include "config.h"
#include "log.h"
/**
* @file
* This header describes backend module definition and related routines

4
src/common.h

@ -9,10 +9,8 @@
#include <assert.h>
#include <ctype.h>
#include <dlfcn.h>
#include <errno.h>
#include <fcntl.h>
#include <limits.h>
#include <limits.h> /* PATH_MAX */
#include <stdarg.h>
#include <stdbool.h>
#include <stdint.h>

20
src/daemon.c

@ -5,20 +5,24 @@
* published by the Free Software Foundation.
*/
#include "common.h"
#include <getopt.h>
#include <signal.h>
#include <sys/resource.h>
#include "ipaddr.h"
#include "log.h"
#include "config.h"
#include "jail.h"
#include "backend.h"
#include "appconfig.h"
#include "matches.h"
#include "ipaddr.h"
#include "source.h"
#include "filter.h"
#include "backend.h"
#include "statefile.h"
#include "jail.h"
#include "buf.h"
#include "commands.h"
#include "csocket.h"
#include <getopt.h>
#include <signal.h>
#include <sys/resource.h>
/**
* @def SA_REGISTER
* Register signal handler

5
src/filter-test.c

@ -6,10 +6,15 @@
*/
#include "common.h"
#include "log.h"
#include "matches.h"
#include "ipaddr.h"
#include "config.h"
#include "filter.h"
#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);

4
src/filter.c

@ -5,8 +5,12 @@
* published by the Free Software Foundation.
*/
#include "common.h"
#include "config.h"
#include "log.h"
#include "filter.h"
#include <dlfcn.h>
#define REGEX_LINE_MAX 256
#define HOST_TOKEN "<HOST>"
#define FILTER_LIBRARY_PARAM "load"

3
src/filter.h

@ -7,9 +7,6 @@
#ifndef F2B_FILTER_H_
#define F2B_FILTER_H_
#include "config.h"
#include "log.h"
/**
* @file
* This header describes filter module definition and related routines

3
src/ipaddr.c

@ -5,8 +5,11 @@
* published by the Free Software Foundation.
*/
#include "common.h"
#include "matches.h"
#include "ipaddr.h"
#include <arpa/inet.h>
f2b_ipaddr_t *
f2b_ipaddr_create(const char *addr) {
f2b_ipaddr_t *a = NULL;

6
src/ipaddr.h

@ -7,17 +7,11 @@
#ifndef F2B_IPADDR_H_
#define F2B_IPADDR_H_
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
/**
* @file
* This file contains definition of ipaddr struct and related routines
*/
#include "matches.h"
/**
* @def IPADDR_MAX
* Maximum text length of address

9
src/jail.c

@ -5,6 +5,15 @@
* published by the Free Software Foundation.
*/
#include "common.h"
#include "log.h"
#include "config.h"
#include "appconfig.h"
#include "matches.h"
#include "ipaddr.h"
#include "source.h"
#include "filter.h"
#include "backend.h"
#include "statefile.h"
#include "jail.h"
#define DEFAULT_BANTIME 3600 /* in seconds, 1 hour */

9
src/jail.h

@ -7,15 +7,6 @@
#ifndef F2B_JAIL_H_
#define F2B_JAIL_H_
#include "log.h"
#include "ipaddr.h"
#include "config.h"
#include "appconfig.h"
#include "statefile.h"
#include "source.h"
#include "filter.h"
#include "backend.h"
/**
* @file
* This header describes jail definition and related routines

2
src/log.c

@ -7,7 +7,7 @@
#include "common.h"
#include "log.h"
#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
src/source.c

@ -5,6 +5,11 @@
* published by the Free Software Foundation.
*/
#include "common.h"
#include "config.h"
#include "log.h"
#include <dlfcn.h>
#include "source.h"
#define SOURCE_LIBRARY_PARAM "load"

3
src/source.h

@ -7,9 +7,6 @@
#ifndef F2B_SOURCE_H_
#define F2B_SOURCE_H_
#include "config.h"
#include "log.h"
/**
* @file
* This header describes source module definition and related routines

1
src/statefile.c

@ -7,6 +7,7 @@
#include "common.h"
#include "log.h"
#include "matches.h"
#include "ipaddr.h"
#include "statefile.h"

1
t/t_filters.c

@ -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"

3
t/t_ipaddr.c

@ -1,6 +1,9 @@
#include "../src/common.h"
#include "../src/matches.h"
#include "../src/ipaddr.h"
#include <arpa/inet.h>
int main() {
bool res = false;
f2b_ipaddr_t *list = NULL;

1
t/t_statefile.c

@ -1,4 +1,5 @@
#include "../src/common.h"
#include "../src/matches.h"
#include "../src/ipaddr.h"
#include "../src/statefile.h"

Loading…
Cancel
Save