aboutsummaryrefslogtreecommitdiffstats
path: root/config
diff options
context:
space:
mode:
authordoktornotor <notordoktor@gmail.com>2015-07-30 18:24:56 +0200
committerdoktornotor <notordoktor@gmail.com>2015-07-30 18:24:56 +0200
commit82f357e6157d2e126da43134abcacc60a5e6033b (patch)
tree384800cd3d42baf547b222f3f58f16bd2f2ebbf1 /config
parent94c130cf043b6bd3c817606b2572f62335bc2498 (diff)
downloadpfsense-packages-82f357e6157d2e126da43134abcacc60a5e6033b.tar.gz
pfsense-packages-82f357e6157d2e126da43134abcacc60a5e6033b.tar.bz2
pfsense-packages-82f357e6157d2e126da43134abcacc60a5e6033b.zip
softflowd - do not restart on boot plus style fixes
- Do not try to restart service on boot, otherwise it may get started twice via /etc/rc.start_packages (Fixes bug #4731). - Add standard XML and copyright headers. - Remove doubled spaces between sentences in descriptions. - Developer style guidelines (spacing, braces).
Diffstat (limited to 'config')
-rw-r--r--config/softflowd/softflowd.xml94
1 files changed, 73 insertions, 21 deletions
diff --git a/config/softflowd/softflowd.xml b/config/softflowd/softflowd.xml
index 55065429..2960a560 100644
--- a/config/softflowd/softflowd.xml
+++ b/config/softflowd/softflowd.xml
@@ -1,6 +1,45 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<!DOCTYPE packagegui SYSTEM "./schema/packages.dtd">
+<?xml-stylesheet type="text/xsl" href="./xsl/package.xsl"?>
<packagegui>
+ <copyright>
+ <![CDATA[
+/* $Id$ */
+/* ========================================================================== */
+/*
+ softflowd.xml
+ part of pfSense (http://www.pfSense.com)
+ Copyright (C) 2013-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.
+*/
+/* ========================================================================== */
+ ]]>
+ </copyright>
<name>softflowd</name>
- <version>0.9.8_2 pkg v1.1</version>
+ <version>1.2</version>
<title>softflowd: Settings</title>
<aftersaveredirect>pkg_edit.php?xml=softflowd.xml&amp;id=0</aftersaveredirect>
<menu>
@@ -50,7 +89,7 @@
<field>
<fielddescr>Hop Limit</fielddescr>
<fieldname>hoplimit</fieldname>
- <description>Set the IPv4 TTL or the IPv6 hop limit to hoplimit. softflowd will use the default system TTL when exporting flows to a unicast host. When exporting to a multicast group, the default TTL will be 1 (i.e. link-local).</description>
+ <description>Set the IPv4 TTL or the IPv6 hop limit to hoplimit. softflowd will use the default system TTL when exporting flows to a unicast host. When exporting to a multicast group, the default TTL will be 1 (i.e. link-local).</description>
<type>input</type>
</field>
<field>
@@ -76,7 +115,7 @@
<field>
<fielddescr>Flow Tracking Level</fielddescr>
<fieldname>flowtracking</fieldname>
- <description>Specify which flow elements softflowd should be used to define a flow. track_level may be one of: &quot;full&quot; (track everything in the flow, the default), &quot;proto&quot; (track source and destination addresses and protocol), or &quot;ip&quot; (only track source and destination addresses). Selecting either of the latter options will produce flows with less information in them (e.g. TCP/UDP ports will not be recorded). This will cause flows to be consolidated, reducing the quantity of output and CPU load that softflowd will place on the system at the cost of some detail being lost.</description>
+ <description>Specify which flow elements softflowd should be used to define a flow. track_level may be one of: &quot;full&quot; (track everything in the flow, the default), &quot;proto&quot; (track source and destination addresses and protocol), or &quot;ip&quot; (only track source and destination addresses). Selecting either of the latter options will produce flows with less information in them (e.g. TCP/UDP ports will not be recorded). This will cause flows to be consolidated, reducing the quantity of output and CPU load that softflowd will place on the system at the cost of some detail being lost.</description>
<type>select</type>
<options>
<option>
@@ -106,13 +145,13 @@
<field>
<fielddescr>Maximum Lifetime</fielddescr>
<fieldname>timeout-maxlife</fieldname>
- <description>(Seconds) This is the maximum lifetime that a flow may exist for. All flows are forcibly expired when they pass maxlife seconds. To disable this feature, specify a maxlife of 0.</description>
+ <description>(Seconds) This is the maximum lifetime that a flow may exist for. All flows are forcibly expired when they pass maxlife seconds. To disable this feature, specify a maxlife of 0.</description>
<type>input</type>
</field>
<field>
<fielddescr>Expire Interval</fielddescr>
<fieldname>timeout-expint</fieldname>
- <description>(Seconds) Specify the interval between expiry checks. Increase this to group more flows into a NetFlow packet. To disable this feature, specify a expint of 0.</description>
+ <description>(Seconds) Specify the interval between expiry checks. Increase this to group more flows into a NetFlow packet. To disable this feature, specify a expint of 0.</description>
<type>input</type>
</field>
<field>
@@ -145,7 +184,7 @@
function sync_package_softflowd() {
conf_mount_rw();
config_lock();
- global $config;
+ global $config, $g;
$cf = $config['installedpackages']['softflowd']['config'][0];
$interface_list = explode(",", $cf['interface']);
if (!empty($cf['host']) && !empty($interface_list)) {
@@ -191,39 +230,52 @@
"stop" => "/usr/bin/killall -9 softflowd"
)
);
- restart_service("softflowd");
+ /* Only try to restart if not booting */
+ if (!($g['booting'])) {
+ restart_service("softflowd");
+ }
}
conf_mount_ro();
config_unlock();
}
function validate_form_softflowd($post, &$input_errors) {
- if (($post['host'] == "") || !is_ipaddr($post['host']))
+ if (($post['host'] == "") || !is_ipaddr($post['host'])) {
$input_errors[] = 'You must specify a valid ip address in the \'Host\' field';
- if (($post['port'] == "") || !is_port($post['port']))
+ }
+ if (($post['port'] == "") || !is_port($post['port'])) {
$input_errors[] = 'You must specify a valid port number in the \'Port\' field';
-
- if (($post['version'] == "" || !in_array($post['version'], array(1, 5, 9))))
+ }
+ if (($post['version'] == "" || !in_array($post['version'], array(1, 5, 9)))) {
$input_errors[] = 'You must specify a netflow version';
- if (($post['flowtracking'] == "" || !in_array($post['flowtracking'], array("full", "proto", "ip"))))
+ }
+ if (($post['flowtracking'] == "" || !in_array($post['flowtracking'], array("full", "proto", "ip")))) {
$input_errors[] = 'You must specify a valid flow tracking selection';
-
- if (!empty($post['hoplimit']) && (!is_numeric($post['hoplimit']) || ($post['hoplimit'] < 1) || ($post['hoplimit'] > 255)))
+ }
+ if (!empty($post['hoplimit']) && (!is_numeric($post['hoplimit']) || ($post['hoplimit'] < 1) || ($post['hoplimit'] > 255))) {
$input_errors[] = 'You must specify a valid hop limit';
- if (!empty($post['timeout-general']) && (!is_numeric($post['timeout-general']) || ($post['timeout-general'] < 0)))
+ }
+ if (!empty($post['timeout-general']) && (!is_numeric($post['timeout-general']) || ($post['timeout-general'] < 0))) {
$input_errors[] = 'You must specify a valid General Timeout';
- if (!empty($post['timeout-maxlife']) && (!is_numeric($post['timeout-maxlife']) || ($post['timeout-maxlife'] < 0)))
+ }
+ if (!empty($post['timeout-maxlife']) && (!is_numeric($post['timeout-maxlife']) || ($post['timeout-maxlife'] < 0))) {
$input_errors[] = 'You must specify a valid Maximum Lifetime Timeout';
- if (!empty($post['timeout-expint']) && (!is_numeric($post['timeout-expint']) || ($post['timeout-expint'] < 0)))
+ }
+ if (!empty($post['timeout-expint']) && (!is_numeric($post['timeout-expint']) || ($post['timeout-expint'] < 0))) {
$input_errors[] = 'You must specify a valid Expire Interval';
- if (!empty($post['timeout-tcp']) && (!is_numeric($post['timeout-tcp']) || ($post['timeout-tcp'] < 0)))
+ }
+ if (!empty($post['timeout-tcp']) && (!is_numeric($post['timeout-tcp']) || ($post['timeout-tcp'] < 0))) {
$input_errors[] = 'You must specify a valid TCP Timeout';
- if (!empty($post['timeout-tcp-rst']) && (!is_numeric($post['timeout-tcp-rst']) || ($post['timeout-tcp-rst'] < 0)))
+ }
+ if (!empty($post['timeout-tcp-rst']) && (!is_numeric($post['timeout-tcp-rst']) || ($post['timeout-tcp-rst'] < 0))) {
$input_errors[] = 'You must specify a valid TCP RST Timeout';
- if (!empty($post['timeout-tcp-fin']) && (!is_numeric($post['timeout-tcp-fin']) || ($post['timeout-tcp-fin'] < 0)))
+ }
+ if (!empty($post['timeout-tcp-fin']) && (!is_numeric($post['timeout-tcp-fin']) || ($post['timeout-tcp-fin'] < 0))) {
$input_errors[] = 'You must specify a valid TCP FIN Timeout';
- if (!empty($post['timeout-udp']) && (!is_numeric($post['timeout-udp']) || ($post['timeout-udp'] < 0)))
+ }
+ if (!empty($post['timeout-udp']) && (!is_numeric($post['timeout-udp']) || ($post['timeout-udp'] < 0))) {
$input_errors[] = 'You must specify a valid UDP Timeout';
+ }
}
function cleanup_config_softflowd() {