mirror of
https://github.com/netbirdio/plugins.git
synced 2026-05-22 18:44:07 -07:00
* Create ospf6d.conf * Update +TARGETS * Create Ospf6Controller.php * Create Ospf6settingsController.php * Create ospf6.xml * Create dialogEditOSPF6Interface.xml * Create OSPF6.php * Create OSPF6.xml * Update Menu.xml * Create ospf6.volt * Update Ospf6Controller.php * Update Ospf6settingsController.php * Update ospf6.xml * Create dialogEditOSPF6Networks.xml * Rename dialogEditOSPF6Networks.xml to dialogEditOSPF6Network.xml * Update Menu.xml * Update OSPF6.xml * Update OSPF.php * Update ospf6.volt * Update Ospf6Controller.php * Update OSPF6.php * Update OSPF.php * Update Ospf6settingsController.php * Update Ospf6Controller.php * Update Ospf6Controller.php * Update ospf6d.conf * Update OSPF6.php * Update OSPF6.php * Update ospf6d.conf * Update ospf6.volt * Update OSPF6.xml * Update Ospf6Controller.php * Update Ospf6settingsController.php * Delete dialogEditOSPF6Network.xml * Update ospf6.xml * Update Ospf6Controller.php * Update OSPF6.php * Update OSPF6.xml * Update ospf6d.conf * Update ospf6d.conf * Update dialogEditOSPF6Interface.xml * Update OSPF6.xml * Update ospf6.volt * Update ospf6d.conf * Update ospf6d.conf * Update ospf6d.conf * Update Ospf6settingsController.php * Update ospf6.xml * Update dialogEditOSPF6Interface.xml * Update OSPF6.xml * Update ospf6.volt * Update ospf6.xml * Update ospf6d.conf * Update ospf6d.conf * Update OSPF6.xml * move namespace and includes after (C) block * update signs * Update Ospf6Controller.php
This commit is contained in:
+195
@@ -0,0 +1,195 @@
|
||||
<?php
|
||||
namespace OPNsense\Quagga\Api;
|
||||
use \OPNsense\Base\ApiControllerBase;
|
||||
use \OPNsense\Quagga\OSPF6;
|
||||
use \OPNsense\Core\Config;
|
||||
use \OPNsense\Base\ApiMutableModelControllerBase;
|
||||
use \OPNsense\Base\UIModelGrid;
|
||||
/**
|
||||
* Copyright (C) 2015 - 2017 Deciso B.V.
|
||||
* Copyright (C) 2015 J. Schellevis - Deciso B.V.
|
||||
* Copyright (C) 2017 Fabian Franz
|
||||
* 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.
|
||||
*
|
||||
*/
|
||||
class Ospf6settingsController extends ApiMutableModelControllerBase
|
||||
{
|
||||
static protected $internalModelName = 'OSPF6';
|
||||
static protected $internalModelClass = '\OPNsense\Quagga\OSPF6';
|
||||
public function getAction()
|
||||
{
|
||||
$result = array();
|
||||
if ($this->request->isGet()) {
|
||||
$mdlospf6 = new OSPF6();
|
||||
$result['ospf6'] = $mdlospf6->getNodes();
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
public function setAction()
|
||||
{
|
||||
$result = array("result"=>"failed");
|
||||
if ($this->request->isPost()) {
|
||||
// load model and update with provided data
|
||||
$mdlospf6 = new OSPF6();
|
||||
$mdlospf6->setNodes($this->request->getPost("ospf6"));
|
||||
// perform validation
|
||||
$valMsgs = $mdlospf6->performValidation();
|
||||
foreach ($valMsgs as $field => $msg) {
|
||||
if (!array_key_exists("validations", $result)) {
|
||||
$result["validations"] = array();
|
||||
}
|
||||
$result["validations"]["general.".$msg->getField()] = $msg->getMessage();
|
||||
}
|
||||
// serialize model to config and save
|
||||
if ($valMsgs->count() == 0) {
|
||||
$mdlospf6->serializeToConfig();
|
||||
Config::getInstance()->save();
|
||||
$result["result"] = "saved";
|
||||
}
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
public function searchInterfaceAction()
|
||||
{
|
||||
$this->sessionClose();
|
||||
$mdlOSPF6 = $this->getModel();
|
||||
$grid = new UIModelGrid($mdlOSPF6->interfaces->interface);
|
||||
return $grid->fetchBindRequest(
|
||||
$this->request,
|
||||
array("enabled", "interfacename", "area", "networktype")
|
||||
);
|
||||
}
|
||||
public function getInterfaceAction($uuid = null)
|
||||
{
|
||||
$mdlOSPF6 = $this->getModel();
|
||||
if ($uuid != null) {
|
||||
$node = $mdlOSPF6->getNodeByReference('interfaces.interface.' . $uuid);
|
||||
if ($node != null) {
|
||||
// return node
|
||||
return array("interface" => $node->getNodes());
|
||||
}
|
||||
} else {
|
||||
$node = $mdlOSPF6->interfaces->interface->add();
|
||||
return array("interface" => $node->getNodes());
|
||||
}
|
||||
return array();
|
||||
}
|
||||
public function addInterfaceAction()
|
||||
{
|
||||
$result = array("result" => "failed");
|
||||
if ($this->request->isPost() && $this->request->hasPost("interface")) {
|
||||
$result = array("result" => "failed", "validations" => array());
|
||||
$mdlOSPF6 = $this->getModel();
|
||||
$node = $mdlOSPF6->interfaces->interface->Add();
|
||||
$node->setNodes($this->request->getPost("interface"));
|
||||
$valMsgs = $mdlOSPF6->performValidation();
|
||||
foreach ($valMsgs as $field => $msg) {
|
||||
$fieldnm = str_replace($node->__reference, "interface", $msg->getField());
|
||||
$result["validations"][$fieldnm] = $msg->getMessage();
|
||||
}
|
||||
if (count($result['validations']) == 0) {
|
||||
// save config if validated correctly
|
||||
$mdlOSPF6->serializeToConfig();
|
||||
Config::getInstance()->save();
|
||||
unset($result['validations']);
|
||||
$result["result"] = "saved";
|
||||
}
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
public function delInterfaceAction($uuid)
|
||||
{
|
||||
$result = array("result" => "failed");
|
||||
if ($this->request->isPost()) {
|
||||
$mdlOSPF6 = $this->getModel();
|
||||
if ($uuid != null) {
|
||||
if ($mdlOSPF6->interfaces->interface->del($uuid)) {
|
||||
$mdlOSPF6->serializeToConfig();
|
||||
Config::getInstance()->save();
|
||||
$result['result'] = 'deleted';
|
||||
} else {
|
||||
$result['result'] = 'not found';
|
||||
}
|
||||
}
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
public function setInterfaceAction($uuid)
|
||||
{
|
||||
if ($this->request->isPost() && $this->request->hasPost("interface")) {
|
||||
$mdlNetwork = $this->getModel();
|
||||
if ($uuid != null) {
|
||||
$node = $mdlNetwork->getNodeByReference('interfaces.interface.' . $uuid);
|
||||
if ($node != null) {
|
||||
$result = array("result" => "failed", "validations" => array());
|
||||
$interfaceInfo = $this->request->getPost("interface");
|
||||
$node->setNodes($interfaceInfo);
|
||||
$valMsgs = $mdlNetwork->performValidation();
|
||||
foreach ($valMsgs as $field => $msg) {
|
||||
$fieldnm = str_replace($node->__reference, "interface", $msg->getField());
|
||||
$result["validations"][$fieldnm] = $msg->getMessage();
|
||||
}
|
||||
if (count($result['validations']) == 0) {
|
||||
// save config if validated correctly
|
||||
$mdlNetwork->serializeToConfig();
|
||||
Config::getInstance()->save();
|
||||
$result = array("result" => "saved");
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
}
|
||||
return array("result" => "failed");
|
||||
}
|
||||
public function toggle_handler($uuid, $elements, $element)
|
||||
{
|
||||
$result = array("result" => "failed");
|
||||
if ($this->request->isPost()) {
|
||||
$mdlNetwork = $this->getModel();
|
||||
if ($uuid != null) {
|
||||
$node = $mdlNetwork->getNodeByReference($elements . '.'. $element .'.' . $uuid);
|
||||
if ($node != null) {
|
||||
if ($node->enabled->__toString() == "1") {
|
||||
$result['result'] = "Disabled";
|
||||
$node->enabled = "0";
|
||||
} else {
|
||||
$result['result'] = "Enabled";
|
||||
$node->enabled = "1";
|
||||
}
|
||||
// if item has toggled, serialize to config and save
|
||||
$mdlNetwork->serializeToConfig();
|
||||
Config::getInstance()->save();
|
||||
}
|
||||
}
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
public function toggleInterfaceAction($uuid)
|
||||
{
|
||||
return $this->toggle_handler($uuid, 'interfaces', 'interface');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
/*
|
||||
Copyright (C) 2017 Fabian Franz
|
||||
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.
|
||||
*/
|
||||
|
||||
namespace OPNsense\Quagga;
|
||||
class Ospf6Controller extends \OPNsense\Base\IndexController
|
||||
{
|
||||
public function indexAction()
|
||||
{
|
||||
$this->view->title = gettext("OSPFv3 Settings");
|
||||
$this->view->ospf6Form = $this->getForm("ospf6");
|
||||
$this->view->formDialogEditInterface = $this->getForm("dialogEditOSPF6Interface");
|
||||
$this->view->pick('OPNsense/Quagga/ospf6');
|
||||
}
|
||||
}
|
||||
+55
@@ -0,0 +1,55 @@
|
||||
<form>
|
||||
<field>
|
||||
<id>interface.enabled</id>
|
||||
<label>Enabled</label>
|
||||
<type>checkbox</type>
|
||||
</field>
|
||||
<field>
|
||||
<id>interface.interfacename</id>
|
||||
<label>Interface</label>
|
||||
<style>tokenize</style>
|
||||
<type>select_multiple</type>
|
||||
<help>Select an interface where this settings apply to.</help>
|
||||
</field>
|
||||
<field>
|
||||
<id>interface.area</id>
|
||||
<label>Area</label>
|
||||
<type>text</type>
|
||||
<help>Area in wildcard mask style like 0.0.0.0 and no decimal 0</help>
|
||||
</field>
|
||||
<field>
|
||||
<id>interface.cost</id>
|
||||
<label>Cost</label>
|
||||
<type>text</type>
|
||||
</field>
|
||||
<field>
|
||||
<id>interface.hellointerval</id>
|
||||
<label>Hello Interval</label>
|
||||
<type>text</type>
|
||||
</field>
|
||||
<field>
|
||||
<id>interface.deadinterval</id>
|
||||
<label>Dead Interval</label>
|
||||
<type>text</type>
|
||||
</field>
|
||||
<field>
|
||||
<id>interface.retransmitinterval</id>
|
||||
<label>Retransmission Interval</label>
|
||||
<type>text</type>
|
||||
</field>
|
||||
<field>
|
||||
<id>interface.transmitdelay</id>
|
||||
<label>Retransmission Delay</label>
|
||||
<type>text</type>
|
||||
</field>
|
||||
<field>
|
||||
<id>interface.priority</id>
|
||||
<label>Priority</label>
|
||||
<type>text</type>
|
||||
</field>
|
||||
<field>
|
||||
<id>interface.networktype</id>
|
||||
<label>Network Type</label>
|
||||
<type>select_multiple</type>
|
||||
</field>
|
||||
</form>
|
||||
@@ -0,0 +1,22 @@
|
||||
<form>
|
||||
<field>
|
||||
<id>ospf6.enabled</id>
|
||||
<label>Enable</label>
|
||||
<type>checkbox</type>
|
||||
<help>This will activate the OSPFv3 service if routing protocols are enabled in "General".</help>
|
||||
</field>
|
||||
<field>
|
||||
<id>ospf6.redistribute</id>
|
||||
<label>Route Redistribution</label>
|
||||
<type>select_multiple</type>
|
||||
<style>tokenize</style>
|
||||
<help><![CDATA[Select other routing sources, which should be redistributed to the other nodes.]]></help>
|
||||
<hint>Type or select a route source.</hint>
|
||||
</field>
|
||||
<field>
|
||||
<id>ospf6.routerid</id>
|
||||
<label>Router ID</label>
|
||||
<type>text</type>
|
||||
<help>Router ID as IPv4 Address</help>
|
||||
</field>
|
||||
</form>
|
||||
@@ -1,10 +1,11 @@
|
||||
<menu>
|
||||
<Routing cssClass="fa fa-map-signs" order="45">
|
||||
<General VisibleName="General" cssClass="fa fa-bolt fa-fw" url="/ui/quagga/general/index" order="1"/>
|
||||
<RIP VisibleName="RIP" cssClass="fa fa-bolt fa-fw" url="/ui/quagga/rip/index" order="10" />
|
||||
<OSPF VisibleName="OSPF" cssClass="fa fa-bolt fa-fw" url="/ui/quagga/ospf/index" order="20" />
|
||||
<General VisibleName="General" cssClass="fa fa-map-signs fa-fw" url="/ui/quagga/general/index" order="1"/>
|
||||
<RIP VisibleName="RIP" cssClass="fa fa-expand fa-fw" url="/ui/quagga/rip/index" order="10" />
|
||||
<OSPF VisibleName="OSPF" cssClass="fa fa-map fa-fw" url="/ui/quagga/ospf/index" order="20" />
|
||||
<OSPF6 VisibleName="OSPFv3" cssClass="fa fa-map fa-fw" url="/ui/quagga/ospf6/index" order="25" />
|
||||
<!--<ISIS VisibleName="IS-IS" cssClass="fa fa-bolt fa-fw" url="/ui/quagga/isis/index" order="30" />-->
|
||||
<BGP VisibleName="BGPv4" cssClass="fa fa-bolt fa-fw" url="/ui/quagga/bgp/index" order="40" />
|
||||
<BGP VisibleName="BGPv4" cssClass="fa fa-globe fa-fw" url="/ui/quagga/bgp/index" order="40" />
|
||||
<Diagnostics VisibleName="Diagnostics" cssClass="fa fa-medkit fa-fw" order="50">
|
||||
<General VisibleName="General" url="/ui/quagga/diagnostics/general" order="1" />
|
||||
<BGP VisibleName="BGPv4" url="/ui/quagga/diagnostics/bgp" order="40" />
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
/*
|
||||
Copyright (C) 2017 Fabian Franz
|
||||
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.
|
||||
*/
|
||||
namespace OPNsense\Quagga;
|
||||
use OPNsense\Base\BaseModel;
|
||||
|
||||
class OSPF6 extends BaseModel
|
||||
{
|
||||
}
|
||||
@@ -0,0 +1,98 @@
|
||||
<model>
|
||||
<mount>//OPNsense/quagga/ospf6</mount>
|
||||
<description>OSPFv3 Routing configuration</description>
|
||||
<items>
|
||||
<enabled type="BooleanField">
|
||||
<default>0</default>
|
||||
<Required>Y</Required>
|
||||
</enabled>
|
||||
<redistribute type="OptionField">
|
||||
<Required>N</Required>
|
||||
<multiple>Y</multiple>
|
||||
<default></default>
|
||||
<OptionValues>
|
||||
<connected>Connected routes (directly attached subnet or host)</connected>
|
||||
<static>Statically configured routes</static>
|
||||
</OptionValues>
|
||||
</redistribute>
|
||||
<routerid type="TextField">
|
||||
<default></default>
|
||||
<Required>Y</Required>
|
||||
<mask>/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/</mask>
|
||||
</routerid>
|
||||
<interfaces>
|
||||
<interface type="ArrayField">
|
||||
<enabled type="BooleanField">
|
||||
<default>1</default>
|
||||
<Required>Y</Required>
|
||||
</enabled>
|
||||
<interfacename type="InterfaceField">
|
||||
<Required>N</Required>
|
||||
<multiple>N</multiple>
|
||||
<default></default>
|
||||
<filters>
|
||||
<enable>/^(?!0).*$/</enable>
|
||||
</filters>
|
||||
</interfacename>
|
||||
<area type="TextField">
|
||||
<default></default>
|
||||
<Required>Y</Required>
|
||||
<mask>/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/</mask>
|
||||
</area>
|
||||
<cost type="IntegerField">
|
||||
<default></default>
|
||||
<MinimumValue>0</MinimumValue>
|
||||
<Required>N</Required>
|
||||
<MaximumValue>4294967295</MaximumValue>
|
||||
<ValidationMessage>Cost must be between 0 and 4294967295.</ValidationMessage>
|
||||
</cost>
|
||||
<hellointerval type="IntegerField">
|
||||
<default></default>
|
||||
<MinimumValue>0</MinimumValue>
|
||||
<Required>N</Required>
|
||||
<MaximumValue>4294967295</MaximumValue>
|
||||
<ValidationMessage>Hello interval must be between 0 and 4294967295.</ValidationMessage>
|
||||
</hellointerval>
|
||||
<deadinterval type="IntegerField">
|
||||
<default></default>
|
||||
<MinimumValue>0</MinimumValue>
|
||||
<Required>N</Required>
|
||||
<MaximumValue>4294967295</MaximumValue>
|
||||
<ValidationMessage>Dead interval must be between 0 and 4294967295.</ValidationMessage>
|
||||
</deadinterval>
|
||||
<retransmitinterval type="IntegerField">
|
||||
<default></default>
|
||||
<MinimumValue>0</MinimumValue>
|
||||
<Required>N</Required>
|
||||
<MaximumValue>4294967295</MaximumValue>
|
||||
<ValidationMessage>Retransmit interval must be between 0 and 4294967295.</ValidationMessage>
|
||||
</retransmitinterval>
|
||||
<transmitdelay type="IntegerField">
|
||||
<default></default>
|
||||
<MinimumValue>0</MinimumValue>
|
||||
<Required>N</Required>
|
||||
<MaximumValue>4294967295</MaximumValue>
|
||||
<ValidationMessage>Transmit delay must be between 0 and 4294967295.</ValidationMessage>
|
||||
</transmitdelay>
|
||||
<priority type="IntegerField">
|
||||
<default></default>
|
||||
<MinimumValue>0</MinimumValue>
|
||||
<Required>N</Required>
|
||||
<MaximumValue>4294967295</MaximumValue>
|
||||
<ValidationMessage>Priority must be between 0 and 4294967295.</ValidationMessage>
|
||||
</priority>
|
||||
<networktype type="OptionField">
|
||||
<Required>N</Required>
|
||||
<multiple>N</multiple>
|
||||
<default></default>
|
||||
<OptionValues>
|
||||
<broadcast>Broadcast multi-access network</broadcast>
|
||||
<non-broadcast>NBMA network</non-broadcast>
|
||||
<point-to-multipoint>Point-to-multipoint network</point-to-multipoint>
|
||||
<point-to-point>Point-to-point network</point-to-point>
|
||||
</OptionValues>
|
||||
</networktype>
|
||||
</interface>
|
||||
</interfaces>
|
||||
</items>
|
||||
</model>
|
||||
@@ -0,0 +1,113 @@
|
||||
{#
|
||||
|
||||
OPNsense® is Copyright © 2014 – 2017 by Deciso B.V.
|
||||
This file is Copyright © 2017 by Fabian Franz
|
||||
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.
|
||||
|
||||
#}
|
||||
|
||||
<!-- Navigation bar -->
|
||||
<ul class="nav nav-tabs" data-tabs="tabs" id="maintabs">
|
||||
<li class="active"><a data-toggle="tab" href="#general">{{ lang._('General') }}</a></li>
|
||||
<li><a data-toggle="tab" href="#interfaces">{{ lang._('Interfaces') }}</a></li>
|
||||
</ul>
|
||||
<div class="tab-content content-box tab-content">
|
||||
<div id="general" class="tab-pane fade in active">
|
||||
<div class="content-box" style="padding-bottom: 1.5em;">
|
||||
{{ partial("layout_partials/base_form",['fields':ospf6Form,'id':'frm_ospf6_settings'])}}
|
||||
|
||||
<div class="col-md-12">
|
||||
<hr />
|
||||
<button class="btn btn-primary" id="saveAct" type="button"><b>{{ lang._('Save') }}</b></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Tab: Interfaces -->
|
||||
<div id="interfaces" class="tab-pane fade in">
|
||||
<table id="grid-interfaces" class="table table-responsive" data-editDialog="DialogEditInterface">
|
||||
<thead>
|
||||
<tr>
|
||||
<th data-column-id="enabled" data-type="string" data-formatter="rowtoggle">{{ lang._('Enabled') }}</th>
|
||||
<th data-column-id="interfacename" data-type="string" data-visible="true">{{ lang._('Interface Name') }}</th>
|
||||
<th data-column-id="area" data-type="string" data-visible="true">{{ lang._('Area') }}</th>
|
||||
<th data-column-id="networktype" data-type="string" data-visible="true">{{ lang._('Network Type') }}</th>
|
||||
<th data-column-id="uuid" data-type="string" data-identifier="true" data-visible="false">{{ lang._('ID') }}</th>
|
||||
<th data-column-id="commands" data-formatter="commands" data-sortable="false">{{ lang._('Commands') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td colspan="5"></td>
|
||||
<td>
|
||||
<button data-action="add" type="button" class="btn btn-xs btn-default"><span class="fa fa-plus"></span></button>
|
||||
<!-- <button data-action="deleteSelected" type="button" class="btn btn-xs btn-default"><span class="fa fa-trash-o"></span></button> -->
|
||||
</td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
$( document ).ready(function() {
|
||||
var data_get_map = {'frm_ospf6_settings':"/api/quagga/ospf6settings/get"};
|
||||
mapDataToFormUI(data_get_map).done(function(data){
|
||||
formatTokenizersUI();
|
||||
$('.selectpicker').selectpicker('refresh');
|
||||
});
|
||||
ajaxCall(url="/api/quagga/service/status", sendData={}, callback=function(data,status) {
|
||||
updateServiceStatusUI(data['status']);
|
||||
});
|
||||
|
||||
// link save button to API set action
|
||||
$("#saveAct").click(function(){
|
||||
saveFormToEndpoint(url="/api/quagga/ospf6settings/set",formid='frm_ospf6_settings',callback_ok=function(){
|
||||
ajaxCall(url="/api/quagga/service/reconfigure", sendData={}, callback=function(data,status) {
|
||||
ajaxCall(url="/api/quagga/service/status", sendData={}, callback=function(data,status) {
|
||||
updateServiceStatusUI(data['status']);
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
$("#grid-interfaces").UIBootgrid(
|
||||
{ 'search':'/api/quagga/ospf6settings/searchInterface',
|
||||
'get':'/api/quagga/ospf6settings/getInterface/',
|
||||
'set':'/api/quagga/ospf6settings/setInterface/',
|
||||
'add':'/api/quagga/ospf6settings/addInterface/',
|
||||
'del':'/api/quagga/ospf6settings/delInterface/',
|
||||
'toggle':'/api/quagga/ospf6settings/toggleInterface/',
|
||||
'options':{selection:false, multiSelect:false}
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
|
||||
{{ partial("layout_partials/base_dialog",['fields':formDialogEditInterface,'id':'DialogEditInterface','label':lang._('Edit Interface')])}}
|
||||
@@ -1,5 +1,6 @@
|
||||
bgpd.conf:/usr/local/etc/quagga/bgpd.conf
|
||||
ospfd.conf:/usr/local/etc/quagga/ospfd.conf
|
||||
ospf6d.conf:/usr/local/etc/quagga/ospf6d.conf
|
||||
ripd.conf:/usr/local/etc/quagga/ripd.conf
|
||||
quagga:/etc/rc.conf.d/quagga
|
||||
zebra.conf:/usr/local/etc/quagga/zebra.conf
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
{% macro cline(directive, modelname) -%}{% if modelname %}
|
||||
ipv6 ospf6 {{ directive }} {{ modelname }}
|
||||
{% endif %}{%- endmacro %}
|
||||
{% from 'OPNsense/Macros/interface.macro' import physical_interface %}
|
||||
{% if helpers.exists('OPNsense.quagga.ospf6.enabled') and OPNsense.quagga.ospf6.enabled == '1' %}
|
||||
!
|
||||
! Zebra configuration saved from vty
|
||||
! 2017/03/03 20:21:04
|
||||
!
|
||||
!
|
||||
!
|
||||
!
|
||||
{% if helpers.exists('OPNsense.quagga.ospf6.interfaces.interface') %}
|
||||
{% for interface in helpers.toList('OPNsense.quagga.ospf6.interfaces.interface') %}
|
||||
{% if interface.enabled == '1' %}
|
||||
interface {{ physical_interface(interface.interfacename) }}
|
||||
{{ cline("cost",interface.cost)
|
||||
}}{{ cline("dead-interval",interface.deadinterval)
|
||||
}}{{ cline("hello-interval",interface.hellointerval)
|
||||
}}{{ cline("priority",interface.priority)
|
||||
}}{{ cline("retransmit-interval",interface.retransmitinterval)
|
||||
}}!
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
!
|
||||
router ospf6
|
||||
{% if helpers.exists('OPNsense.quagga.ospf6.redistribute') and OPNsense.quagga.ospf6.redistribute != '' %}
|
||||
{% for line in OPNsense.quagga.ospf6.redistribute.split(',') %}
|
||||
redistribute {{ line }}
|
||||
{% endfor %}{% endif %}
|
||||
{% if helpers.exists('OPNsense.quagga.ospf6.interfaces.interface') %}
|
||||
{% for interface in helpers.toList('OPNsense.quagga.ospf6.interfaces.interface') %}
|
||||
{% if interface.enabled == '1' %}
|
||||
interface {{ physical_interface(interface.interfacename) }} area {{ interface.area }}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% if helpers.exists('OPNsense.quagga.ospf6.routerid') and OPNsense.quagga.ospf6.routerid != '' %}
|
||||
router-id {{ OPNsense.quagga.ospf6.routerid }}
|
||||
{% endif %}
|
||||
!
|
||||
line vty
|
||||
!
|
||||
{% endif %}
|
||||
Reference in New Issue
Block a user