From 22b0ed55ba31be3058e425d1512831b0fdedf902 Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Mon, 6 Jun 2005 01:39:43 +0000 Subject: * Add gaming in and out queues, set pri to 5 * Add counterstrike, the mother of all 1st person shooters --- usr/local/www/wizards/traffic_shaper_wizard.xml | 107 +++++++++++++++++++++++- 1 file changed, 104 insertions(+), 3 deletions(-) (limited to 'usr') 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; - } + } 5 pfSense Traffic Shaper Wizard + true Network Games @@ -598,15 +599,115 @@ checkbox Prioritize network gaming traffic This will raise the priority of gaming traffic to higher than most traffic. + Counterstrike + true + Enable/Disable specific P2P protocols + listtopic + + + Counterstrike + checkbox + Counterstrike. The ultimate 1st person shooter. + + Next submit -/* 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; + } + } -- cgit v1.1