diff --git a/net/tayga/Makefile b/net/tayga/Makefile index fe232e6ac..9b9a62daf 100644 --- a/net/tayga/Makefile +++ b/net/tayga/Makefile @@ -1,6 +1,5 @@ PLUGIN_NAME= tayga -PLUGIN_VERSION= 1.2 -PLUGIN_REVISION= 2 +PLUGIN_VERSION= 1.3 PLUGIN_COMMENT= Tayga NAT64 PLUGIN_DEPENDS= tayga PLUGIN_MAINTAINER= m.muenz@gmail.com diff --git a/net/tayga/pkg-descr b/net/tayga/pkg-descr index 4ff06aba2..c97a14600 100644 --- a/net/tayga/pkg-descr +++ b/net/tayga/pkg-descr @@ -7,6 +7,10 @@ networks where dedicated NAT64 hardware would be overkill. Plugin Changelog ================ +1.3 + +* Static mapping support + 1.2 * Custom IPv6 routing option diff --git a/net/tayga/src/opnsense/mvc/app/controllers/OPNsense/Tayga/Api/MappingController.php b/net/tayga/src/opnsense/mvc/app/controllers/OPNsense/Tayga/Api/MappingController.php new file mode 100644 index 000000000..05b88d727 --- /dev/null +++ b/net/tayga/src/opnsense/mvc/app/controllers/OPNsense/Tayga/Api/MappingController.php @@ -0,0 +1,67 @@ + + 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. +*/ + +namespace OPNsense\Tayga\Api; + +use OPNsense\Base\ApiMutableModelControllerBase; + +class MappingController extends ApiMutableModelControllerBase +{ + protected static $internalModelName = 'staticmapping'; + protected static $internalModelClass = '\OPNsense\Tayga\StaticMapping'; + + public function searchStaticmappingAction() + { + return $this->searchBase('staticmappings.staticmapping', ['enabled', 'v4', 'v6']); + } + + public function getStaticmappingAction($uuid = null) + { + return $this->getBase('staticmapping', 'staticmappings.staticmapping', $uuid); + } + + public function addStaticmappingAction() + { + return $this->addBase('staticmapping', 'staticmappings.staticmapping'); + } + + public function delStaticmappingAction($uuid) + { + return $this->delBase('staticmappings.staticmapping', $uuid); + } + + public function setStaticmappingAction($uuid) + { + return $this->setBase('staticmapping', 'staticmappings.staticmapping', $uuid); + } + + public function toggleStaticmappingAction($uuid) + { + return $this->toggleBase('staticmappings.staticmapping', $uuid); + } +} diff --git a/net/tayga/src/opnsense/mvc/app/controllers/OPNsense/Tayga/GeneralController.php b/net/tayga/src/opnsense/mvc/app/controllers/OPNsense/Tayga/GeneralController.php index 6cf94562b..667f30cc9 100644 --- a/net/tayga/src/opnsense/mvc/app/controllers/OPNsense/Tayga/GeneralController.php +++ b/net/tayga/src/opnsense/mvc/app/controllers/OPNsense/Tayga/GeneralController.php @@ -34,5 +34,7 @@ class GeneralController extends \OPNsense\Base\IndexController { $this->view->generalForm = $this->getForm("general"); $this->view->pick('OPNsense/Tayga/general'); + $this->view->formDialogEditStaticMapping = $this->getForm("dialogEditStaticMapping"); + $this->view->formGridStaticMapping = $this->getFormGrid("dialogEditStaticMapping"); } } diff --git a/net/tayga/src/opnsense/mvc/app/controllers/OPNsense/Tayga/forms/dialogEditStaticMapping.xml b/net/tayga/src/opnsense/mvc/app/controllers/OPNsense/Tayga/forms/dialogEditStaticMapping.xml new file mode 100644 index 000000000..e838c49e7 --- /dev/null +++ b/net/tayga/src/opnsense/mvc/app/controllers/OPNsense/Tayga/forms/dialogEditStaticMapping.xml @@ -0,0 +1,34 @@ +
diff --git a/net/tayga/src/opnsense/mvc/app/models/OPNsense/Tayga/General.xml b/net/tayga/src/opnsense/mvc/app/models/OPNsense/Tayga/General.xml index 0644ef618..19861baff 100644 --- a/net/tayga/src/opnsense/mvc/app/models/OPNsense/Tayga/General.xml +++ b/net/tayga/src/opnsense/mvc/app/models/OPNsense/Tayga/General.xml @@ -1,7 +1,7 @@