annotate src/syslogconfig.h @ 64:4b147494fc64

Added tag stable-1-0-16 for changeset 60f59936fabb
author Carl Byington <carl@five-ten-sg.com>
date Sat, 19 Dec 2015 10:25:11 -0800
parents 60f59936fabb
children c6c8a2102a3e
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
36
6a2f26976898 shutdown removes iptables entries that we added
carl
parents: 35
diff changeset
1 /*
6a2f26976898 shutdown removes iptables entries that we added
carl
parents: 35
diff changeset
2
6a2f26976898 shutdown removes iptables entries that we added
carl
parents: 35
diff changeset
3 Copyright (c) 2007 Carl Byington - 510 Software Group, released under
6a2f26976898 shutdown removes iptables entries that we added
carl
parents: 35
diff changeset
4 the GPL version 3 or any later version at your choice available at
6a2f26976898 shutdown removes iptables entries that we added
carl
parents: 35
diff changeset
5 http://www.gnu.org/licenses/gpl-3.0.txt
6a2f26976898 shutdown removes iptables entries that we added
carl
parents: 35
diff changeset
6
6a2f26976898 shutdown removes iptables entries that we added
carl
parents: 35
diff changeset
7 */
1
551433a01cab initial coding
carl
parents:
diff changeset
8
551433a01cab initial coding
carl
parents:
diff changeset
9
551433a01cab initial coding
carl
parents:
diff changeset
10 class SYSLOGCONFIG;
51
206448c00b55 Allow multiple contexts with independent add/remove commands.
Carl Byington <carl@five-ten-sg.com>
parents: 48
diff changeset
11 class CONTEXT;
3
8fe310e5cd44 initial coding
carl
parents: 2
diff changeset
12 class CONFIG;
8fe310e5cd44 initial coding
carl
parents: 2
diff changeset
13
8fe310e5cd44 initial coding
carl
parents: 2
diff changeset
14 struct IPPAIR {
48
ba0259c9e411 Fixes to compile on Fedora 9 and for const correctness
Carl Byington <carl@five-ten-sg.com>
parents: 38
diff changeset
15 int first;
ba0259c9e411 Fixes to compile on Fedora 9 and for const correctness
Carl Byington <carl@five-ten-sg.com>
parents: 38
diff changeset
16 int last;
ba0259c9e411 Fixes to compile on Fedora 9 and for const correctness
Carl Byington <carl@five-ten-sg.com>
parents: 38
diff changeset
17 int cidr;
3
8fe310e5cd44 initial coding
carl
parents: 2
diff changeset
18 };
8fe310e5cd44 initial coding
carl
parents: 2
diff changeset
19
8fe310e5cd44 initial coding
carl
parents: 2
diff changeset
20 class PATTERN {
48
ba0259c9e411 Fixes to compile on Fedora 9 and for const correctness
Carl Byington <carl@five-ten-sg.com>
parents: 38
diff changeset
21 const char * pattern; // owned by the string table
ba0259c9e411 Fixes to compile on Fedora 9 and for const correctness
Carl Byington <carl@five-ten-sg.com>
parents: 38
diff changeset
22 regex_t re;
ba0259c9e411 Fixes to compile on Fedora 9 and for const correctness
Carl Byington <carl@five-ten-sg.com>
parents: 38
diff changeset
23 int index; // zero based substring of the regex match that contains the ip address or hostname
63
60f59936fabb good authentication prevents ip blocking for awhile
Carl Byington <carl@five-ten-sg.com>
parents: 58
diff changeset
24 int amount; // if positive, count to add to the ip address leaky bucket;
60f59936fabb good authentication prevents ip blocking for awhile
Carl Byington <carl@five-ten-sg.com>
parents: 58
diff changeset
25 // if negative count to set into the ip address leaky bucket
48
ba0259c9e411 Fixes to compile on Fedora 9 and for const correctness
Carl Byington <carl@five-ten-sg.com>
parents: 38
diff changeset
26 const char * message; // for logging, owned by the string table
3
8fe310e5cd44 initial coding
carl
parents: 2
diff changeset
27 public:
48
ba0259c9e411 Fixes to compile on Fedora 9 and for const correctness
Carl Byington <carl@five-ten-sg.com>
parents: 38
diff changeset
28 ~PATTERN();
ba0259c9e411 Fixes to compile on Fedora 9 and for const correctness
Carl Byington <carl@five-ten-sg.com>
parents: 38
diff changeset
29 PATTERN(TOKEN &tok, const char *pattern_, int index_, int amount_, const char *msg_);
51
206448c00b55 Allow multiple contexts with independent add/remove commands.
Carl Byington <carl@five-ten-sg.com>
parents: 48
diff changeset
30 bool process(char *buf, CONTEXT &con, const char *file_name, int pattern_index);
48
ba0259c9e411 Fixes to compile on Fedora 9 and for const correctness
Carl Byington <carl@five-ten-sg.com>
parents: 38
diff changeset
31 void dump(int level);
3
8fe310e5cd44 initial coding
carl
parents: 2
diff changeset
32 };
1
551433a01cab initial coding
carl
parents:
diff changeset
33
51
206448c00b55 Allow multiple contexts with independent add/remove commands.
Carl Byington <carl@five-ten-sg.com>
parents: 48
diff changeset
34 struct ltint
206448c00b55 Allow multiple contexts with independent add/remove commands.
Carl Byington <carl@five-ten-sg.com>
parents: 48
diff changeset
35 {
206448c00b55 Allow multiple contexts with independent add/remove commands.
Carl Byington <carl@five-ten-sg.com>
parents: 48
diff changeset
36 bool operator()(const int s1, const int s2) const
206448c00b55 Allow multiple contexts with independent add/remove commands.
Carl Byington <carl@five-ten-sg.com>
parents: 48
diff changeset
37 {
206448c00b55 Allow multiple contexts with independent add/remove commands.
Carl Byington <carl@five-ten-sg.com>
parents: 48
diff changeset
38 return (unsigned)s1 < (unsigned)s2;
206448c00b55 Allow multiple contexts with independent add/remove commands.
Carl Byington <carl@five-ten-sg.com>
parents: 48
diff changeset
39 }
206448c00b55 Allow multiple contexts with independent add/remove commands.
Carl Byington <carl@five-ten-sg.com>
parents: 48
diff changeset
40 };
206448c00b55 Allow multiple contexts with independent add/remove commands.
Carl Byington <carl@five-ten-sg.com>
parents: 48
diff changeset
41
206448c00b55 Allow multiple contexts with independent add/remove commands.
Carl Byington <carl@five-ten-sg.com>
parents: 48
diff changeset
42 struct bucket {
206448c00b55 Allow multiple contexts with independent add/remove commands.
Carl Byington <carl@five-ten-sg.com>
parents: 48
diff changeset
43 int count;
58
b45dddebe8fc Add exponential increase in penalty for repeat offenders
Carl Byington <carl@five-ten-sg.com>
parents: 51
diff changeset
44 bool blocked; // true iff ever count>threshold
51
206448c00b55 Allow multiple contexts with independent add/remove commands.
Carl Byington <carl@five-ten-sg.com>
parents: 48
diff changeset
45 };
206448c00b55 Allow multiple contexts with independent add/remove commands.
Carl Byington <carl@five-ten-sg.com>
parents: 48
diff changeset
46
206448c00b55 Allow multiple contexts with independent add/remove commands.
Carl Byington <carl@five-ten-sg.com>
parents: 48
diff changeset
47 typedef map<int, bucket, ltint> ip_buckets;
206448c00b55 Allow multiple contexts with independent add/remove commands.
Carl Byington <carl@five-ten-sg.com>
parents: 48
diff changeset
48
206448c00b55 Allow multiple contexts with independent add/remove commands.
Carl Byington <carl@five-ten-sg.com>
parents: 48
diff changeset
49 class IPR {
206448c00b55 Allow multiple contexts with independent add/remove commands.
Carl Byington <carl@five-ten-sg.com>
parents: 48
diff changeset
50 int reference_count; // number of contexts using this recorder
58
b45dddebe8fc Add exponential increase in penalty for repeat offenders
Carl Byington <carl@five-ten-sg.com>
parents: 51
diff changeset
51 int daily_timer; // track daily cycle to reduce repeat offenders penalties
51
206448c00b55 Allow multiple contexts with independent add/remove commands.
Carl Byington <carl@five-ten-sg.com>
parents: 48
diff changeset
52 ip_buckets violations;
58
b45dddebe8fc Add exponential increase in penalty for repeat offenders
Carl Byington <carl@five-ten-sg.com>
parents: 51
diff changeset
53 ip_buckets repeat_offenders;
51
206448c00b55 Allow multiple contexts with independent add/remove commands.
Carl Byington <carl@five-ten-sg.com>
parents: 48
diff changeset
54 public:
206448c00b55 Allow multiple contexts with independent add/remove commands.
Carl Byington <carl@five-ten-sg.com>
parents: 48
diff changeset
55 IPR();
206448c00b55 Allow multiple contexts with independent add/remove commands.
Carl Byington <carl@five-ten-sg.com>
parents: 48
diff changeset
56 int reference(int delta) {reference_count += delta; return reference_count;};
206448c00b55 Allow multiple contexts with independent add/remove commands.
Carl Byington <carl@five-ten-sg.com>
parents: 48
diff changeset
57 void add(int ip, int amount, CONTEXT &con, const char *file_name, int pattern_index, const char *message);
206448c00b55 Allow multiple contexts with independent add/remove commands.
Carl Byington <carl@five-ten-sg.com>
parents: 48
diff changeset
58 void leak(int amount, CONTEXT &con);
206448c00b55 Allow multiple contexts with independent add/remove commands.
Carl Byington <carl@five-ten-sg.com>
parents: 48
diff changeset
59 void free_all(CONTEXT &con);
58
b45dddebe8fc Add exponential increase in penalty for repeat offenders
Carl Byington <carl@five-ten-sg.com>
parents: 51
diff changeset
60 void update(int ip, bool added, int scale, const char *file_name, int pattern_index, const char *message);
51
206448c00b55 Allow multiple contexts with independent add/remove commands.
Carl Byington <carl@five-ten-sg.com>
parents: 48
diff changeset
61 void changed(CONTEXT &con, int ip, bool added);
206448c00b55 Allow multiple contexts with independent add/remove commands.
Carl Byington <carl@five-ten-sg.com>
parents: 48
diff changeset
62 static IPR* find(const char* name);
206448c00b55 Allow multiple contexts with independent add/remove commands.
Carl Byington <carl@five-ten-sg.com>
parents: 48
diff changeset
63 static void release(const char* name);
206448c00b55 Allow multiple contexts with independent add/remove commands.
Carl Byington <carl@five-ten-sg.com>
parents: 48
diff changeset
64 };
206448c00b55 Allow multiple contexts with independent add/remove commands.
Carl Byington <carl@five-ten-sg.com>
parents: 48
diff changeset
65
206448c00b55 Allow multiple contexts with independent add/remove commands.
Carl Byington <carl@five-ten-sg.com>
parents: 48
diff changeset
66
48
ba0259c9e411 Fixes to compile on Fedora 9 and for const correctness
Carl Byington <carl@five-ten-sg.com>
parents: 38
diff changeset
67 typedef SYSLOGCONFIG * SYSLOGCONFIGP;
ba0259c9e411 Fixes to compile on Fedora 9 and for const correctness
Carl Byington <carl@five-ten-sg.com>
parents: 38
diff changeset
68 typedef PATTERN * PATTERNP;
51
206448c00b55 Allow multiple contexts with independent add/remove commands.
Carl Byington <carl@five-ten-sg.com>
parents: 48
diff changeset
69 typedef CONTEXT * CONTEXTP;
206448c00b55 Allow multiple contexts with independent add/remove commands.
Carl Byington <carl@five-ten-sg.com>
parents: 48
diff changeset
70 typedef map<const char *, IPR*> recorder_map;
206448c00b55 Allow multiple contexts with independent add/remove commands.
Carl Byington <carl@five-ten-sg.com>
parents: 48
diff changeset
71 typedef list<CONTEXTP> context_list;
48
ba0259c9e411 Fixes to compile on Fedora 9 and for const correctness
Carl Byington <carl@five-ten-sg.com>
parents: 38
diff changeset
72 typedef list<SYSLOGCONFIGP> syslogconfig_list;
ba0259c9e411 Fixes to compile on Fedora 9 and for const correctness
Carl Byington <carl@five-ten-sg.com>
parents: 38
diff changeset
73 typedef list<IPPAIR> ippair_list;
ba0259c9e411 Fixes to compile on Fedora 9 and for const correctness
Carl Byington <carl@five-ten-sg.com>
parents: 38
diff changeset
74 typedef list<PATTERNP> pattern_list;
2
6e88da080f08 initial coding
carl
parents: 1
diff changeset
75 const int buflen = 1024;
1
551433a01cab initial coding
carl
parents:
diff changeset
76
551433a01cab initial coding
carl
parents:
diff changeset
77 class SYSLOGCONFIG {
48
ba0259c9e411 Fixes to compile on Fedora 9 and for const correctness
Carl Byington <carl@five-ten-sg.com>
parents: 38
diff changeset
78 TOKEN * tokp;
ba0259c9e411 Fixes to compile on Fedora 9 and for const correctness
Carl Byington <carl@five-ten-sg.com>
parents: 38
diff changeset
79 const char * file_name; // name of the syslog file
ba0259c9e411 Fixes to compile on Fedora 9 and for const correctness
Carl Byington <carl@five-ten-sg.com>
parents: 38
diff changeset
80 pattern_list patterns; // owns the patterns
ba0259c9e411 Fixes to compile on Fedora 9 and for const correctness
Carl Byington <carl@five-ten-sg.com>
parents: 38
diff changeset
81 int fd;
ba0259c9e411 Fixes to compile on Fedora 9 and for const correctness
Carl Byington <carl@five-ten-sg.com>
parents: 38
diff changeset
82 struct stat openfdstat;
ba0259c9e411 Fixes to compile on Fedora 9 and for const correctness
Carl Byington <carl@five-ten-sg.com>
parents: 38
diff changeset
83 int len; // bytes in the buffer
ba0259c9e411 Fixes to compile on Fedora 9 and for const correctness
Carl Byington <carl@five-ten-sg.com>
parents: 38
diff changeset
84 char buf[buflen];
1
551433a01cab initial coding
carl
parents:
diff changeset
85 public:
48
ba0259c9e411 Fixes to compile on Fedora 9 and for const correctness
Carl Byington <carl@five-ten-sg.com>
parents: 38
diff changeset
86 SYSLOGCONFIG(TOKEN &tok, const char *file_name_);
ba0259c9e411 Fixes to compile on Fedora 9 and for const correctness
Carl Byington <carl@five-ten-sg.com>
parents: 38
diff changeset
87 ~SYSLOGCONFIG();
ba0259c9e411 Fixes to compile on Fedora 9 and for const correctness
Carl Byington <carl@five-ten-sg.com>
parents: 38
diff changeset
88 bool failed() { return (fd == -1); };
ba0259c9e411 Fixes to compile on Fedora 9 and for const correctness
Carl Byington <carl@five-ten-sg.com>
parents: 38
diff changeset
89 void open(bool msg);
51
206448c00b55 Allow multiple contexts with independent add/remove commands.
Carl Byington <carl@five-ten-sg.com>
parents: 48
diff changeset
90 bool read(CONTEXT &con);
48
ba0259c9e411 Fixes to compile on Fedora 9 and for const correctness
Carl Byington <carl@five-ten-sg.com>
parents: 38
diff changeset
91 void close();
ba0259c9e411 Fixes to compile on Fedora 9 and for const correctness
Carl Byington <carl@five-ten-sg.com>
parents: 38
diff changeset
92 void add_pattern(PATTERNP pat);
51
206448c00b55 Allow multiple contexts with independent add/remove commands.
Carl Byington <carl@five-ten-sg.com>
parents: 48
diff changeset
93 void process(CONTEXT &con);
48
ba0259c9e411 Fixes to compile on Fedora 9 and for const correctness
Carl Byington <carl@five-ten-sg.com>
parents: 38
diff changeset
94 void dump(int level);
1
551433a01cab initial coding
carl
parents:
diff changeset
95 };
551433a01cab initial coding
carl
parents:
diff changeset
96
51
206448c00b55 Allow multiple contexts with independent add/remove commands.
Carl Byington <carl@five-ten-sg.com>
parents: 48
diff changeset
97
206448c00b55 Allow multiple contexts with independent add/remove commands.
Carl Byington <carl@five-ten-sg.com>
parents: 48
diff changeset
98 class CONTEXT {
206448c00b55 Allow multiple contexts with independent add/remove commands.
Carl Byington <carl@five-ten-sg.com>
parents: 48
diff changeset
99 public:
206448c00b55 Allow multiple contexts with independent add/remove commands.
Carl Byington <carl@five-ten-sg.com>
parents: 48
diff changeset
100 const char * name; // name of this context
206448c00b55 Allow multiple contexts with independent add/remove commands.
Carl Byington <carl@five-ten-sg.com>
parents: 48
diff changeset
101 int threshold;
206448c00b55 Allow multiple contexts with independent add/remove commands.
Carl Byington <carl@five-ten-sg.com>
parents: 48
diff changeset
102 ippair_list ignore; // owns all the ippairs
206448c00b55 Allow multiple contexts with independent add/remove commands.
Carl Byington <carl@five-ten-sg.com>
parents: 48
diff changeset
103 const char * add_command; // owned by the string table
206448c00b55 Allow multiple contexts with independent add/remove commands.
Carl Byington <carl@five-ten-sg.com>
parents: 48
diff changeset
104 const char * remove_command; // ""
206448c00b55 Allow multiple contexts with independent add/remove commands.
Carl Byington <carl@five-ten-sg.com>
parents: 48
diff changeset
105 IPR * recorder; // used to record violations
206448c00b55 Allow multiple contexts with independent add/remove commands.
Carl Byington <carl@five-ten-sg.com>
parents: 48
diff changeset
106 syslogconfig_list syslogconfigs; // owns all the syslogconfigs
206448c00b55 Allow multiple contexts with independent add/remove commands.
Carl Byington <carl@five-ten-sg.com>
parents: 48
diff changeset
107
206448c00b55 Allow multiple contexts with independent add/remove commands.
Carl Byington <carl@five-ten-sg.com>
parents: 48
diff changeset
108 CONTEXT(const char *nam);
206448c00b55 Allow multiple contexts with independent add/remove commands.
Carl Byington <carl@five-ten-sg.com>
parents: 48
diff changeset
109 ~CONTEXT();
206448c00b55 Allow multiple contexts with independent add/remove commands.
Carl Byington <carl@five-ten-sg.com>
parents: 48
diff changeset
110 void set_add(const char *add) { add_command = add; };
206448c00b55 Allow multiple contexts with independent add/remove commands.
Carl Byington <carl@five-ten-sg.com>
parents: 48
diff changeset
111 void set_remove(const char *remove) { remove_command = remove; };
206448c00b55 Allow multiple contexts with independent add/remove commands.
Carl Byington <carl@five-ten-sg.com>
parents: 48
diff changeset
112 void set_threshold(int threshold_) { threshold = threshold_; };
206448c00b55 Allow multiple contexts with independent add/remove commands.
Carl Byington <carl@five-ten-sg.com>
parents: 48
diff changeset
113 int get_threshold() { return threshold; };
206448c00b55 Allow multiple contexts with independent add/remove commands.
Carl Byington <carl@five-ten-sg.com>
parents: 48
diff changeset
114 void add_syslogconfig(SYSLOGCONFIGP con);
206448c00b55 Allow multiple contexts with independent add/remove commands.
Carl Byington <carl@five-ten-sg.com>
parents: 48
diff changeset
115 void add_pair(IPPAIR pair);
206448c00b55 Allow multiple contexts with independent add/remove commands.
Carl Byington <carl@five-ten-sg.com>
parents: 48
diff changeset
116 void dump();
206448c00b55 Allow multiple contexts with independent add/remove commands.
Carl Byington <carl@five-ten-sg.com>
parents: 48
diff changeset
117 void read(CONFIG &con);
206448c00b55 Allow multiple contexts with independent add/remove commands.
Carl Byington <carl@five-ten-sg.com>
parents: 48
diff changeset
118 void free_all();
206448c00b55 Allow multiple contexts with independent add/remove commands.
Carl Byington <carl@five-ten-sg.com>
parents: 48
diff changeset
119 void leak(int delta);
206448c00b55 Allow multiple contexts with independent add/remove commands.
Carl Byington <carl@five-ten-sg.com>
parents: 48
diff changeset
120 bool looking(int ip);
206448c00b55 Allow multiple contexts with independent add/remove commands.
Carl Byington <carl@five-ten-sg.com>
parents: 48
diff changeset
121 };
206448c00b55 Allow multiple contexts with independent add/remove commands.
Carl Byington <carl@five-ten-sg.com>
parents: 48
diff changeset
122
206448c00b55 Allow multiple contexts with independent add/remove commands.
Carl Byington <carl@five-ten-sg.com>
parents: 48
diff changeset
123
3
8fe310e5cd44 initial coding
carl
parents: 2
diff changeset
124 class CONFIG {
8fe310e5cd44 initial coding
carl
parents: 2
diff changeset
125 public:
48
ba0259c9e411 Fixes to compile on Fedora 9 and for const correctness
Carl Byington <carl@five-ten-sg.com>
parents: 38
diff changeset
126 // the only mutable stuff once it has been loaded from the config file
ba0259c9e411 Fixes to compile on Fedora 9 and for const correctness
Carl Byington <carl@five-ten-sg.com>
parents: 38
diff changeset
127 int reference_count; // protected by the global config_mutex
ba0259c9e411 Fixes to compile on Fedora 9 and for const correctness
Carl Byington <carl@five-ten-sg.com>
parents: 38
diff changeset
128 // all the rest is constant after loading from the config file
ba0259c9e411 Fixes to compile on Fedora 9 and for const correctness
Carl Byington <carl@five-ten-sg.com>
parents: 38
diff changeset
129 int generation;
ba0259c9e411 Fixes to compile on Fedora 9 and for const correctness
Carl Byington <carl@five-ten-sg.com>
parents: 38
diff changeset
130 time_t load_time;
ba0259c9e411 Fixes to compile on Fedora 9 and for const correctness
Carl Byington <carl@five-ten-sg.com>
parents: 38
diff changeset
131 string_set config_files;
51
206448c00b55 Allow multiple contexts with independent add/remove commands.
Carl Byington <carl@five-ten-sg.com>
parents: 48
diff changeset
132 context_list contexts;
1
551433a01cab initial coding
carl
parents:
diff changeset
133
48
ba0259c9e411 Fixes to compile on Fedora 9 and for const correctness
Carl Byington <carl@five-ten-sg.com>
parents: 38
diff changeset
134 CONFIG();
ba0259c9e411 Fixes to compile on Fedora 9 and for const correctness
Carl Byington <carl@five-ten-sg.com>
parents: 38
diff changeset
135 ~CONFIG();
51
206448c00b55 Allow multiple contexts with independent add/remove commands.
Carl Byington <carl@five-ten-sg.com>
parents: 48
diff changeset
136 void add_context(CONTEXTP con) {contexts.push_back(con);} ;
48
ba0259c9e411 Fixes to compile on Fedora 9 and for const correctness
Carl Byington <carl@five-ten-sg.com>
parents: 38
diff changeset
137 void dump();
ba0259c9e411 Fixes to compile on Fedora 9 and for const correctness
Carl Byington <carl@five-ten-sg.com>
parents: 38
diff changeset
138 void read();
ba0259c9e411 Fixes to compile on Fedora 9 and for const correctness
Carl Byington <carl@five-ten-sg.com>
parents: 38
diff changeset
139 void sleep(int duration, time_t &previous);
36
6a2f26976898 shutdown removes iptables entries that we added
carl
parents: 35
diff changeset
140 void free_all();
1
551433a01cab initial coding
carl
parents:
diff changeset
141 };
551433a01cab initial coding
carl
parents:
diff changeset
142
48
ba0259c9e411 Fixes to compile on Fedora 9 and for const correctness
Carl Byington <carl@five-ten-sg.com>
parents: 38
diff changeset
143 void discard(string_set &s);
ba0259c9e411 Fixes to compile on Fedora 9 and for const correctness
Carl Byington <carl@five-ten-sg.com>
parents: 38
diff changeset
144 const char* register_string(string_set &s, const char *name);
ba0259c9e411 Fixes to compile on Fedora 9 and for const correctness
Carl Byington <carl@five-ten-sg.com>
parents: 38
diff changeset
145 const char* register_string(const char *name);
ba0259c9e411 Fixes to compile on Fedora 9 and for const correctness
Carl Byington <carl@five-ten-sg.com>
parents: 38
diff changeset
146 void clear_strings();
ba0259c9e411 Fixes to compile on Fedora 9 and for const correctness
Carl Byington <carl@five-ten-sg.com>
parents: 38
diff changeset
147 int ip_address(const char *have);
ba0259c9e411 Fixes to compile on Fedora 9 and for const correctness
Carl Byington <carl@five-ten-sg.com>
parents: 38
diff changeset
148 bool load_conf(CONFIG &dc, const char *fn);
ba0259c9e411 Fixes to compile on Fedora 9 and for const correctness
Carl Byington <carl@five-ten-sg.com>
parents: 38
diff changeset
149 void token_init();
1
551433a01cab initial coding
carl
parents:
diff changeset
150
48
ba0259c9e411 Fixes to compile on Fedora 9 and for const correctness
Carl Byington <carl@five-ten-sg.com>
parents: 38
diff changeset
151 extern const char *token_add;
ba0259c9e411 Fixes to compile on Fedora 9 and for const correctness
Carl Byington <carl@five-ten-sg.com>
parents: 38
diff changeset
152 extern const char *token_bucket;
51
206448c00b55 Allow multiple contexts with independent add/remove commands.
Carl Byington <carl@five-ten-sg.com>
parents: 48
diff changeset
153 extern const char *token_context;
48
ba0259c9e411 Fixes to compile on Fedora 9 and for const correctness
Carl Byington <carl@five-ten-sg.com>
parents: 38
diff changeset
154 extern const char *token_file;
ba0259c9e411 Fixes to compile on Fedora 9 and for const correctness
Carl Byington <carl@five-ten-sg.com>
parents: 38
diff changeset
155 extern const char *token_ignore;
ba0259c9e411 Fixes to compile on Fedora 9 and for const correctness
Carl Byington <carl@five-ten-sg.com>
parents: 38
diff changeset
156 extern const char *token_include;
ba0259c9e411 Fixes to compile on Fedora 9 and for const correctness
Carl Byington <carl@five-ten-sg.com>
parents: 38
diff changeset
157 extern const char *token_index;
ba0259c9e411 Fixes to compile on Fedora 9 and for const correctness
Carl Byington <carl@five-ten-sg.com>
parents: 38
diff changeset
158 extern const char *token_lbrace;
ba0259c9e411 Fixes to compile on Fedora 9 and for const correctness
Carl Byington <carl@five-ten-sg.com>
parents: 38
diff changeset
159 extern const char *token_pattern;
ba0259c9e411 Fixes to compile on Fedora 9 and for const correctness
Carl Byington <carl@five-ten-sg.com>
parents: 38
diff changeset
160 extern const char *token_rbrace;
ba0259c9e411 Fixes to compile on Fedora 9 and for const correctness
Carl Byington <carl@five-ten-sg.com>
parents: 38
diff changeset
161 extern const char *token_remove;
ba0259c9e411 Fixes to compile on Fedora 9 and for const correctness
Carl Byington <carl@five-ten-sg.com>
parents: 38
diff changeset
162 extern const char *token_semi;
ba0259c9e411 Fixes to compile on Fedora 9 and for const correctness
Carl Byington <carl@five-ten-sg.com>
parents: 38
diff changeset
163 extern const char *token_slash;
ba0259c9e411 Fixes to compile on Fedora 9 and for const correctness
Carl Byington <carl@five-ten-sg.com>
parents: 38
diff changeset
164 extern const char *token_threshold;
1
551433a01cab initial coding
carl
parents:
diff changeset
165