diff options
author | Scott Ullrich <sullrich@pfsense.org> | 2005-06-06 01:39:43 +0000 |
---|---|---|
committer | Scott Ullrich <sullrich@pfsense.org> | 2005-06-06 01:39:43 +0000 |
commit | 22b0ed55ba31be3058e425d1512831b0fdedf902 (patch) | |
tree | f597c77ecb84e3b095dea9324c02ccec33a320b6 /usr | |
parent | 907e49b8c9686e9e4e8b4fc2e953607bbcc3f0de (diff) | |
download | pfsense-22b0ed55ba31be3058e425d1512831b0fdedf902.zip pfsense-22b0ed55ba31be3058e425d1512831b0fdedf902.tar.gz |
* Add gaming in and out queues, set pri to 5
* Add counterstrike, the mother of all 1st person shooters
Diffstat (limited to 'usr')
-rw-r--r-- | usr/local/www/wizards/traffic_shaper_wizard.xml | 107 |
1 files changed, 104 insertions, 3 deletions
diff --git a/usr/local/www/wizards/traffic_shaper_wizard.xml b/usr/local/www/wizards/traffic_shaper_wizard.xml index feb6e8e..c889c07 100644 --- a/usr/local/www/wizards/traffic_shaper_wizard.xml +++ b/usr/local/www/wizards/traffic_shaper_wizard.xml @@ -585,12 +585,13 @@ $queue['bandwidthtype'] = "Kb"; $queue['attachtoqueue'] = "qLANRoot"; $config['shaper']['queue'][] = $queue; - } + } </stepsubmitphpaction> </step> <step> <id>5</id> <title>pfSense Traffic Shaper Wizard</title> + <disableallfieldsbydefault>true</disableallfieldsbydefault> <description>Network Games</description> <fields> <field> @@ -598,15 +599,115 @@ <type>checkbox</type> <typehint>Prioritize network gaming traffic</typehint> <description>This will raise the priority of gaming traffic to higher than most traffic.</description> + <enablefields>Counterstrike</enablefields> + <donotdisable>true</donotdisable> </field> <field> + <name>Enable/Disable specific P2P protocols</name> + <type>listtopic</type> + </field> + <field> + <name>Counterstrike</name> + <type>checkbox</type> + <typehint>Counterstrike. The ultimate 1st person shooter.</typehint> + </field> + <field> <name>Next</name> <type>submit</type> </field> </fields> <stepsubmitphpaction> -/* XXX create gaming queues here */ -/* XXX create gaming rules here */ + + /* create qGamesUp queue */ + $queue = array(); + $queue['name'] = "qGamesUp"; + $queue['associatedrule'] = 0; + $queue['priority'] = 5; + $queue['red'] = "on"; + $queue['ecn'] = "on"; + $queue['realtime'] = "on"; + $queue['realtime1'] = $_POST['bandwidth'] . "Kb"; + $queue['realtime2'] = "1"; + $queue['realtime3'] = $_POST['bandwidth'] . "Kb"; + $queue['upperlimit'] = "on"; + $queue['upperlimit1'] = $_POST['bandwidth'] . "Kb"; + $queue['upperlimit2'] = "1"; + $queue['upperlimit3'] = $_POST['bandwidth'] . "Kb"; + $queue['linkshare'] = "on"; + $queue['linkshare1'] = $_POST['bandwidth'] . "Kb"; + $queue['linkshare2'] = "1"; + $queue['linkshare3'] = $_POST['bandwidth'] . "Kb"; + $queue['bandwidth'] = "0"; + $queue['bandwidthtype'] = "Kb"; + $queue['attachtoqueue'] = "qWANRoot"; + $config['shaper']['queue'][] = $queue; + + /* create qGamesDown queue */ + $queue = array(); + $queue['name'] = "qGamesDown"; + $queue['associatedrule'] = 0; + $queue['priority'] = 5; + $queue['red'] = "on"; + $queue['ecn'] = "on"; + $queue['realtime'] = "on"; + $queue['realtime1'] = $_POST['bandwidth'] . "Kb"; + $queue['realtime2'] = "1"; + $queue['realtime3'] = $_POST['bandwidth'] . "Kb"; + $queue['upperlimit'] = "on"; + $queue['upperlimit1'] = $_POST['bandwidth'] . "Kb"; + $queue['upperlimit2'] = "1"; + $queue['upperlimit3'] = $_POST['bandwidth'] . "Kb"; + $queue['linkshare'] = "on"; + $queue['linkshare1'] = $_POST['bandwidth'] . "Kb"; + $queue['linkshare2'] = "1"; + $queue['linkshare3'] = $_POST['bandwidth'] . "Kb"; + $queue['bandwidth'] = "0"; + $queue['bandwidthtype'] = "Kb"; + $queue['attachtoqueue'] = "qLANRoot"; + $config['shaper']['queue'][] = $queue; + + $gamesplist = array(); + /* counter strike */ + $gamesplist[] = array('Titan','udp','6003','6003','both'); + $gamesplist[] = array('Authentication','udp','7002','7002','both'); + $gamesplist[] = array('Client','udp','6003','6003','both'); + $gamesplist[] = array('Masterserver','udp','27010','27010','both'); + $gamesplist[] = array('Mod-Server','udp','27011','27011','both'); + $gamesplist[] = array('Chat','udp','27012','27012','both'); + $gamesplist[] = array('HL-Serverport ','udp','27015','27015','both'); + + /* XXX: add some more games here! */ + + /* Set up/down games as higher weight */ + /* loop through p2plist[] */ + foreach ($gamesplist as $Gameclient) { + foreach (array('source','destination') as $srcdest) { + $rule = array(); + if ($srcdest == 'source') { + $destsrc = 'destination'; + $rule['outqueue'] = 'qGamesUp'; + $rule['inqueue'] = 'qGamesDown'; + $rule['interface'] = 'wan'; + $rule['source']['network'] = 'lan'; + $rule['destination']['any'] = TRUE; + $rule['descr'] = "m_Gam {$Gameclient[0]} outbound"; + } else { + $destsrc = 'source'; + $rule['outqueue'] = 'qGamesDown'; + $rule['inqueue'] = 'qGamesUp'; + $rule['interface'] = 'lan'; + $rule['source']['any'] = TRUE; + $rule['destination']['network'] = 'lan'; + $rule['descr'] = "m_Gam {$Gameclient[0]} inbound"; + } + + $rule['destination']['port'] = $Gameclient[2]."-".$Gameclient[3]; + if($Gameclient[1] != '') + $rule['protocol'] = $Gameclient[1]; + + $config['shaper']['rule'][] = $rule; + } + } </stepsubmitphpaction> </step> <step> |