diff --git a/usr/local/www/wizards/traffic_shaper_wizard.inc b/usr/local/www/wizards/traffic_shaper_wizard.inc
index 3dbde5567a..77b120d210 100644
--- a/usr/local/www/wizards/traffic_shaper_wizard.inc
+++ b/usr/local/www/wizards/traffic_shaper_wizard.inc
@@ -322,6 +322,100 @@ 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'] ) {
@@ -460,7 +554,7 @@ function step4_stepsubmitphpaction() {
$config['shaper']['queue'][] = $queue;
}
}
-function step5_stepsubmitphpaction() {
+function step6_stepsubmitphpaction() {
global $g, $config;
/* XXX - billm - needs to actually honor what the user selects still */
if ( $_POST['enable'] ) {
@@ -693,7 +787,7 @@ function step5_stepsubmitphpaction() {
}
}
}
-function step6_stepsubmitphpaction() {
+function step7_stepsubmitphpaction() {
global $g, $config;
if ( $_POST['enable'] ) {
$downq = "q" . convert_friendly_interface_to_friendly_descr($config['ezshaper']['step2']['inside_int']);
@@ -994,7 +1088,7 @@ function step6_stepsubmitphpaction() {
}
}
}
-function step7_stepbeforeformdisplay() {
+function step8_stepbeforeformdisplay() {
global $g, $config;
if($config['shaper']['itemsshaped'] == "0") {
/* no shaper items have been selected
@@ -1006,12 +1100,12 @@ function step7_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=7&message={$message}");
+ header("Location: /wizard.php?xml=traffic_shaper_wizard.xml&stepid=8&message={$message}");
exit;
}
}
-function step7_stepsubmitphpaction() {
+function step8_stepsubmitphpaction() {
global $g, $config, $d_shaperconfdirty_path;
/* Sort rules by queue priority */
sort_rule_by_queue_priority();
@@ -1022,7 +1116,7 @@ function step7_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']['step4']['p2pcatchall'] == "on") {
+ if($config['ezshaper']['step5']['p2pcatchall'] == "on") {
$othersplist = array();
$othersplist[] = array('p2pCatchAll', 'tcp', '', '', 'both', '');
$othersplist[] = array('p2pCatchAll2', 'udp', '', '', 'both', '');
@@ -1088,7 +1182,7 @@ function step7_stepsubmitphpaction() {
/* Head over and check out the groovy queue stats */
header("Location: status_filter_reload.php");
}
-function step8_stepsubmitphpaction() {
+function step9_stepsubmitphpaction() {
global $g, $config;
header("Location: status_filter_reload.php");
}
diff --git a/usr/local/www/wizards/traffic_shaper_wizard.xml b/usr/local/www/wizards/traffic_shaper_wizard.xml
index dd0cdfe622..623e838f90 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.
*/
-8
+91pfSense Traffic Shaper Wizard
@@ -264,6 +264,59 @@
4pfSense 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 WizardPeer to Peer networkingtrue
@@ -274,7 +327,7 @@
Lower priority of Peer-to-Peer trafficThis 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->step4->enable
+ ezshaper->step5->enableNext
@@ -288,7 +341,7 @@
p2pCatchAllcheckboxWhen enabled, all uncategorized traffic is fed to the p2p queue.
- ezshaper->step4->p2pcatchall
+ ezshaper->step5->p2pcatchallEnable/Disable specific P2P protocols
@@ -298,127 +351,127 @@
AimstercheckboxAimster and other P2P using the Aimster protocol and ports
- ezshaper->step4->aimster
+ ezshaper->step5->aimsterBitTorrentcheckboxBittorrent and other P2P using the Torrent protocol and ports
- ezshaper->step4->bittorrent
+ ezshaper->step5->bittorrentBuddySharecheckboxBuddyShare and other P2P using the BuddyShare protocol and ports
- ezshaper->step4->buddyshare
+ ezshaper->step5->buddyshareCuteMXcheckboxCuteMX and other P2P using the CuteMX protocol and ports
- ezshaper->step4->cutemx
+ ezshaper->step5->cutemxDCpluspluscheckboxDC++ and other P2P using the DC++ protocol and ports
- ezshaper->step4->dcplusplus
+ ezshaper->step5->dcplusplusDCCcheckboxirc DCC file transfers
- ezshaper->step4->dcc
+ ezshaper->step5->dccDirectConnectcheckboxDirectConnect and other P2P using the DirectConnect protocol and ports
- ezshaper->step4->directconnect
+ ezshaper->step5->directconnectDirectFileExpresscheckboxDirectFileExpress and other P2P using the DirectFileExpress protocol and ports
- ezshaper->step4->directfileexpress
+ ezshaper->step5->directfileexpresseDonkey2000checkboxeDonkey and other P2P using the eDonkey protocol and ports
- ezshaper->step4->edonkey2000
+ ezshaper->step5->edonkey2000FastTrackcheckboxFastTrack and other P2P using the FastTrack protocol and ports
- ezshaper->step4->fasttrack
+ ezshaper->step5->fasttrackGnutellacheckboxGnutella and other P2P using the Gnutella protocol and ports
- ezshaper->step4->gnutella
+ ezshaper->step5->gnutellagroupercheckboxgrouper and other P2P using the grouper protocol and ports
- ezshaper->step4->grouper
+ ezshaper->step5->grouperhotCommcheckboxhotComm and other P2P using the hotComm protocol and ports
- ezshaper->step4->hotcomm
+ ezshaper->step5->hotcommHotlineConnectcheckboxHotlineConnect and other P2P using the HotlineConnect protocol and ports
- ezshaper->step4->hotlineconnect
+ ezshaper->step5->hotlineconnectiMeshcheckboxiMesh and other P2P using the iMesh protocol and ports
- ezshaper->step4->imesh
+ ezshaper->step5->imeshNapstercheckboxNapster and other P2P using the Napster protocol and ports
- ezshaper->step4->napster
+ ezshaper->step5->napsterOpenNapcheckboxOpenNap and other P2P using the OpenNap protocol and ports
- ezshaper->step4->opennap
+ ezshaper->step5->opennapScourcheckboxScour and other P2P using the Scour protocol and ports
- ezshaper->step4->scour
+ ezshaper->step5->scourShareazacheckboxShareaza and other P2P using the Shareaza protocol and ports
- ezshaper->step4->shareaza
+ ezshaper->step5->shareazaSongSpycheckboxSongSpy and other P2P using the SongSpy protocol and ports
- ezshaper->step4->songspy
+ ezshaper->step5->songspyWinMXcheckboxWinMX and other P2P using the WinMX protocol and ports
- ezshaper->step4->winmx
+ ezshaper->step5->winmxNext
@@ -426,12 +479,12 @@
- step4_stepsubmitphpaction();
+ step5_stepsubmitphpaction();
/usr/local/www/wizards/traffic_shaper_wizard.inc
- 5
+ 6pfSense Traffic Shaper WizardtrueNetwork Games
@@ -443,7 +496,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,WorldOfWarcrafttrue
- ezshaper->step5->enable
+ ezshaper->step6->enableNext
@@ -457,127 +510,127 @@
BattleNETcheckboxBattle.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->step5->battlenet
+ ezshaper->step6->battlenetBattlefield2checkboxBattlefield 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->step5->battlefield2
+ ezshaper->step6->battlefield2CallOfDutycheckboxCall Of Duty (United Offensive)
- ezshaper->step5->callofduty
+ ezshaper->step6->callofdutyCounterstrikecheckboxCounterstrike. The ultimate 1st person shooter.
- ezshaper->step5->counterstrike
+ ezshaper->step6->counterstrikeDeltaForcecheckboxDelta Force
- ezshaper->step5->deltaforce
+ ezshaper->step6->deltaforceDOOM3checkboxDOOM3
- ezshaper->step5->doom3
+ ezshaper->step6->doom3EmpireEarthcheckboxEmpire Earth
- ezshaper->step5->empireearth
+ ezshaper->step6->empireearthEverquestcheckboxEverquest - 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->step5->everquest
+ ezshaper->step6->everquestEverquest2checkboxEverquest II
- ezshaper->step5->everquest2
+ ezshaper->step6->everquest2GunZOnlinecheckboxGunZ Online
- ezshaper->step5->gunzonline
+ ezshaper->step6->gunzonlineFarCrycheckboxFar Cry
- ezshaper->step5->farcry
+ ezshaper->step6->farcryHalfLifecheckboxHalfLife
- ezshaper->step5->halflife
+ ezshaper->step6->halflifeHalfLife2checkboxHalfLife 2
- ezshaper->step5->halflife2
+ ezshaper->step6->halflife2Halo2checkboxHalo2 via Xbox live
- ezshaper->step5->halo2xbox
+ ezshaper->step6->halo2xboxLineage2checkboxLineage II
- ezshaper->step5->lineage2
+ ezshaper->step6->lineage2PlanetSidecheckboxPlanetSide
- ezshaper->step5->planetside
+ ezshaper->step6->planetsideQuakeIIIcheckboxQuake III
- ezshaper->step5->quakeiii
+ ezshaper->step6->quakeiiiTigerWoods2004PS2checkboxTiger Woods 2004 for PS2
- ezshaper->step5->tigerwoods2004ps2
+ ezshaper->step6->tigerwoods2004ps2UnrealTournamentcheckboxUnreal Tournament
- ezshaper->step5->unrealtournament
+ ezshaper->step6->unrealtournamentWolfensteinEnemyTerritorycheckboxWolfenstein Enemy Territory
- ezshaper->step5->wolfet
+ ezshaper->step6->wolfetWorldOfWarcraftcheckboxWorld of Warcraft
- ezshaper->step5->wow
+ ezshaper->step6->wowNext
@@ -585,12 +638,12 @@
- step5_stepsubmitphpaction();
+ step6_stepsubmitphpaction();
/usr/local/www/wizards/traffic_shaper_wizard.inc
- 6
+ 7pfSense Traffic Shaper WizardtrueRaise or lower other Applications
@@ -602,7 +655,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,CVSUPtrue
- ezshaper->step6->enable
+ ezshaper->step7->enableNext
@@ -615,7 +668,7 @@
MSRDPselect
- ezshaper->step6->msrdp
+ ezshaper->step7->msrdpVNC
- ezshaper->step6->vnc
+ ezshaper->step7->vncselectAppleRemoteDesktop
- ezshaper->step6->appleremotedesktop
+ ezshaper->step7->appleremotedesktopselectPCAnywhere
- ezshaper->step6->pcanywhere
+ ezshaper->step7->pcanywhereselect
- 7
+ 8pfSense Traffic Shaper WizardReload profile notice
@@ -1186,15 +1239,15 @@
- step7_stepbeforeformdisplay();
+ step8_stepbeforeformdisplay();
- step7_stepsubmitphpaction();
+ step8_stepsubmitphpaction();
/usr/local/www/wizards/traffic_shaper_wizard.inc
- 8
+ 9pfSense Traffic Shaper Wizard
@@ -1204,7 +1257,7 @@
/usr/local/www/wizards/traffic_shaper_wizard.inc
- step8_stepsubmitphpaction();
+ step9_stepsubmitphpaction();