⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 save_nat.cgi

📁 linux环境下的一个防火墙程序的源代码
💻 CGI
字号:
#!/usr/bin/perl#======================================================================# Turtle Firewall webmin module## Copyright (c) Andrea Frigido# You may distribute under the terms of either the GNU General Public# License#======================================================================do 'lib.pl';my $idx = $in{'idx'};my $virtual = $in{'virtual'};my $real = $in{'real'};my ($service, $port) = formServiceParse( $in{'servicetype'}, $in{'service2'}, $in{'service3'}, $in{'port'} );my $active = $in{'active'};# Cut interface$virtual =~ s/ \(.*\)$//;if( $in{'delete'} ) {	# delete NAT	$whatfailed = $text{save_nat_error_title1};	$fw->DeleteNat( $idx );} else {	$whatfailed = $in{'new'} ? $text{save_nat_error_title2} : $text{save_nat_error_title3};	if( $real eq '' ) {		error( $text{save_nat_error1} );	}	if( $in{'new'} ) {		$fw->AddNat( 0, $virtual, $real, $service, $port, $active );	} else {		$fw->AddNat( $idx, $virtual, $real, $service, $port, $active );	}}$fw->SaveFirewall();redirect( 'list_nat.cgi' );

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -