From 0f7cc6f9fe7ed8da9eb3e009bf25dd3865bb666d Mon Sep 17 00:00:00 2001 From: Jos Schellevis Date: Thu, 25 Jun 2015 18:43:59 +0200 Subject: [PATCH] (trafficshaper) add burst option to pipes and clean up extra spaces --- .../OPNsense/TrafficShaper/Api/SettingsController.php | 2 +- .../OPNsense/TrafficShaper/forms/dialogPipe.xml | 11 +++++++++++ .../models/OPNsense/TrafficShaper/TrafficShaper.xml | 4 ++++ .../mvc/app/views/OPNsense/TrafficShaper/index.volt | 1 + .../service/templates/OPNsense/IPFW/ipfw.conf | 8 ++++---- 5 files changed, 21 insertions(+), 5 deletions(-) diff --git a/src/opnsense/mvc/app/controllers/OPNsense/TrafficShaper/Api/SettingsController.php b/src/opnsense/mvc/app/controllers/OPNsense/TrafficShaper/Api/SettingsController.php index 92113bcb2..e4add29d6 100644 --- a/src/opnsense/mvc/app/controllers/OPNsense/TrafficShaper/Api/SettingsController.php +++ b/src/opnsense/mvc/app/controllers/OPNsense/TrafficShaper/Api/SettingsController.php @@ -216,7 +216,7 @@ class SettingsController extends ApiControllerBase $searchPhrase = $this->request->getPost('searchPhrase', 'string', ''); // create model and fetch query resuls - $fields = array("enabled","number", "bandwidth","bandwidthMetric","description","mask","origin"); + $fields = array("enabled","number", "bandwidth","bandwidthMetric","burst","description","mask","origin"); $mdlShaper = new TrafficShaper(); $grid = new UIModelGrid($mdlShaper->pipes->pipe); return $grid->fetch($fields, $itemsPerPage, $currentPage, $sortBy, $sortDescending, $searchPhrase); diff --git a/src/opnsense/mvc/app/controllers/OPNsense/TrafficShaper/forms/dialogPipe.xml b/src/opnsense/mvc/app/controllers/OPNsense/TrafficShaper/forms/dialogPipe.xml index f28512e4f..34cfd8c02 100644 --- a/src/opnsense/mvc/app/controllers/OPNsense/TrafficShaper/forms/dialogPipe.xml +++ b/src/opnsense/mvc/app/controllers/OPNsense/TrafficShaper/forms/dialogPipe.xml @@ -16,6 +16,17 @@ dropdown + + pipe.burst + + text + If the data to be sent exceeds the pipe's bandwidth limit (and + the pipe was previously idle), up to size bytes of data are + allowed to bypass the dummynet scheduler, and will be sent as + fast as the physical link allows. + + true + pipe.queue diff --git a/src/opnsense/mvc/app/models/OPNsense/TrafficShaper/TrafficShaper.xml b/src/opnsense/mvc/app/models/OPNsense/TrafficShaper/TrafficShaper.xml index 63694a259..6578e5709 100644 --- a/src/opnsense/mvc/app/models/OPNsense/TrafficShaper/TrafficShaper.xml +++ b/src/opnsense/mvc/app/models/OPNsense/TrafficShaper/TrafficShaper.xml @@ -32,6 +32,10 @@ Bandwidth metric should be one of bit,Kbit,Mbit + + N + The burst value is an integer and represent a number of bytes. + N 2 diff --git a/src/opnsense/mvc/app/views/OPNsense/TrafficShaper/index.volt b/src/opnsense/mvc/app/views/OPNsense/TrafficShaper/index.volt index dc0db48c9..998b0073a 100644 --- a/src/opnsense/mvc/app/views/OPNsense/TrafficShaper/index.volt +++ b/src/opnsense/mvc/app/views/OPNsense/TrafficShaper/index.volt @@ -114,6 +114,7 @@ POSSIBILITY OF SUCH DAMAGE. Number Bandwidth Metric + Burst Mask Description Commands diff --git a/src/opnsense/service/templates/OPNsense/IPFW/ipfw.conf b/src/opnsense/service/templates/OPNsense/IPFW/ipfw.conf index 43e1f21c5..f14ea661d 100644 --- a/src/opnsense/service/templates/OPNsense/IPFW/ipfw.conf +++ b/src/opnsense/service/templates/OPNsense/IPFW/ipfw.conf @@ -31,10 +31,10 @@ flush #====================================================================================== {% if helpers.exists('OPNsense.TrafficShaper.pipes.pipe') %} {% for pipe in helpers.toList('OPNsense.TrafficShaper.pipes.pipe') %} -pipe {{ pipe.number }} config bw {{ pipe.bandwidth }}{{ pipe.bandwidthMetric }}/s {% - if pipe.queue %} queue {{ pipe.queue }} {% - if pipe.queueMetric != 'slots' %} {{pipe.queueMetric}} {% endif %} {% endif - %} {% if pipe.mask != 'none' %} mask {{ pipe.mask }} 0xffffffff {% endif %} +pipe {{ pipe.number }} config bw {{ pipe.bandwidth }}{{ pipe.bandwidthMetric }}/s{% if pipe.burst %} burst {{ pipe.burst }}{% endif %}{% + if pipe.queue %} queue {{ pipe.queue }}{% + if pipe.queueMetric != 'slots' %}{{pipe.queueMetric}}{% endif %}{% endif + %}{% if pipe.mask != 'none' %} mask {{ pipe.mask }} 0xffffffff {% endif %} {% endfor %} {% endif %}