From cbf34e9b8bfa217ba77fe44730cfd1cf73198876 Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Sat, 23 Dec 2006 19:17:50 +0000 Subject: [PATCH] Backout penalty box option. Step 3 is supposed to be VOIP, and Seth forgot to rename all of the step ids in the .inc file leading to utter badness. --- .../www/wizards/traffic_shaper_wizard.inc | 110 +----- .../www/wizards/traffic_shaper_wizard.xml | 319 ++++++++---------- 2 files changed, 141 insertions(+), 288 deletions(-) diff --git a/usr/local/www/wizards/traffic_shaper_wizard.inc b/usr/local/www/wizards/traffic_shaper_wizard.inc index 77b120d210..ac19b5fd83 100644 --- a/usr/local/www/wizards/traffic_shaper_wizard.inc +++ b/usr/local/www/wizards/traffic_shaper_wizard.inc @@ -322,100 +322,6 @@ function step3_stepsubmitphpaction() { } } function step4_stepsubmitphpaction() { - global $g, $config; - if(!is_numeric($_POST['bandwidthup']) or !is_numeric($_POST['bandwidthdown'])) { - $message="Upload and download speeds must be a number only! Values should be Kbits/second."; - header("Location: /wizard.php?xml=traffic_shaper_wizard.xml&stepid=4&message={$message}"); - exit; - } - if($_POST['address']) { - if(!is_ipaddr($_POST['address'])) { - if(!is_alias($_POST['address'])) { - /* item is not an ip or alias. error out */ - $message=gettext("Address must be a valid IP address or Firewall Alias. Please correct this value to continue."); - header("Location: /wizard.php?xml=traffic_shaper_wizard.xml&stepid=4&message={$message}"); - exit; - } - } - } - - if ( $_POST['enable'] ) { - $downq = "q" . convert_friendly_interface_to_friendly_descr($config['ezshaper']['step2']['inside_int']); - $upq = "q" . convert_friendly_interface_to_friendly_descr($config['ezshaper']['step2']['outside_int']); - $downint = strtolower($config['ezshaper']['step2']['inside_int']); - $upint = strtolower($config['ezshaper']['step2']['outside_int']); - - /* create qPenaltyUp queue */ - $queue = array(); - $queue['name'] = "qPenaltyUp"; - $queue['attachtoqueue'] = "{$upq}Root"; - $queue['associatedrule'] = 0; - $queue['priority'] = 2; - $queue['red'] = "on"; - $queue['ecn'] = "on"; - if ($config['shaper']['schedulertype'] == "hfsc") { - $queue['upperlimit'] = "on"; - $queue['upperlimit3'] = $_POST['bandwidthup'] . "Kb"; - $queue['bandwidth'] = 1; - $queue['bandwidthtype'] = '%'; - $queue['qlimit'] = 500; - } elseif ($config['shaper']['schedulertype'] == "cbq") { - $queue['borrow'] = "off"; - $queue['bandwidth'] = $_POST['bandwidthup']; - $queue['bandwidthtype'] = 'Kb'; - } - $config['shaper']['queue'][] = $queue; - - /* create qPenaltyDown queue */ - $queue = array(); - $queue['name'] = "qPenaltyDown"; - $queue['attachtoqueue'] = "{$downq}Root"; - $queue['associatedrule'] = 0; - $queue['priority'] = 2; - $queue['red'] = "on"; - $queue['ecn'] = "on"; - if ($config['shaper']['schedulertype'] == "hfsc") { - $queue['upperlimit'] = "on"; - $queue['upperlimit3'] = $_POST['bandwidthdown'] . "Kb"; - $queue['bandwidth'] = 1; - $queue['bandwidthtype'] = '%'; - $queue['qlimit'] = 500; - } elseif ($config['shaper']['schedulertype'] == "cbq") { - $queue['borrow'] = "off"; - $queue['bandwidth'] = $_POST['bandwidthdown']; - $queue['bandwidthtype'] = 'Kb'; - } - $config['shaper']['queue'][] = $queue; - - $config['shaper']['itemsshaped']++; - - /* If user specifies an IP, we don't bother with providers */ - if( is_ipaddr($_POST['address']) or is_alias($_POST['address'])) { - /* create Penalty rules */ - $rule = array(); - $rule['descr'] = gettext("Penalty IP"); - $rule['inqueue'] = "qPenaltyDown"; - $rule['outqueue'] = "qPenaltyUp"; - $rule['in-interface'] = $downint; - $rule['out-interface'] = $upint; - /* $rule['source']['network'] = $downint; */ - $rule['source']['address'] = $_POST['address']; - $rule['destination']['any'] = TRUE; - $config['shaper']['rule'][] = $rule; - - $rule = array(); - $rule['descr'] = gettext("Penalty IP"); - $rule['inqueue'] = "qPenaltyUp"; - $rule['outqueue'] = "qPenaltyDown"; - $rule['in-interface'] = $upint; - $rule['out-interface'] = $downint; - $rule['source']['any'] = TRUE; - $rule['destination']['address'] = $_POST['address']; - $config['shaper']['rule'][] = $rule; - } - } -} -function step5_stepsubmitphpaction() { global $g, $config; /* XXX - billm - needs to actually honor what the user selects still */ if ( $_POST['enable'] ) { @@ -554,7 +460,7 @@ function step5_stepsubmitphpaction() { $config['shaper']['queue'][] = $queue; } } -function step6_stepsubmitphpaction() { +function step5_stepsubmitphpaction() { global $g, $config; /* XXX - billm - needs to actually honor what the user selects still */ if ( $_POST['enable'] ) { @@ -787,7 +693,7 @@ function step6_stepsubmitphpaction() { } } } -function step7_stepsubmitphpaction() { +function step6_stepsubmitphpaction() { global $g, $config; if ( $_POST['enable'] ) { $downq = "q" . convert_friendly_interface_to_friendly_descr($config['ezshaper']['step2']['inside_int']); @@ -1088,7 +994,7 @@ function step7_stepsubmitphpaction() { } } } -function step8_stepbeforeformdisplay() { +function step7_stepbeforeformdisplay() { global $g, $config; if($config['shaper']['itemsshaped'] == "0") { /* no shaper items have been selected @@ -1100,12 +1006,12 @@ function step8_stepbeforeformdisplay() { $config['shaper']['enable'] = FALSE; $message = "No items have been selected to shape. Exiting traffic shaper wizard."; write_config("No shaper items picked, unsetting shaper configuration"); - header("Location: /wizard.php?xml=traffic_shaper_wizard.xml&stepid=8&message={$message}"); + header("Location: /wizard.php?xml=traffic_shaper_wizard.xml&stepid=7&message={$message}"); exit; } } -function step8_stepsubmitphpaction() { +function step7_stepsubmitphpaction() { global $g, $config, $d_shaperconfdirty_path; /* Sort rules by queue priority */ sort_rule_by_queue_priority(); @@ -1116,7 +1022,7 @@ function step8_stepsubmitphpaction() { $upint = strtolower($config['ezshaper']['step2']['outside_int']); /* install default p2p catch all rule if user has enabled option (MUST BE LAST!) */ - if($config['ezshaper']['step5']['p2pcatchall'] == "on") { + if($config['ezshaper']['step4']['p2pcatchall'] == "on") { $othersplist = array(); $othersplist[] = array('p2pCatchAll', 'tcp', '', '', 'both', ''); $othersplist[] = array('p2pCatchAll2', 'udp', '', '', 'both', ''); @@ -1182,10 +1088,10 @@ function step8_stepsubmitphpaction() { /* Head over and check out the groovy queue stats */ header("Location: status_filter_reload.php"); } -function step9_stepsubmitphpaction() { +function step8_stepsubmitphpaction() { global $g, $config; header("Location: status_filter_reload.php"); } -?> +?> \ No newline at end of file diff --git a/usr/local/www/wizards/traffic_shaper_wizard.xml b/usr/local/www/wizards/traffic_shaper_wizard.xml index 623e838f90..dd0cdfe622 100644 --- a/usr/local/www/wizards/traffic_shaper_wizard.xml +++ b/usr/local/www/wizards/traffic_shaper_wizard.xml @@ -31,7 +31,7 @@ POSSIBILITY OF SUCH DAMAGE. */ -9 +8 1 pfSense Traffic Shaper Wizard @@ -264,59 +264,6 @@ 4 pfSense Traffic Shaper Wizard - Penalty Box - - - Enable - checkbox - Penalize IP or Alias - This will lower the priority of traffic from this IP or alias. - ezshaper->step4->enable - - - Next - submit - - - PenaltyBox specific settings - listtopic - - - Address - inputalias - This allows you to just provide the IP address of the computer(s) or Penalize. NOTE: You can also use a Firewall Alias in this location. - ezshaper->step4->address - IP Address field is non-blank and doesn't look like an IP address. - - - BandwidthUp - The upload limit in Kbits/second. - input - ^[0-9]*$ - Upload speed must be numerical - ezshaper->step4->bandwidthup - - - BandwidthDown - The download limit Kbits/second. - input - ^[0-9]*$ - Download speed must be numerical - ezshaper->step4->bandwidthdown - - - Next - submit - - - - step4_stepsubmitphpaction(); - - /usr/local/www/wizards/traffic_shaper_wizard.inc - - - 5 - pfSense Traffic Shaper Wizard Peer to Peer networking true @@ -327,7 +274,7 @@ Lower priority of Peer-to-Peer traffic This will lower the priority of P2P traffic below all other traffic. Please check the items that you would like to prioritize lower than normal traffic. p2pCatchAll,Aimster,BitTorrent,BuddyShare,CuteMX,DCplusplus,dcc,DirectConnect,DirectFileExpress,EDonkey2000,FastTrack,Gnutella,grouper,hotComm,HotlineConnect,iMesh,Napster,OpenNap,Scour,Shareaza,SongSpy,WinMX - ezshaper->step5->enable + ezshaper->step4->enable Next @@ -341,7 +288,7 @@ p2pCatchAll checkbox When enabled, all uncategorized traffic is fed to the p2p queue. - ezshaper->step5->p2pcatchall + ezshaper->step4->p2pcatchall Enable/Disable specific P2P protocols @@ -351,127 +298,127 @@ Aimster checkbox Aimster and other P2P using the Aimster protocol and ports - ezshaper->step5->aimster + ezshaper->step4->aimster BitTorrent checkbox Bittorrent and other P2P using the Torrent protocol and ports - ezshaper->step5->bittorrent + ezshaper->step4->bittorrent BuddyShare checkbox BuddyShare and other P2P using the BuddyShare protocol and ports - ezshaper->step5->buddyshare + ezshaper->step4->buddyshare CuteMX checkbox CuteMX and other P2P using the CuteMX protocol and ports - ezshaper->step5->cutemx + ezshaper->step4->cutemx DCplusplus checkbox DC++ and other P2P using the DC++ protocol and ports - ezshaper->step5->dcplusplus + ezshaper->step4->dcplusplus DCC checkbox irc DCC file transfers - ezshaper->step5->dcc + ezshaper->step4->dcc DirectConnect checkbox DirectConnect and other P2P using the DirectConnect protocol and ports - ezshaper->step5->directconnect + ezshaper->step4->directconnect DirectFileExpress checkbox DirectFileExpress and other P2P using the DirectFileExpress protocol and ports - ezshaper->step5->directfileexpress + ezshaper->step4->directfileexpress eDonkey2000 checkbox eDonkey and other P2P using the eDonkey protocol and ports - ezshaper->step5->edonkey2000 + ezshaper->step4->edonkey2000 FastTrack checkbox FastTrack and other P2P using the FastTrack protocol and ports - ezshaper->step5->fasttrack + ezshaper->step4->fasttrack Gnutella checkbox Gnutella and other P2P using the Gnutella protocol and ports - ezshaper->step5->gnutella + ezshaper->step4->gnutella grouper checkbox grouper and other P2P using the grouper protocol and ports - ezshaper->step5->grouper + ezshaper->step4->grouper hotComm checkbox hotComm and other P2P using the hotComm protocol and ports - ezshaper->step5->hotcomm + ezshaper->step4->hotcomm HotlineConnect checkbox HotlineConnect and other P2P using the HotlineConnect protocol and ports - ezshaper->step5->hotlineconnect + ezshaper->step4->hotlineconnect iMesh checkbox iMesh and other P2P using the iMesh protocol and ports - ezshaper->step5->imesh + ezshaper->step4->imesh Napster checkbox Napster and other P2P using the Napster protocol and ports - ezshaper->step5->napster + ezshaper->step4->napster OpenNap checkbox OpenNap and other P2P using the OpenNap protocol and ports - ezshaper->step5->opennap + ezshaper->step4->opennap Scour checkbox Scour and other P2P using the Scour protocol and ports - ezshaper->step5->scour + ezshaper->step4->scour Shareaza checkbox Shareaza and other P2P using the Shareaza protocol and ports - ezshaper->step5->shareaza + ezshaper->step4->shareaza SongSpy checkbox SongSpy and other P2P using the SongSpy protocol and ports - ezshaper->step5->songspy + ezshaper->step4->songspy WinMX checkbox WinMX and other P2P using the WinMX protocol and ports - ezshaper->step5->winmx + ezshaper->step4->winmx Next @@ -479,12 +426,12 @@ - step5_stepsubmitphpaction(); + step4_stepsubmitphpaction(); /usr/local/www/wizards/traffic_shaper_wizard.inc - 6 + 5 pfSense Traffic Shaper Wizard true Network Games @@ -496,7 +443,7 @@ This will raise the priority of gaming traffic to higher than most traffic. BattleNET,Battlefield2,CallOfDuty,Counterstrike,DeltaForce,DOOM3,EmpireEarth,Everquest,Everquest2,FarCry,GunZOnline,HalfLife,HalfLife2,Halo2,Lineage2,PlanetSide,QuakeIII,TigerWoods2004PS2,UnrealTournament,WolfensteinEnemyTerritory,WorldOfWarcraft true - ezshaper->step6->enable + ezshaper->step5->enable Next @@ -510,127 +457,127 @@ BattleNET checkbox Battle.net - Virtually every game from Blizzard publishing should match this. This includes the following game series: Starcraft, Diablo, Warcraft. Guild Wars also uses this port. - ezshaper->step6->battlenet + ezshaper->step5->battlenet Battlefield2 checkbox Battlefield 2 - this game uses a LARGE port range, be aware that you may need to manually rearrange the resulting rules to correctly prioritize other traffic. - ezshaper->step6->battlefield2 + ezshaper->step5->battlefield2 CallOfDuty checkbox Call Of Duty (United Offensive) - ezshaper->step6->callofduty + ezshaper->step5->callofduty Counterstrike checkbox Counterstrike. The ultimate 1st person shooter. - ezshaper->step6->counterstrike + ezshaper->step5->counterstrike DeltaForce checkbox Delta Force - ezshaper->step6->deltaforce + ezshaper->step5->deltaforce DOOM3 checkbox DOOM3 - ezshaper->step6->doom3 + ezshaper->step5->doom3 EmpireEarth checkbox Empire Earth - ezshaper->step6->empireearth + ezshaper->step5->empireearth Everquest checkbox Everquest - this game uses a LARGE port range, be aware that you may need to manually rearrange the resulting rules to correctly prioritize other traffic. - ezshaper->step6->everquest + ezshaper->step5->everquest Everquest2 checkbox Everquest II - ezshaper->step6->everquest2 + ezshaper->step5->everquest2 GunZOnline checkbox GunZ Online - ezshaper->step6->gunzonline + ezshaper->step5->gunzonline FarCry checkbox Far Cry - ezshaper->step6->farcry + ezshaper->step5->farcry HalfLife checkbox HalfLife - ezshaper->step6->halflife + ezshaper->step5->halflife HalfLife2 checkbox HalfLife 2 - ezshaper->step6->halflife2 + ezshaper->step5->halflife2 Halo2 checkbox Halo2 via Xbox live - ezshaper->step6->halo2xbox + ezshaper->step5->halo2xbox Lineage2 checkbox Lineage II - ezshaper->step6->lineage2 + ezshaper->step5->lineage2 PlanetSide checkbox PlanetSide - ezshaper->step6->planetside + ezshaper->step5->planetside QuakeIII checkbox Quake III - ezshaper->step6->quakeiii + ezshaper->step5->quakeiii TigerWoods2004PS2 checkbox Tiger Woods 2004 for PS2 - ezshaper->step6->tigerwoods2004ps2 + ezshaper->step5->tigerwoods2004ps2 UnrealTournament checkbox Unreal Tournament - ezshaper->step6->unrealtournament + ezshaper->step5->unrealtournament WolfensteinEnemyTerritory checkbox Wolfenstein Enemy Territory - ezshaper->step6->wolfet + ezshaper->step5->wolfet WorldOfWarcraft checkbox World of Warcraft - ezshaper->step6->wow + ezshaper->step5->wow Next @@ -638,12 +585,12 @@ - step6_stepsubmitphpaction(); + step5_stepsubmitphpaction(); /usr/local/www/wizards/traffic_shaper_wizard.inc - 7 + 6 pfSense Traffic Shaper Wizard true Raise or lower other Applications @@ -655,7 +602,7 @@ This will help raise or lower the priority of other protocols higher than most traffic. AIM,AppleRemoteDesktop,DNS,HTTP,ICMP,ICQ,IMAP,IPSEC,IRC,Jabber,LotusNotes,MSN,MSRDP,MySqlServer,PCAnywhere,POP3,PPTP,RTSP,SMB,SMTP,SNMP,StreamingMP3,TeamSpeak,VNC,NNTP,CVSUP true - ezshaper->step7->enable + ezshaper->step6->enable Next @@ -668,7 +615,7 @@ MSRDP select - ezshaper->step7->msrdp + ezshaper->step6->msrdp VNC - ezshaper->step7->vnc + ezshaper->step6->vnc select AppleRemoteDesktop - ezshaper->step7->appleremotedesktop + ezshaper->step6->appleremotedesktop select PCAnywhere - ezshaper->step7->pcanywhere + ezshaper->step6->pcanywhere select - 8 + 7 pfSense Traffic Shaper Wizard Reload profile notice @@ -1239,15 +1186,15 @@ - step8_stepbeforeformdisplay(); + step7_stepbeforeformdisplay(); - step8_stepsubmitphpaction(); + step7_stepsubmitphpaction(); /usr/local/www/wizards/traffic_shaper_wizard.inc - 9 + 8 pfSense Traffic Shaper Wizard @@ -1257,7 +1204,7 @@ /usr/local/www/wizards/traffic_shaper_wizard.inc - step9_stepsubmitphpaction(); + step8_stepsubmitphpaction();