1 |
|
|
2 |
open Printf2 |
open Printf2 |
3 |
|
|
4 |
|
let lprintf_nl () = |
5 |
|
lprintf "%s[IPblock]: " |
6 |
|
(log_time ()); lprintf_nl2 |
7 |
|
|
8 |
(* range name, ip min, ip max (inclusive) *) |
(* range name, ip min, ip max (inclusive) *) |
9 |
type blocking_range = { |
type blocking_range = { |
10 |
blocking_description: string; |
blocking_description: string; |
108 |
end else |
end else |
109 |
raise Not_found |
raise Not_found |
110 |
with _ -> |
with _ -> |
111 |
lprintf "Syntax error while loading IP blocklist in line %s\n" line |
lprintf_nl () "Syntax error while loading IP blocklist in line %s" line |
112 |
done; |
done; |
113 |
bl_empty (* not reached *) |
bl_empty (* not reached *) |
114 |
with End_of_file -> |
with End_of_file -> |
115 |
close_in cin; |
close_in cin; |
116 |
lprintf "IP blacklist: %d ranges loaded\n" !nranges; |
lprintf_nl () "%d ranges loaded" !nranges; |
117 |
!bl |
!bl |
118 |
|
|
119 |
let load filename = |
let load filename = |