aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Buechler <cmb@pfsense.org>2015-11-14 23:56:11 -0600
committerChris Buechler <cmb@pfsense.org>2015-11-14 23:56:11 -0600
commitb64ef57a36eb022b829a814bfc6b384bbef63f3d (patch)
treed0f30f804e4b063b0445cae30a23a9453699c307
parent998ce9efa5299e6a4ab9f7d3aecb2dd84d1579d6 (diff)
parentd237f02eb1a26cd74c573de106b7eeba2e9ddd8d (diff)
downloadpfsense-packages-b64ef57a36eb022b829a814bfc6b384bbef63f3d.tar.gz
pfsense-packages-b64ef57a36eb022b829a814bfc6b384bbef63f3d.tar.bz2
pfsense-packages-b64ef57a36eb022b829a814bfc6b384bbef63f3d.zip
Merge pull request #1159 from doktornotor/patch-16
-rw-r--r--config/ladvd/ladvd.inc23
-rw-r--r--config/ladvd/ladvd.priv.inc43
-rw-r--r--config/ladvd/ladvd.xml24
-rw-r--r--pkg_config.10.xml2
-rw-r--r--pkg_config.8.xml2
-rw-r--r--pkg_config.8.xml.amd642
6 files changed, 76 insertions, 20 deletions
diff --git a/config/ladvd/ladvd.inc b/config/ladvd/ladvd.inc
index da37a1a9..c1d769ab 100644
--- a/config/ladvd/ladvd.inc
+++ b/config/ladvd/ladvd.inc
@@ -36,18 +36,24 @@ require_once("pkg-utils.inc");
function ladvd_resync_config() {
global $config;
- conf_mount_rw();
-
- if (!is_array($config['installedpackages']['ladvd']))
+ if (!is_array($config['installedpackages']['ladvd'])) {
return;
- if (!is_array($config['installedpackages']['ladvd']['config']))
+ }
+ if (!is_array($config['installedpackages']['ladvd']['config'])) {
return;
+ }
$ladvd_conf = &$config['installedpackages']['ladvd']['config'][0];
+ conf_mount_rw();
/* ladvd is turned off in package settings */
- if (empty($ladvd_conf['enable']))
+ if (empty($ladvd_conf['enable'])) {
+ if (is_service_running("ladvd")) {
+ stop_service("ladvd");
+ }
+ unlink_if_exists("/usr/local/etc/rc.d/ladvd.sh");
return;
+ }
$cmdline = "";
@@ -98,7 +104,12 @@ function ladvd_resync_config() {
)
);
- restart_service("ladvd");
+ if (is_service_running("ladvd")) {
+ restart_service("ladvd");
+ } else {
+ start_service("ladvd");
+ }
+
sleep(1);
conf_mount_ro();
}
diff --git a/config/ladvd/ladvd.priv.inc b/config/ladvd/ladvd.priv.inc
new file mode 100644
index 00000000..5dd30d44
--- /dev/null
+++ b/config/ladvd/ladvd.priv.inc
@@ -0,0 +1,43 @@
+<?php
+/*
+ ladvd.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-services-ladvd'] = array();
+$priv_list['page-services-ladvd']['name'] = "WebCfg - Services: ladvd";
+$priv_list['page-services-ladvd']['descr'] = "Allow access to ladvd package GUI";
+$priv_list['page-services-ladvd']['match'] = array();
+$priv_list['page-services-ladvd']['match'][] = "pkg_edit.php?xml=ladvd.xml*";
+
+$priv_list['page-services-ladvd-status'] = array();
+$priv_list['page-services-ladvd-status']['name'] = "WebCfg - Status: ladvd";
+$priv_list['page-services-ladvd-status']['descr'] = "Allow access to ladvd status page";
+$priv_list['page-services-ladvd-status']['match'] = array();
+$priv_list['page-services-ladvd-status']['match'][] = "status_ladvd.php*";
+
+?>
diff --git a/config/ladvd/ladvd.xml b/config/ladvd/ladvd.xml
index 5862afca..42c6485e 100644
--- a/config/ladvd/ladvd.xml
+++ b/config/ladvd/ladvd.xml
@@ -44,17 +44,19 @@
</copyright>
<description>Link Layer Discovery Protocol</description>
<name>LADVD</name>
- <version>1.0.4.2</version>
+ <version>1.0.4.3</version>
<category>Network Management</category>
<title>Services: LADVD</title>
- <savetext>Save</savetext>
<include_file>/usr/local/pkg/ladvd.inc</include_file>
- <aftersaveredirect>/pkg_edit.php?xml=ladvd.xml&amp;id=0</aftersaveredirect>
<additional_files_needed>
<item>https://packages.pfsense.org/packages/config/ladvd/ladvd.inc</item>
<prefix>/usr/local/pkg/</prefix>
</additional_files_needed>
<additional_files_needed>
+ <item>https://packages.pfsense.org/packages/config/ladvd/ladvd.priv.inc</item>
+ <prefix>/etc/inc/priv/</prefix>
+ </additional_files_needed>
+ <additional_files_needed>
<prefix>/usr/local/www/</prefix>
<item>https://packages.pfsense.org/packages/config/ladvd/status_ladvd.php</item>
</additional_files_needed>
@@ -62,7 +64,7 @@
<name>LADVD</name>
<tooltiptext>Modify LADVD settings.</tooltiptext>
<section>Services</section>
- <url>/pkg_edit.php?xml=ladvd.xml&amp;id=0</url>
+ <url>/pkg_edit.php?xml=ladvd.xml</url>
</menu>
<menu>
<name>LADVD Status</name>
@@ -74,12 +76,12 @@
<name>ladvd</name>
<rcfile>ladvd.sh</rcfile>
<executable>ladvd</executable>
- <description>Send and decode link layer advertisements.</description>
+ <description>Link Layer Discovery Protocol Daemon</description>
</service>
<tabs>
<tab>
<text>General</text>
- <url>/pkg_edit.php?xml=ladvd.xml&amp;id=0</url>
+ <url>/pkg_edit.php?xml=ladvd.xml</url>
<active/>
</tab>
<tab>
@@ -89,7 +91,7 @@
</tabs>
<fields>
<field>
- <fielddescr>Enable ladvd</fielddescr>
+ <fielddescr>Enable</fielddescr>
<fieldname>enable</fieldname>
<description>Enable or disable ladvd.</description>
<enablefields>iface_array[],autoenable,silent,management,location,lldp,cdp,edp,ndp</enablefields>
@@ -105,7 +107,7 @@
<description>Select the interfaces that LADVD will bind to. You can use the CTRL or COMMAND key to select multiple interfaces.</description>
</field>
<field>
- <fielddescr>Auto-enable protocols</fielddescr>
+ <fielddescr>Auto-Enable Protocols</fielddescr>
<fieldname>autoenable</fieldname>
<description>Auto-enable protocols based on received packets (also enables receive mode).</description>
<type>checkbox</type>
@@ -113,11 +115,11 @@
<field>
<fielddescr>Silent</fielddescr>
<fieldname>silent</fieldname>
- <description>Silent, don't transmit packets.</description>
+ <description>Silent mode, do not transmit packets.</description>
<type>checkbox</type>
</field>
<field>
- <fielddescr>Management interfaces</fielddescr>
+ <fielddescr>Management Interfaces</fielddescr>
<fieldname>management</fieldname>
<value>lan</value>
<type>interfaces_selection</type>
@@ -151,7 +153,7 @@
<field>
<fielddescr>Enable NDP</fielddescr>
<fieldname>ndp</fieldname>
- <description>Enable NDP (Nortel Discovery Protocol) formerly called SynOptics Network Management Protocol (SONMP).</description>
+ <description>Enable NDP (Nortel Discovery Protocol); formerly called SynOptics Network Management Protocol (SONMP).</description>
<type>checkbox</type>
</field>
</fields>
diff --git a/pkg_config.10.xml b/pkg_config.10.xml
index c564997c..d159b89c 100644
--- a/pkg_config.10.xml
+++ b/pkg_config.10.xml
@@ -1745,7 +1745,7 @@
<descr>Send and decode link layer advertisements. Support for LLDP (Link Layer Discovery Protocol), CDP (Cisco Discovery Protocol), EDP (Extreme Discovery Protocol) and NDP (Nortel Discovery Protocol).</descr>
<website>https://github.com/sspans/ladvd</website>
<category>Network Management</category>
- <version>1.0.4.2</version>
+ <version>1.0.4.3</version>
<status>BETA</status>
<depends_on_package_pbi>ladvd-1.0.4_1-##ARCH##.pbi</depends_on_package_pbi>
<config_file>https://packages.pfsense.org/packages/config/ladvd/ladvd.xml</config_file>
diff --git a/pkg_config.8.xml b/pkg_config.8.xml
index 915e86a3..97c48802 100644
--- a/pkg_config.8.xml
+++ b/pkg_config.8.xml
@@ -1782,7 +1782,7 @@
<descr>Send and decode link layer advertisements. Support for LLDP (Link Layer Discovery Protocol), CDP (Cisco Discovery Protocol), EDP (Extreme Discovery Protocol) and NDP (Nortel Discovery Protocol).</descr>
<website>https://code.google.com/p/ladvd/</website>
<category>Network Management</category>
- <version>1.0.4</version>
+ <version>1.0.4.3</version>
<status>BETA</status>
<depends_on_package_base_url>https://files.pfsense.org/packages/8/All/</depends_on_package_base_url>
<depends_on_package_pbi>ladvd-1.0.4-i386.pbi</depends_on_package_pbi>
diff --git a/pkg_config.8.xml.amd64 b/pkg_config.8.xml.amd64
index bcd3e02f..cd3b7416 100644
--- a/pkg_config.8.xml.amd64
+++ b/pkg_config.8.xml.amd64
@@ -1769,7 +1769,7 @@
<descr>Send and decode link layer advertisements. Support for LLDP (Link Layer Discovery Protocol), CDP (Cisco Discovery Protocol), EDP (Extreme Discovery Protocol) and NDP (Nortel Discovery Protocol).</descr>
<website>https://code.google.com/p/ladvd/</website>
<category>Network Management</category>
- <version>1.0.4</version>
+ <version>1.0.4.3</version>
<status>BETA</status>
<depends_on_package_base_url>https://files.pfsense.org/packages/8/All/</depends_on_package_base_url>
<depends_on_package_pbi>ladvd-1.0.4-amd64.pbi</depends_on_package_pbi>