Skip to content

Commit

Permalink
net/frr - add default-information originate option for OSPFv3. closes o…
Browse files Browse the repository at this point in the history
  • Loading branch information
AdSchellevis committed Sep 4, 2023
1 parent 7e42d0b commit a477a67
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 10 deletions.
1 change: 1 addition & 0 deletions net/frr/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
PLUGIN_NAME= frr
PLUGIN_VERSION= 1.35
PLUGIN_REVISION= 1
PLUGIN_COMMENT= The FRRouting Protocol Suite
PLUGIN_DEPENDS= frr8
PLUGIN_MAINTAINER= [email protected]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,25 @@
<type>text</type>
<help>Router ID as IPv4 Address</help>
</field>
<field>
<id>ospf6.originate</id>
<label>Advertise Default Gateway</label>
<type>checkbox</type>
<help>This will send the information that we have a default gateway.</help>
<style>opt_checkbox</style>
</field>
<field>
<id>ospf6.originatealways</id>
<label>Always Advertise Default Gateway</label>
<type>checkbox</type>
<help>This will send the information that we have a default gateway, regardless of if it is available.</help>
<style>ospf6_originate</style>
</field>
<field>
<id>ospf6.originatemetric</id>
<label>Advertise Default Gateway Metric</label>
<type>text</type>
<help>This let you manipulate the metric when advertising default gateway.</help>
<style>ospf6_originate</style>
</field>
</form>
16 changes: 15 additions & 1 deletion net/frr/src/opnsense/mvc/app/models/OPNsense/Quagga/OSPF6.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<model>
<mount>//OPNsense/quagga/ospf6</mount>
<description>OSPFv3 Routing configuration</description>
<version>1.0.3</version>
<version>1.0.4</version>
<items>
<enabled type="BooleanField">
<default>0</default>
Expand All @@ -25,6 +25,20 @@
<Required>N</Required>
<mask>/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/</mask>
</routerid>
<originate type="BooleanField">
<default>0</default>
<Required>Y</Required>
</originate>
<originatealways type="BooleanField">
<default>0</default>
<Required>Y</Required>
</originatealways>
<originatemetric type="IntegerField">
<Required>N</Required>
<MinimumValue>0</MinimumValue>
<MaximumValue>16777214</MaximumValue>
<ValidationMessage>Must be a number between 0 and 16777214.</ValidationMessage>
</originatemetric>
<interfaces>
<interface type="ArrayField">
<enabled type="BooleanField">
Expand Down
22 changes: 13 additions & 9 deletions net/frr/src/opnsense/mvc/app/views/OPNsense/Quagga/ospf6.volt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{#

OPNsense® is Copyright © 20142017 by Deciso B.V.
OPNsense® is Copyright © 20142023 by Deciso B.V.
This file is Copyright © 2017 by Fabian Franz
This file is Copyright © 2017 by Michael Muenz <[email protected]>
All rights reserved.
Expand Down Expand Up @@ -64,7 +64,6 @@ POSSIBILITY OF SUCH DAMAGE.
<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> -->
<button type="button" class="btn btn-xs reload_btn btn-primary"><span class="fa fa-refresh reloadAct_progress"></span> {{ lang._('Reload Service') }}</button>
</td>
</tr>
Expand All @@ -76,25 +75,21 @@ POSSIBILITY OF SUCH DAMAGE.

<script>

function quagga_update_status() {
updateServiceControlUI('quagga');
}

$( 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');
});

quagga_update_status();
updateServiceControlUI('quagga');

// link save button to API set action
$("#saveAct").click(function(){
saveFormToEndpoint(url="/api/quagga/ospf6settings/set",formid='frm_ospf6_settings',callback_ok=function(){
$("#saveAct_progress").addClass("fa fa-spinner fa-pulse");
ajaxCall(url="/api/quagga/service/reconfigure", sendData={}, callback=function(data,status) {
quagga_update_status();
updateServiceControlUI('quagga');
$("#saveAct_progress").removeClass("fa fa-spinner fa-pulse");
});
});
Expand All @@ -104,7 +99,7 @@ $( document ).ready(function() {
$('.reload_btn').click(function reload_handler() {
$(".reloadAct_progress").addClass("fa-spin");
ajaxCall(url="/api/quagga/service/reconfigure", sendData={}, callback=function(data,status) {
quagga_update_status();
updateServiceControlUI('quagga');
$(".reloadAct_progress").removeClass("fa-spin");
});
});
Expand All @@ -119,6 +114,15 @@ $( document ).ready(function() {
'options':{selection:false, multiSelect:false}
}
);

// hook checkbox item with conditional options
$(".opt_checkbox").change(function(){
if ($(this).is(':checked')) {
$("." + $(this).attr('id').replace('.', '_')).closest('tr').show();
} else {
$("." + $(this).attr('id').replace('.', '_')).closest('tr').hide();
}
});
});
</script>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ router ospf6
{% if helpers.exists('OPNsense.quagga.ospf6.routerid') and OPNsense.quagga.ospf6.routerid != '' %}
ospf6 router-id {{ OPNsense.quagga.ospf6.routerid }}
{% endif %}
{% if not helpers.empty('OPNsense.quagga.ospf6.originate') %}
default-information originate{% if not helpers.empty('OPNsense.quagga.ospf6.originatealways') %} always {% endif %}{% if OPNsense.quagga.ospf6.originatemetric|default('') != '' %} metric {{ OPNsense.quagga.ospf6.originatemetric }}{% endif %}

{% endif %}
{% if helpers.exists('OPNsense.quagga.ospf6.redistribute') and OPNsense.quagga.ospf6.redistribute != '' %}
{% for line in OPNsense.quagga.ospf6.redistribute.split(',') %}
redistribute {{ line }}
Expand Down

0 comments on commit a477a67

Please sign in to comment.