summaryrefslogtreecommitdiffstats
path: root/shorewall-config-html.lsp
blob: 41ca945af2289b7f514915bf2714f747e2877b1a (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
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
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
<? local form = ... 
require("viewfunctions")
--[[ DEBUG INFORMATION
io.write("<H1>DEBUGGING</H1><span style='color:red'><H2>DEBUG INFO: CFE</H2>")
io.write(html.cfe_unpack(form))
io.write("</span>")
--]]

local descr = {
	['interfaces'] = {
		['labels'] = { "ZONE", "INTERFACES", "BROADCAST", "OPTIONS" },
		['width'] = { "100", "100", "100", "*" }
		},
	['zones'] = {
		['labels'] = { "ZONE", "INTERFACES", "BROADCAST", "OPTIONS" },
		['width'] = { "100", "100", "100", "*" }
		},
	['policy'] = {
		['labels'] = { "SOURCE", "DEST", "POLICY", "LOG LEVEL", "LIMIT:BURST" },
		['width'] = { "100", "100", "100", "100" }
		},
	['rules'] = {
		['labels'] = { "ACTION", "SOURCE", "DEST", "PROTO", "DEST<BR>PORT", "SOURCE<BR>PORT(S)", "ORIGINAL<BR>DEST", "RATE<BR>LIMIT", "USER/<BR>GROUP", "MARK", },
		['width'] = { "100", "70", "70", "70", "100", }
		},
	}
?>

<H1>SYSTEM INFO</H1>
<DL>
<? 
local myform = form.status 
local tags = { "status", "version", "autostart", }
displayinfo(myform,tags,"viewonly")
?>
</DL>

<form name="cmd" action="" method="POST">
<? local myform = form.config ?>
<h1>CONFIGURATION</h1>
<H2>Advanced configuration</H2>
<H3>Parameters</H3>
<DL>
<? 
local tags = { "params", "params_cmd",  }
displayinfo(myform,tags)
?>
</DL>

<H3>Interfaces</H3>
<? local myform = "interfaces" ?>
<DL>
<TABLE>
<TR>
	<TD style="padding:0px;margin:0px;" class="header" WIDTH="17"><IMG SRC='/static/tango/16x16/actions/go-down.png' width='16' height='16' alt></TD>
<? for i=1,#descr[myform]['labels'] do ?>
	<TD style="padding-right:10px;text-align:left;" class="header" WIDTH="<? io.write(descr[myform]['width'][i] or "*") ?>"><? io.write(descr[myform]['labels'][i] or "") ?></TD>
<? end ?>
	<TD class="header" WIDTH="60"><IMG SRC='/static/tango/16x16/actions/list-add.png' width='16' height='16' title="Add item below this record"></TD>
</TR>

<?
for i=1, #form.config[myform]['option'] do
?>

<TR>
	<TD><IMG SRC='/static/tango/16x16/actions/go-<? if i == #form.config[myform]['option'] then io.write("bottom") else io.write("down") end ?>.png' width='16' height='16' alt></TD>
	<? for ii=1,#descr[myform]['labels'] do ?>
		<TD style="padding-right:10px;text-align:left;border-bottom:1px solid #ccc"><? io.write(form.config[myform]['option'][i][ii] or "") ?></TD>
	<? end ?>
	<TD style="padding-right:0px;text-align:left;border-bottom:1px solid #ccc">
<IMG SRC='/static/tango/16x16/actions/list-add.png' width='16' height='16' title="Add item below this record">
<IMG SRC='/static/tango/16x16/actions/list-remove.png' width='16' height='16' title="Remove this record">
<IMG SRC='/static/tango/16x16/actions/document-properties.png' width='16' height='16' title="Edit this record">
</TD>
	</TR>
<?
end
?>
</TABLE>
</DL>

<H3>Defince zones</H3>
<? local myform = "zones" ?>
<DL>
<TABLE>
<TR>
	<TD style="padding:0px;margin:0px;" class="header" WIDTH="17"><IMG SRC='/static/tango/16x16/actions/go-down.png' width='16' height='16' alt></TD>
<? for i=1,#descr[myform]['labels'] do ?>
	<TD style="padding-right:10px;text-align:left;" class="header" WIDTH="<? io.write(descr[myform]['width'][i] or "*") ?>"><? io.write(descr[myform]['labels'][i] or "") ?></TD>
<? end ?>
	<TD class="header" WIDTH="60"><IMG SRC='/static/tango/16x16/actions/list-add.png' width='16' height='16' title="Add item below this record"></TD>
</TR>

<?
for i=1, #form.config[myform]['option'] do
?>

<TR>
	<TD><IMG SRC='/static/tango/16x16/actions/go-<? if i == #form.config[myform]['option'] then io.write("bottom") else io.write("down") end ?>.png' width='16' height='16' alt></TD>
	<? for ii=1,#descr[myform]['labels'] do ?>
		<TD style="padding-right:10px;text-align:left;border-bottom:1px solid #ccc"><? io.write(form.config[myform]['option'][i][ii] or "") ?></TD>
	<? end ?>
	<TD style="padding-right:0px;text-align:left;border-bottom:1px solid #ccc">
<IMG SRC='/static/tango/16x16/actions/list-add.png' width='16' height='16' title="Add item below this record">
<IMG SRC='/static/tango/16x16/actions/list-remove.png' width='16' height='16' title="Remove this record">
<IMG SRC='/static/tango/16x16/actions/document-properties.png' width='16' height='16' title="Edit this record">
</TD>
	</TR>
<?
end
?>
</TABLE>
</DL>

<h3>Default policy</h3>
<? local myform = "policy" ?>
<DL>
<TABLE>
<TR>
	<TD style="padding:0px;margin:0px;" class="header" WIDTH="17"><IMG SRC='/static/tango/16x16/actions/go-down.png' width='16' height='16' alt></TD>
<? for i=1,#descr[myform]['labels'] do ?>
	<TD style="padding-right:10px;text-align:left;" class="header" WIDTH="<? io.write(descr[myform]['width'][i] or "*") ?>"><? io.write(descr[myform]['labels'][i] or "") ?></TD>
<? end ?>
	<TD class="header" WIDTH="60"><IMG SRC='/static/tango/16x16/actions/list-add.png' width='16' height='16' title="Add item below this record"></TD>
</TR>

<?
for i=1, #form.config[myform]['option'] do
?>

<TR>
	<TD><IMG SRC='/static/tango/16x16/actions/go-<? if i == #form.config[myform]['option'] then io.write("bottom") else io.write("down") end ?>.png' width='16' height='16' alt></TD>
	<? for ii=1,#descr[myform]['labels'] do ?>
		<TD style="padding-right:10px;text-align:left;border-bottom:1px solid #ccc"><? io.write(form.config[myform]['option'][i][ii] or "") ?></TD>
	<? end ?>
	<TD style="padding-right:0px;text-align:left;border-bottom:1px solid #ccc">
<IMG SRC='/static/tango/16x16/actions/list-add.png' width='16' height='16' title="Add item below this record">
<IMG SRC='/static/tango/16x16/actions/list-remove.png' width='16' height='16' title="Remove this record">
<IMG SRC='/static/tango/16x16/actions/document-properties.png' width='16' height='16' title="Edit this record">
</TD>
	</TR>
<?
end
?>
</TABLE>
</DL>

<h3>Rules</h3>
<? local myform = "rules"
local val = {1,2,3,4,5,6,7,8,10,}
?>
<DL>
<TABLE>
<TR>
	<TD style="padding:0px;margin:0px;" class="header" WIDTH="17"><IMG SRC='/static/tango/16x16/actions/go-down.png' width='16' height='16' alt></TD>
<? for k,i in pairs(val) do ?>
	<TD style="padding-right:10px;text-align:left;" class="header" WIDTH="<? io.write(descr[myform]['width'][i] or "*") ?>"><? io.write(descr[myform]['labels'][i] or "") ?></TD>
<? end ?>
	<TD class="header" WIDTH="60"><IMG SRC='/static/tango/16x16/actions/list-add.png' width='16' height='16' title="Add item below this record"></TD>
</TR>

<?
for i=1, #form.config[myform]['option'] do
?>

<TR>
	<TD><IMG SRC='/static/tango/16x16/actions/go-<? if i == #form.config[myform]['option'] then io.write("bottom") else io.write("down") end ?>.png' width='16' height='16' alt></TD>
	<? for ii,vv in pairs(val) do ?>
		<TD style="padding-right:10px;text-align:left;border-bottom:1px solid #ccc"><? io.write(form.config[myform]['option'][i][ii] or "") ?></TD>
	<? end ?>
	<TD style="padding-right:0px;text-align:left;border-bottom:1px solid #ccc">
<IMG SRC='/static/tango/16x16/actions/list-add.png' width='16' height='16' title="Add item below this record">
<IMG SRC='/static/tango/16x16/actions/list-remove.png' width='16' height='16' title="Remove this record">
<IMG SRC='/static/tango/16x16/actions/document-properties.png' width='16' height='16' title="Edit this record">
</TD>
	</TR>
<?
end
?>
</TABLE>
</DL>


</form>

<form name="cmd" action="<?= form.option.link ?>/<?= form.option.action ?>" method="POST">
<H1>MANAGEMENT</H1>
<dl>
<? 
local myform = form.config
local tags = { "check_cmd",}
displayinfo(myform,tags)
?>
</dl>
</form>