File: loadconfig.h

package info (click to toggle)
arpalert 2.0.12-3
  • links: PTS, VCS
  • area: main
  • in suites: buster, sid
  • size: 3,508 kB
  • sloc: ansic: 4,452; sh: 517; makefile: 116; perl: 35
file content (143 lines) | stat: -rw-r--r-- 2,133 bytes parent folder | download | duplicates (2)
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
133
134
135
136
137
138
139
140
141
142
143
/*
 * Copyright (c) 2005-2010 Thierry FOURNIER
 * $Id: loadconfig.h 690 2008-03-31 18:36:43Z  $
 *
 */

#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_DUMP_PACKET,
	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,

	// expire for allowed hosts
	CF_EXPIRE_AUTH,

	// 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,
	CF_LOG_EXPIRE,

	// 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,
	CF_ALERT_EXPIRE,
	
	// 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,
	CF_MOD_EXPIRE,

	// 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
 */
struct config_cell {
	int		type;
	char		*attrib;
	union {
		char	*string;
		int	integer;
	} valeur;
};

extern struct config_cell config[];

char config_file[CONFIGFILE_LEN];

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

// can not modify config
void set_end_of_conf(void);

#endif