From 38c9e4ba3f9fc38841cdb5441cb35a6eeee557cf Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Fri, 6 Oct 2006 20:06:50 +0000 Subject: [PATCH] remove the crappy firewall page - no time to get it fixed before rc6 SVN-Revision: 4937 --- .../webif/files/www/cgi-bin/webif/firewall.sh | 352 ------------------ 1 file changed, 352 deletions(-) delete mode 100755 openwrt/package/webif/files/www/cgi-bin/webif/firewall.sh diff --git a/openwrt/package/webif/files/www/cgi-bin/webif/firewall.sh b/openwrt/package/webif/files/www/cgi-bin/webif/firewall.sh deleted file mode 100755 index 7ffef1578b..0000000000 --- a/openwrt/package/webif/files/www/cgi-bin/webif/firewall.sh +++ /dev/null @@ -1,352 +0,0 @@ -#!/usr/bin/webif-page -&- 2>&- -FW_FILE_NEW="/tmp/.webif/file-firewall-new" - -empty "$FORM_cancel" || { - empty "$FORM_delete_on_cancel" || { - awk \ - -f - "$FW_FILE" > "$FW_FILE_NEW" <>||$proto_valid -string|FORM_target|@TR<>|required|$FORM_target -string|FORM_proto|@TR<>||$FORM_proto -ip|FORM_src|@TR<>||$FORM_src -ip|FORM_dest|@TR<>||$FORM_dest -ports|FORM_sport|@TR<>||$FORM_sport -ports|FORM_dport|@TR<>||$FORM_dport -ip|FORM_target_ip|@TR<>||$FORM_target_ip -port|FORM_target_port|@TR<>||$FORM_target_port -EOF - equal "$?" 0 || { - unset FORM_save - } - equal "$FORM_target" "forward" && empty "$FORM_target_ip$FORM_target_port" && { - ERROR="${ERROR}@TR<>
" - FORM_save="" - } -} - -empty "$FORM_up$FORM_down$FORM_save$FORM_delete$FORM_new" || { - empty "$FORM_up" || equal "$FORM_up" 1 || { - FORM_down="$(($FORM_up - 1))" - } - awk \ - -v down="$FORM_down" \ - -v save="$FORM_save" \ - -v del="$FORM_delete" \ - -v edit="$FORM_edit" \ - -v proto="$FORM_proto" \ - -v src="$FORM_src" \ - -v sport="$FORM_sport" \ - -v dest="$FORM_dest" \ - -v dport="$FORM_dport" \ - -v layer7="$FORM_layer7" \ - -v target="$FORM_target" \ - -v target_ip="$FORM_target_ip" \ - -v target_port="$FORM_target_port" \ - -v new="$FORM_new" \ - -v new_target="$FORM_new_target" \ - -f - "$FW_FILE" > "$FW_FILE_NEW" < down) { - print line_down - line_down = "" -} - -END { - if (line_down != "") print line_down - if (new_target == "forward") new_target = new_target "::192.168.1.1" - if ((new != "") && (new_target != "")) print new_target -} -EOF - FW_FILE=/tmp/.webif/file-firewall - mv "$FW_FILE_NEW" "$FW_FILE" - empty "$FORM_new" && FORM_edit="" -} - -header "Network" "Firewall" "@TR<>" '' - -?> - ->: " _l["proto"] "
" - if (_l["src"] != "") ret = ret "@TR<>: " _l["src"] "
" - if (_l["sport"] != "") ret = ret "@TR<>: " _l["sport"] "
" - if (_l["dest"] != "") ret = ret "@TR<>: " _l["dest"] "
" - if (_l["dport"] != "") ret = ret "@TR<>: " _l["dport"] "
" -# if (_l["layer7"] != "") ret = ret "@TR<>: " _l["layer7"] "
" - if (ret == "") ret = ret "@TR<>" - return ret -} -function delbutton(name) { - return button("del_" name, "Delete") -} -function input_line(caption, name, value) { - return "@TR<<" caption ">>: " textinput(name, value) delbutton(name) "" -} -function iptstr2edit(str, edit) { - edit = "" - str2data(str); - if (int(data_submit) == 1) set_data() - if (new_match == "proto") _l["proto"] = "tcp" - if ((new_match == "src") || (new_match == "dest")) _l[new_match] = "0.0.0.0" - if ((new_match == "sport") || (new_match == "dport")) _l[new_match] = "0" - if ((new_match != "") && (_l[new_match] == "")) _l[new_match] = " " - - if (_l["proto"] != "") { - edit = edit "@TR<>: " - edit = edit "" delbutton("proto") - edit = edit "" - } - if (_l["src"] != "") edit = edit input_line("Source IP", "src", _l["src"]) - if (_l["sport"] != "") edit = edit input_line("Source Ports", "sport", _l["sport"]) - if (_l["dest"] != "") edit = edit input_line("Destination IP", "dest", _l["dest"]) - if (_l["dport"] != "") edit = edit input_line("Destination Ports", "dport", _l["dport"]) - if (_l["layer7"] != "") edit = edit input_line("Application Protocol", "layer7", _l["layer7"]) - - edit = edit " " - edit = edit button("add_match", "Add") "" - - return edit -} - -BEGIN { - print start_form("@TR<>"); - print "" - print "" - FS=":" - n = 0 -} - -(\$1 == "drop") || (\$1 == "accept") || (\$1 == "forward" ) { - n++ - print "" - if (n == edit) { - print "" - print hidden("data_submit", "1") hidden("edit", edit) - print "" - print "" - } else { - printf "" - } -} - -END { - print "" - print "" - print "
@TR<>@TR<>@TR<> 

" - print "" - print iptstr2edit(\$2) - print "" - } else { - printf "" - } -} - -(\$1 == "drop") || (\$1 == "accept") { - if (n == edit) { - if (int(data_submit) == 1) \$1 = target - printf "" - printf "" - printf "" - } else { - printf "" - } -} - -\$1 == "forward" { - if (n == edit) { - if (target_ip == "") target_ip = \$3 - if (target_port == "") target_port = \$4 - print "" - print "" - } else { - if (\$3 \$4 == "") \$3 = "forward" - printf "" - } -} - -(\$1 == "drop") || (\$1 == "accept") || (\$1 == "forward" ) { - if (n == edit) { - printf "" - print "

 
" iptstr2web(\$2) "
@TR<>:" - printf "
" \$1 "
@TR<>:" textinput("target_ip", target_ip) hidden("target", "forward") "
@TR<>:" textinput("target_port", target_port) "
" \$3 "" \$4 "
 " button("save", "Save") - if( delete_on_cancel != "" ) print hidden("delete_on_cancel", 1); - print button("cancel", "Cancel") - print "
" - print "
" - printf "@TR<>
" - printf "@TR<>" - printf "
" - printf "@TR<>
" - printf "@TR<>" - print "

@TR<>: " - print "
" - print hidden("edit", n + 1); - print hidden("delete_on_cancel", 1); - print "" button("new", "Add") "
" - print end_form("..."); -} -EOF - -footer ?> - -- 2.30.2