diff options
Diffstat (limited to 'config')
-rw-r--r-- | config/netio/netio.priv.inc | 43 | ||||
-rw-r--r-- | config/netio/netio.xml | 29 | ||||
-rw-r--r-- | config/netio/netioserver.xml | 18 |
3 files changed, 70 insertions, 20 deletions
diff --git a/config/netio/netio.priv.inc b/config/netio/netio.priv.inc new file mode 100644 index 00000000..f07d33dc --- /dev/null +++ b/config/netio/netio.priv.inc @@ -0,0 +1,43 @@ +<?php +/* + netio.priv.inc + part of pfSense (http://www.pfSense.org/) + Copyright (C) 2015 ESF, LLC + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. +*/ +global $priv_list; + +$priv_list['page-diagnostics-netio-client'] = array(); +$priv_list['page-diagnostics-netio-client']['name'] = "WebCfg - Diagnostics: netio client"; +$priv_list['page-diagnostics-netio-client']['descr'] = "Allow access to netio client GUI"; +$priv_list['page-diagnostics-netio-client']['match'] = array(); +$priv_list['page-diagnostics-netio-client']['match'][] = "pkg_edit.php?xml=netio.xml*"; + +$priv_list['page-diagnostics-netio-server'] = array(); +$priv_list['page-diagnostics-netio-server']['name'] = "WebCfg - Diagnostics: netio server"; +$priv_list['page-diagnostics-netio-server']['descr'] = "Allow access to netio server GUI"; +$priv_list['page-diagnostics-netio-server']['match'] = array(); +$priv_list['page-diagnostics-netio-server']['match'][] = "pkg_edit.php?xml=netioserver.xml*"; + +?> diff --git a/config/netio/netio.xml b/config/netio/netio.xml index 34f188c2..3bb079d8 100644 --- a/config/netio/netio.xml +++ b/config/netio/netio.xml @@ -42,16 +42,21 @@ ]]> </copyright> <name>netio</name> - <version>1.27</version> - <title>netio: Client</title> + <version>1.28</version> + <title>Diagnostics: netio: Client</title> + <savetext>Run netio client</savetext> <preoutput>yes</preoutput> <donotsave>true</donotsave> <menu> <name>netio</name> - <tooltiptext>Run netio in client or server mode.</tooltiptext> <section>Diagnostics</section> - <configfile>netio.xml</configfile> + <url>/pkg_edit.php?xml=netio.xml</url> </menu> + <service> + <name>netio</name> + <executable>netio</executable> + <description>netio Network Throughput Benchmark Server/Client</description> + </service> <tabs> <tab> <text>Client</text> @@ -64,6 +69,11 @@ </tab> </tabs> <additional_files_needed> + <prefix>/etc/inc/priv/</prefix> + <item>https://packages.pfsense.org/packages/config/netio/netio.priv.inc</item> + </additional_files_needed> + <additional_files_needed> + <prefix>/usr/local/pkg/</prefix> <item>https://packages.pfsense.org/packages/config/netio/netioserver.xml</item> </additional_files_needed> <fields> @@ -78,16 +88,17 @@ <fieldname>port</fieldname> <description>Enter the port that netio will connect to. (Default: 18767)</description> <type>input</type> + <default_value>18767</default_value> </field> </fields> <custom_add_php_command> <![CDATA[ mwexec("/usr/bin/killall netio"); - $netio_options = ""; - if ($_POST['port'] != "") { - $netio_options .= " -p {$_POST['port']}"; - $netio_options .= $_POST['hostname']; - system("/usr/local/bin/netio " . $netio_options); + if ($_POST['port'] != "" && $_POST['hostname'] != "") { + $port = escapeshellarg($_POST['port']); + $hostname = escapeshellarg($_POST['hostname']); + $netio_options = "-p {$port} {$hostname}"; + system("/usr/local/bin/netio {$netio_options}"); } ]]> </custom_add_php_command> diff --git a/config/netio/netioserver.xml b/config/netio/netioserver.xml index da73e902..bbe32665 100644 --- a/config/netio/netioserver.xml +++ b/config/netio/netioserver.xml @@ -42,16 +42,11 @@ ]]> </copyright> <name>netioserver</name> - <version>1.27</version> - <title>netio: Server</title> + <version>1.28</version> + <title>Diagnostics: netio: Server</title> + <savetext>Run netio server</savetext> <preoutput>yes</preoutput> <donotsave>true</donotsave> - <menu> - <name>netio</name> - <tooltiptext>Run netio in client or server mode.</tooltiptext> - <section>Diagnostics</section> - <configfile>netio.xml</configfile> - </menu> <tabs> <tab> <text>Client</text> @@ -69,14 +64,15 @@ <fieldname>port</fieldname> <description>Enter the port that netio will bind to. (Default: 18767)</description> <type>input</type> + <default_value>18767</default_value> </field> </fields> <custom_add_php_command> <![CDATA[ mwexec("/usr/bin/killall netio"); - if($_POST['port'] != "") { - $netioserver_options = " -p {$_POST['port']}"; - system("/usr/local/bin/netio -s" . $netioserver_options); + if ($_POST['port'] != "") { + $port = escapeshellarg($_POST['port']); + system("/usr/local/bin/netio -s -p {$port}"); } ]]> </custom_add_php_command> |