File: loadconfig.h

package info (click to toggle)
arpalert 2.0.3-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 2,332 kB
  • ctags: 415
  • sloc: ansic: 4,185; sh: 447; makefile: 153; perl: 28
file content (132 lines) | stat: -rw-r--r-- 1,975 bytes parent folder | download
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
/*
 * Copyright (c) 2005-2010 Thierry FOURNIER
 * $Id: loadconfig.h 360 2006-10-25 13:25:28Z thierry $
 *
 */

#ifndef __LOADCONFIG_H__
#define __LOADCONFIG_H__

#define TRUE                1
#define FALSE               0
#define CONFIGFILE_LEN      512

enum {
	CF_MACLIST,
	CF_LOGFILE,
	CF_ACTION,
	CF_LOCKFILE,
	CF_DAEMON,
	CF_RELOAD,
	CF_LOGLEVEL,
	CF_TIMEOUT,
	CF_MAXTH,
	CF_BLACKLST,
	CF_LEASES,
	CF_IF,
	CF_ABUS,
	CF_MAXENTRY,
	CF_DMPWL,
	CF_DMPBL,
	CF_DMPAPP,
	CF_TOOOLD,
	CF_AUTHFILE,
	CF_IGNORE_UNKNOWN,
	CF_DUMP_PAQUET,
	CF_PROMISC,
	CF_ANTIFLOOD_INTER,
	CF_ANTIFLOOD_GLOBAL,
	CF_IGNORE_ME,
	CF_UMASK,
	CF_USER,
	CF_CHROOT,
	CF_USESYSLOG,
	CF_IGNORESELFTEST,
	CF_UNAUTH_TO_METHOD,
	CF_ONLY_ARP,
	CF_DUMP_INTER,

	// mac addr to vendor conversion
	CF_MACCONV_FILE,
	CF_LOG_VENDOR,
	CF_ALERT_VENDOR,
	CF_MOD_VENDOR,

	// module path
	CF_MOD_ALERT,
	// module config string
	CF_MOD_CONFIG,

	// config alerts for logs
	CF_LOG_FLOOD,
	CF_LOG_NEWMAC,
	CF_LOG_NEW,
	CF_LOG_MACCHG,
	CF_LOG_IPCHG,
	CF_LOG_UNAUTH_RQ,
	CF_LOG_BOGON,
	CF_LOG_ABUS,
	CF_LOG_ALLOW,
	CF_LOG_DENY,

	// config alerts for script
	CF_ALERT_FLOOD,
	CF_ALERT_NEWMAC,
	CF_ALERT_NEW,
	CF_ALERT_MACCHG,
	CF_ALERT_IPCHG,
	CF_ALERT_UNAUTH_RQ,
	CF_ALERT_BOGON,
	CF_ALERT_ABUS,
	CF_ALERT_ALLOW,
	CF_ALERT_DENY,
	
	// config alerts for module
	CF_MOD_FLOOD,
	CF_MOD_NEWMAC,
	CF_MOD_NEW,
	CF_MOD_MACCHG,
	CF_MOD_IPCHG,
	CF_MOD_UNAUTH_RQ,
	CF_MOD_BOGON,
	CF_MOD_ABUS,
	CF_MOD_ALLOW,
	CF_MOD_DENY,

	// total number of arguments
	NUM_PARAMS
};

// if true, the data is updated
int flagdump;


/*
 * types:
 *  0: char
 *  1: int
 *  2: boolean
 *  3: octal
 *
 * attrib:
 *  parameter value in config file
 *
 * value:
 *  valeur du parametre de type indefini
 */
typedef struct {
	int		type;
	char		*attrib;
	union {
		char	*string;
		int	integer;
	} valeur;
} config_cell;

config_cell config[NUM_PARAMS];
char config_file[CONFIGFILE_LEN];

// load config file values
void config_load(int, char **);

#endif