diff options
author | jim-p <jimp@pfsense.org> | 2015-02-06 10:04:01 -0500 |
---|---|---|
committer | jim-p <jimp@pfsense.org> | 2015-02-06 10:04:01 -0500 |
commit | e8347e149d70fb581716e931431eb6ccc5889b9f (patch) | |
tree | b1f8610f01cf5bc9945244989f06e2c9463aca4d | |
parent | 07cf2c4b20230ddedee1bf9dddc1e7cd407385f5 (diff) | |
download | pfsense-packages-e8347e149d70fb581716e931431eb6ccc5889b9f.tar.gz pfsense-packages-e8347e149d70fb581716e931431eb6ccc5889b9f.tar.bz2 pfsense-packages-e8347e149d70fb581716e931431eb6ccc5889b9f.zip |
Add a few more parameters to softflowd
-rw-r--r-- | config/softflowd/softflowd.xml | 130 | ||||
-rw-r--r-- | pkg_config.10.xml | 2 | ||||
-rw-r--r-- | pkg_config.8.xml | 2 | ||||
-rw-r--r-- | pkg_config.8.xml.amd64 | 2 |
4 files changed, 126 insertions, 10 deletions
diff --git a/config/softflowd/softflowd.xml b/config/softflowd/softflowd.xml index 88e521a7..0c89faac 100644 --- a/config/softflowd/softflowd.xml +++ b/config/softflowd/softflowd.xml @@ -1,6 +1,6 @@ <packagegui> <name>softflowd</name> - <version>0.9.8 pkg v1.0.1</version> + <version>0.9.8_2 pkg v1.1</version> <title>softflowd: Settings</title> <aftersaveredirect>pkg_edit.php?xml=softflowd.xml&id=0</aftersaveredirect> <menu> @@ -19,6 +19,10 @@ <configpath>installedpackages->package->$packagename->configuration->settings</configpath> <fields> <field> + <name>General Settings</name> + <type>listtopic</type> + </field> + <field> <fielddescr>Interface</fielddescr> <fieldname>interface</fieldname> <type>interfaces_selection</type> @@ -44,6 +48,12 @@ <type>input</type> </field> <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> + <type>input</type> + </field> + <field> <fielddescr>Netflow version</fielddescr> <fieldname>version</fieldname> <description>Select the desired version of the NetFlow protocol.</description> @@ -63,6 +73,72 @@ </option> </options> </field> + <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: "full" (track everything in the flow, the default), "proto" (track source and destination addresses and protocol), or "ip" (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> + <name>Full</name> + <value>full</value> + </option> + <option> + <name>Proto</name> + <value>proto</value> + </option> + <option> + <name>IP</name> + <value>ip</value> + </option> + </options> + </field> + <field> + <name>Timeout Values</name> + <type>listtopic</type> + </field> + <field> + <fielddescr>General</fielddescr> + <fieldname>timeout-general</fieldname> + <description>(Seconds) This is the general timeout applied to all traffic unless overridden by one of the other timeouts.</description> + <type>input</type> + </field> + <field> + <fielddescr>Maximum Liftime</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> + <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> + <type>input</type> + </field> + <field> + <fielddescr>TCP</fielddescr> + <fieldname>timeout-tcp</fieldname> + <description>(Seconds) This is the general TCP timeout, applied to open TCP connections.</description> + <type>input</type> + </field> + <field> + <fielddescr>TCP RST</fielddescr> + <fieldname>timeout-tcp-rst</fieldname> + <description>(Seconds) This timeout is applied to a TCP connection when a RST packet has been sent by one or both endpoints.</description> + <type>input</type> + </field> + <field> + <fielddescr>TCP FIN</fielddescr> + <fieldname>timeout-tcp-fin</fieldname> + <description>(Seconds) This timeout is applied to a TCP connection when a FIN packet has been sent by both endpoints.</description> + <type>input</type> + </field> + <field> + <fielddescr>UDP</fielddescr> + <fieldname>timeout-udp</fieldname> + <description>(Seconds) This is the general UDP timeout, applied to all UDP connections.</description> + <type>input</type> + </field> </fields> <custom_php_global_functions> <![CDATA[ @@ -82,14 +158,32 @@ if (empty($interface)) continue; $start .= "\n\t/usr/local/sbin/softflowd "; - $start .= " -i {$interface}"; - $start .= " -n {$cf['host']}:{$cf['port']}"; + $start .= " -i " . escapeshellarg($interface); + $start .= " -n " . escapeshellarg("{$cf['host']}:{$cf['port']}"); if (is_numeric($cf['maxflows'])) - $start .= " -m {$cf['maxflows']}"; + $start .= " -m " . escapeshellarg($cf['maxflows']); + if (is_numeric($cf['hoplimit'])) + $start .= " -L " . escapeshellarg($cf['hoplimit']); if ($cf['version'] != "") - $start .= " -v {$cf['version']}"; - $start .= " -p /var/run/softflowd.{$interface}.pid"; - $start .= " -c /var/run/softflowd.{$interface}.ctl"; + $start .= " -v " . escapeshellarg($cf['version']); + if ($cf['flowtracking'] != "") + $start .= " -T " . escapeshellarg($cf['flowtracking']); + if (is_numeric($cf['timeout-general'])) + $start .= " -t " . escapeshellarg("general={$cf['timeout-general']}"); + if (is_numeric($cf['timeout-maxlife'])) + $start .= " -t " . escapeshellarg("maxlife={$cf['timeout-maxlife']}"); + if (is_numeric($cf['timeout-expint'])) + $start .= " -t " . escapeshellarg("expint={$cf['timeout-expint']}"); + if (is_numeric($cf['timeout-tcp'])) + $start .= " -t " . escapeshellarg("tcp={$cf['timeout-tcp']}"); + if (is_numeric($cf['timeout-tcp-rst'])) + $start .= " -t " . escapeshellarg("tcp.rst={$cf['timeout-tcp-rst']}"); + if (is_numeric($cf['timeout-tcp-fin'])) + $start .= " -t " . escapeshellarg("tcp.fin={$cf['timeout-tcp-fin']}"); + if (is_numeric($cf['timeout-udp'])) + $start .= " -t " . escapeshellarg("udp={$cf['timeout-udp']}"); + $start .= " -p " . escapeshellarg("/var/run/softflowd.{$interface}.pid"); + $start .= " -c " . escapeshellarg("/var/run/softflowd.{$interface}.ctl"); } write_rcfile(array( "file" => "softflowd.sh", @@ -108,6 +202,28 @@ $input_errors[] = 'You must specify a valid ip address in the \'Host\' field'; 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)))) + $input_errors[] = 'You must specify a netflow version'; + 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))) + $input_errors[] = 'You must specify a valid hop limit'; + 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))) + $input_errors[] = 'You must specify a valid Maximum Lifetime Timeout'; + 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))) + $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))) + $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))) + $input_errors[] = 'You must specify a valid TCP FIN Timeout'; + 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() { diff --git a/pkg_config.10.xml b/pkg_config.10.xml index 5266e618..78fb2777 100644 --- a/pkg_config.10.xml +++ b/pkg_config.10.xml @@ -1389,7 +1389,7 @@ <category>Network Management</category> <config_file>https://packages.pfsense.org/packages/config/softflowd/softflowd.xml</config_file> <depends_on_package_pbi>softflowd-0.9.8_2-##ARCH##.pbi</depends_on_package_pbi> - <version>0.9.8_2 pkg v1.0.1</version> + <version>0.9.8_2 pkg v1.1</version> <status>Beta</status> <required_version>2.2</required_version> <configurationfile>softflowd.xml</configurationfile> diff --git a/pkg_config.8.xml b/pkg_config.8.xml index 81f575a3..34d89603 100644 --- a/pkg_config.8.xml +++ b/pkg_config.8.xml @@ -1845,7 +1845,7 @@ <config_file>https://packages.pfsense.org/packages/config/softflowd/softflowd.xml</config_file> <depends_on_package_base_url>https://files.pfsense.org/packages/8/All/</depends_on_package_base_url> <depends_on_package_pbi>softflowd-0.9.8_2-i386.pbi</depends_on_package_pbi> - <version>0.9.8 pkg v1.0.1</version> + <version>0.9.8 pkg v1.1</version> <status>Beta</status> <required_version>2.1</required_version> <configurationfile>softflowd.xml</configurationfile> diff --git a/pkg_config.8.xml.amd64 b/pkg_config.8.xml.amd64 index 63439301..0cc6ac17 100644 --- a/pkg_config.8.xml.amd64 +++ b/pkg_config.8.xml.amd64 @@ -1832,7 +1832,7 @@ <config_file>https://packages.pfsense.org/packages/config/softflowd/softflowd.xml</config_file> <depends_on_package_base_url>https://files.pfsense.org/packages/amd64/8/All/</depends_on_package_base_url> <depends_on_package_pbi>softflowd-0.9.8_2-amd64.pbi</depends_on_package_pbi> - <version>0.9.8 pkg v1.0.1</version> + <version>0.9.8 pkg v1.1</version> <status>Beta</status> <required_version>2.1</required_version> <configurationfile>softflowd.xml</configurationfile> |