From 0db838274669c5529b5fc0293c13492ac8f193a0 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Sat, 30 Dec 2017 14:10:45 +0100 Subject: [PATCH] net-mgmt/lldpd: restructure previous --- README.md | 1 + net-mgmt/lldpd/Makefile | 1 + .../OPNsense/Lldpd/Api/GeneralController.php | 2 +- .../OPNsense/Lldpd/Api/ServiceController.php | 12 ++- .../app/models/OPNsense/Lldpd/Menu/Menu.xml | 2 +- .../mvc/app/views/OPNsense/Lldpd/general.volt | 100 +++++++++--------- .../service/conf/actions.d/actions_lldpd.conf | 6 -- 7 files changed, 63 insertions(+), 61 deletions(-) diff --git a/README.md b/README.md index 16ad199a7..d4c5c0f97 100644 --- a/README.md +++ b/README.md @@ -38,6 +38,7 @@ dns/rfc2136 -- RFC-2136 Support mail/postfix -- SMTP mail relay mail/rspamd -- Protect your network from spam net-mgmt/collectd -- Collect system and application performance metrics periodically +net-mgmt/lldpd -- LLDP allows you to know exactly on which port is a server net-mgmt/snmp -- SNMP Server via bsnmpd net-mgmt/telegraf -- Agent for collecting metrics and data net-mgmt/zabbix-agent -- Enterprise-class open source distributed monitoring agent diff --git a/net-mgmt/lldpd/Makefile b/net-mgmt/lldpd/Makefile index 64ae67e49..21f9efc8b 100644 --- a/net-mgmt/lldpd/Makefile +++ b/net-mgmt/lldpd/Makefile @@ -3,5 +3,6 @@ PLUGIN_VERSION= 0.1 PLUGIN_COMMENT= LLDP allows you to know exactly on which port is a server PLUGIN_DEPENDS= lldpd PLUGIN_MAINTAINER= m.muenz@gmail.com +PLUGIN_DEVEL= yes .include "../../Mk/plugins.mk" diff --git a/net-mgmt/lldpd/src/opnsense/mvc/app/controllers/OPNsense/Lldpd/Api/GeneralController.php b/net-mgmt/lldpd/src/opnsense/mvc/app/controllers/OPNsense/Lldpd/Api/GeneralController.php index 5f7ca2bf9..3190d9671 100644 --- a/net-mgmt/lldpd/src/opnsense/mvc/app/controllers/OPNsense/Lldpd/Api/GeneralController.php +++ b/net-mgmt/lldpd/src/opnsense/mvc/app/controllers/OPNsense/Lldpd/Api/GeneralController.php @@ -36,5 +36,5 @@ use OPNsense\Base\ApiMutableModelControllerBase; class GeneralController extends ApiMutableModelControllerBase { static protected $internalModelClass = '\OPNsense\Lldpd\General'; - static protected $internalModelName = 'lldpd'; + static protected $internalModelName = 'general'; } diff --git a/net-mgmt/lldpd/src/opnsense/mvc/app/controllers/OPNsense/Lldpd/Api/ServiceController.php b/net-mgmt/lldpd/src/opnsense/mvc/app/controllers/OPNsense/Lldpd/Api/ServiceController.php index 49821ed95..ed98ef40a 100644 --- a/net-mgmt/lldpd/src/opnsense/mvc/app/controllers/OPNsense/Lldpd/Api/ServiceController.php +++ b/net-mgmt/lldpd/src/opnsense/mvc/app/controllers/OPNsense/Lldpd/Api/ServiceController.php @@ -32,21 +32,23 @@ namespace OPNsense\Lldpd\Api; use OPNsense\Base\ApiMutableServiceControllerBase; +use OPNsense\Core\Backend; class ServiceController extends ApiMutableServiceControllerBase { + static protected $internalServiceClass = '\OPNsense\Lldpd\General'; + static protected $internalServiceTemplate = 'OPNsense/Lldpd'; + static protected $internalServiceEnabled = 'enabled'; + static protected $internalServiceName = 'lldpd'; + /** * show lldpd neighbors * @return array - */ + */ public function neighborAction() { $backend = new Backend(); $response = $backend->configdRun("lldpd neighbor"); return array("response" => $response); } - static protected $internalServiceClass = '\OPNsense\Lldpd\General'; - static protected $internalServiceTemplate = 'OPNsense/Lldpd'; - static protected $internalServiceEnabled = 'general.enabled'; - static protected $internalServiceName = 'lldpd'; } diff --git a/net-mgmt/lldpd/src/opnsense/mvc/app/models/OPNsense/Lldpd/Menu/Menu.xml b/net-mgmt/lldpd/src/opnsense/mvc/app/models/OPNsense/Lldpd/Menu/Menu.xml index 800d413e0..3383f917b 100644 --- a/net-mgmt/lldpd/src/opnsense/mvc/app/models/OPNsense/Lldpd/Menu/Menu.xml +++ b/net-mgmt/lldpd/src/opnsense/mvc/app/models/OPNsense/Lldpd/Menu/Menu.xml @@ -1,5 +1,5 @@ - + diff --git a/net-mgmt/lldpd/src/opnsense/mvc/app/views/OPNsense/Lldpd/general.volt b/net-mgmt/lldpd/src/opnsense/mvc/app/views/OPNsense/Lldpd/general.volt index 5242690de..01149fccd 100644 --- a/net-mgmt/lldpd/src/opnsense/mvc/app/views/OPNsense/Lldpd/general.volt +++ b/net-mgmt/lldpd/src/opnsense/mvc/app/views/OPNsense/Lldpd/general.volt @@ -1,31 +1,30 @@ {# + # Copyright (C) 2014-2017 Deciso B.V. + # Copyright (C) 2017 Michael Muenz + # 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. + #} -OPNsense® is Copyright © 2014 – 2017 by Deciso B.V. -This file is Copyright © 2017 by Michael Muenz -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. - -#}