5 require './itsecur-lib.pl';
7 &header($text{'nat_title'}, "",
8 undef, undef, undef, undef, &apply_button());
11 print "<form action=save_nat.cgi>\n";
12 print "<table border>\n";
13 print "<tr $tb> <td><b>$text{'nat_header'}</b></td> </tr>\n";
14 print "<tr $cb> <td><table>\n";
16 ($iface, @nets) = &get_nat();
17 @maps = grep { ref($_) } @nets;
18 @nets = grep { !ref($_) } @nets;
19 print "<tr> <td valign=top><b>$text{'nat_desc'}</b></td> <td colspan=3>\n";
20 printf "<input type=radio name=nat value=0 %s> %s<br>\n",
21 $iface ? "" : "checked", $text{'nat_disabled'};
22 printf "<input type=radio name=nat value=1 %s> %s\n",
23 $iface ? "checked" : "", $text{'nat_enabled'};
24 print &iface_input("iface", $iface);
25 print "</td> </tr>\n";
27 print "<tr> <td valign=top><b>$text{'nat_nets'}</b></td>\n";
28 print "<td valign=top><table>\n";
30 foreach $n ((grep { $_ !~ /^\!/ } @nets), undef, undef, undef) {
31 print "<tr> <td>",&group_input("net_$i", $n, 1),"</td> </tr>\n";
34 print "</table></td>\n";
36 print "<td valign=top><b>$text{'nat_excl'}</b></td>\n";
37 print "<td valign=top><table>\n";
39 foreach $n ((grep { $_ =~ /^\!/ } @nets), undef, undef, undef) {
40 print "<tr> <td>",&group_input("excl_$i", $n =~ /^\!(.*)/ ? $1 : undef, 1),"</td> </tr>\n";
43 print "</table></td> </tr>\n";
45 print "<tr> <td valign=top><b>$text{'nat_maps'}</b>",
46 "<br>$text{'nat_mapsdesc'}</td> <td colspan=3>\n";
48 print "<tr> <td><b>$text{'nat_ext'}</b></td> ",
49 "<td><b>$text{'nat_int'}</b></td> ",
50 "<td><b>$text{'nat_virt'}</b></td> </tr>\n";
52 foreach $m (@maps, [ ], [ ], [ ]) {
54 #printf "<td><input name=ext_%d size=20 value='%s'></td>\n",
56 #printf "<td><input name=int_%d size=20 value='%s'></td>\n",
58 #print "<td>",&iface_input("virt_$i", $m->[2], 1, 1, 1),"</td>\n";
61 printf "<td><input name=ext_%d size=20 value='%s'></td>\n",
63 print "<td>",&group_input("int_$i", $m->[1], 1),"</td>\n";
64 print "<td>",&iface_input("virt_$i", $m->[2], 1, 1, 1),"</td>\n";
68 print "</table></td> </tr>\n";
70 print "</table></td></tr></table>\n";
71 print "<input type=submit value='$text{'save'}'></form>\n";
72 &can_edit_disable("nat");
75 &footer("", $text{'index_return'});