summaryrefslogtreecommitdiffstats
path: root/src/plugins/ifw/ifw.h
blob: f007b0f3df360c63c77265aa4b4bd3cf49694ded (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#ifndef IFW_H
#define IFW_H

#include "plugin.h"

#define IFW_DBUS_PATH      PLUGIN_ROOT_PATH "/ifw"
#define IFW_DBUS_INTERFACE PLUGIN_ROOT_INTF ".ifw"

#include <sys/types.h>
#include "libnl_ifw.h"

#define IFW_SYSCONF_ROOT       "/etc/ifw/"
#define IFW_BLACKLIST_FILENAME IFW_SYSCONF_ROOT "blacklist"
#define IFW_WHITELIST_FILENAME IFW_SYSCONF_ROOT "whitelist"

typedef enum {
    IFW_MODE_AUTO,
    IFW_MODE_INTERACTIVE
} ifw_mode_t;

typedef struct {
    long timestamp_sec;             /* date */
    char indev_name[IFNAMSIZ];      /* input interface */
    char prefix[PREFSIZ];           /* summary of attack */
    int sensor;                     /* sensor the alert come from */
    int protocol;                   /* Protocol */
    u_int32_t s_addr;               /* source address */
    u_int16_t d_port;               /* destination port UDP/TCP */
    u_int8_t icmp_type;             /* icmp type */
} msg_usr_t;

typedef struct popup_verdict {
    int seq;
    int bl;
} popup_verdict_t;

#include "black_list.h"
#include "white_list.h"
#include "report_list.h"

typedef struct {
    ifw_mode_t mode;
    black_list_t blacklist;
    report_list_t reports;
    white_list_t whitelist;    
} ifw_t;

#endif /* IFW_H */