Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pim(6): T5733: add missing FRR related features #2476

Merged
merged 8 commits into from
Nov 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion data/configd-include.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@
"policy-local-route.py",
"protocols_bfd.py",
"protocols_bgp.py",
"protocols_igmp.py",
"protocols_isis.py",
"protocols_mpls.py",
"protocols_nhrp.py",
Expand Down
41 changes: 0 additions & 41 deletions data/templates/frr/igmp.frr.j2

This file was deleted.

45 changes: 44 additions & 1 deletion data/templates/frr/pim6d.frr.j2
Original file line number Diff line number Diff line change
@@ -1,7 +1,24 @@
!
{% if interface is vyos_defined %}
{% for iface, iface_config in interface.items() %}
!
interface {{ iface }}
ipv6 pim
{% if iface_config.no_bsm is vyos_defined %}
no ipv6 pim bsm
{% endif %}
{% if iface_config.dr_priority is vyos_defined %}
ipv6 pim drpriority {{ iface_config.dr_priority }}
{% endif %}
{% if iface_config.hello is vyos_defined %}
ipv6 pim hello {{ iface_config.hello }}
{% endif %}
{% if iface_config.no_unicast_bsm is vyos_defined %}
no ipv6 pim unicast-bsm
{% endif %}
{% if iface_config.passive is vyos_defined %}
ipv6 pim passive
{% endif %}
{% if iface_config.mld is vyos_defined and iface_config.mld.disable is not vyos_defined %}
ipv6 mld
{% if iface_config.mld.version is vyos_defined %}
Expand Down Expand Up @@ -32,7 +49,33 @@ interface {{ iface }}
{% endif %}
{% endif %}
exit
!
{% endfor %}
{% endif %}
!
{% if join_prune_interval is vyos_defined %}
ipv6 pim join-prune-interval {{ join_prune_interval }}
{% endif %}
{% if keep_alive_timer is vyos_defined %}
ipv6 pim keep-alive-timer {{ keep_alive_timer }}
{% endif %}
{% if packets is vyos_defined %}
ipv6 pim packets {{ packets }}
{% endif %}
{% if register_suppress_time is vyos_defined %}
ipv6 pim register-suppress-time {{ register_suppress_time }}
{% endif %}
{% if rp.address is vyos_defined %}
{% for address, address_config in rp.address.items() %}
{% if address_config.group is vyos_defined %}
{% for group in address_config.group %}
ipv6 pim rp {{ address }} {{ group }}
{% endfor %}
{% endif %}
{% if address_config.prefix_list6 is vyos_defined %}
ipv6 pim rp {{ address }} prefix-list {{ address_config.prefix_list6 }}
{% endif %}
{% endfor %}
{% endif %}
{% if rp.keep_alive_timer is vyos_defined %}
ipv6 pim rp keep-alive-timer {{ rp.keep_alive_timer }}
{% endif %}
115 changes: 88 additions & 27 deletions data/templates/frr/pimd.frr.j2
Original file line number Diff line number Diff line change
@@ -1,34 +1,95 @@
{% if interface is vyos_defined %}
{% for iface, iface_config in interface.items() %}
!
{% for rp_addr in old_pim.rp %}
{% for group in old_pim.rp[rp_addr] %}
no ip pim rp {{ rp_addr }} {{ group }}
interface {{ iface }}
ip pim
{% if iface_config.bfd is vyos_defined %}
ip pim bfd {{ 'profile ' ~ iface_config.bfd.profile if iface_config.bfd.profile is vyos_defined }}
{% endif %}
{% if iface_config.no_bsm is vyos_defined %}
no ip pim bsm
{% endif %}
{% if iface_config.dr_priority is vyos_defined %}
ip pim drpriority {{ iface_config.dr_priority }}
{% endif %}
{% if iface_config.hello is vyos_defined %}
ip pim hello {{ iface_config.hello }}
{% endif %}
{% if iface_config.no_unicast_bsm is vyos_defined %}
no ip pim unicast-bsm
{% endif %}
{% if iface_config.passive is vyos_defined %}
ip pim passive
{% endif %}
{% if iface_config.source_address is vyos_defined %}
ip pim use-source {{ iface_config.source_address }}
{% endif %}
{% if iface_config.igmp is vyos_defined and iface_config.igmp.disable is not vyos_defined %}
ip igmp
{% if iface_config.igmp.query_interval %}
ip igmp query-interval {{ iface_config.igmp.query_interval }}
{% endif %}
{% if iface_config.igmp.query_max_response_time %}
ip igmp query-max-response-time {{ iface_config.igmp.query_max_response_time }}
{% endif %}
{% if iface_config.igmp.version is vyos_defined %}
ip igmp version {{ iface_config.igmp.version }}
{% endif %}
{% if iface_config.igmp.join is vyos_defined %}
{% for join, join_config in iface_config.igmp.join.items() %}
{% if join_config.source_address is vyos_defined %}
{% for source_address in join_config.source_address %}
ip igmp join {{ join }} {{ source_address }}
{% endfor %}
{% else %}
ip igmp join {{ join }}
{% endif %}
{% endfor %}
{% endif %}
{% endif %}
exit
{% endfor %}
{% endfor %}
{% if old_pim.rp_keep_alive %}
no ip pim rp keep-alive-timer {{ old_pim.rp_keep_alive }}
{% endif %}
{% for iface in old_pim.ifaces %}
interface {{ iface }}
no ip pim
!
{% endfor %}
{% for iface in pim.ifaces %}
interface {{ iface }}
ip pim
{% if pim.ifaces[iface].dr_prio %}
ip pim drpriority {{ pim.ifaces[iface].dr_prio }}
{% endif %}
{% if pim.ifaces[iface].hello %}
ip pim hello {{ pim.ifaces[iface].hello }}
{% endif %}
!
{% endfor %}
{% for rp_addr in pim.rp %}
{% for group in pim.rp[rp_addr] %}
ip pim rp {{ rp_addr }} {{ group }}
{% if ecmp is vyos_defined %}
ip pim ecmp {{ 'rebalance' if ecmp.rebalance is vyos_defined }}
{% endif %}
{% if join_prune_interval is vyos_defined %}
ip pim join-prune-interval {{ join_prune_interval }}
{% endif %}
{% if keep_alive_timer is vyos_defined %}
ip pim keep-alive-timer {{ keep_alive_timer }}
{% endif %}
{% if packets is vyos_defined %}
ip pim packets {{ packets }}
{% endif %}
{% if register_accept_list.prefix_list is vyos_defined %}
ip pim register-accept-list {{ register_accept_list.prefix_list }}
{% endif %}
{% if register_suppress_time is vyos_defined %}
ip pim register-suppress-time {{ register_suppress_time }}
{% endif %}
{% if rp.address is vyos_defined %}
{% for address, address_config in rp.address.items() %}
{% for group in address_config.group %}
ip pim rp {{ address }} {{ group }}
{% endfor %}
{% endfor %}
{% endfor %}
{% if pim.rp_keep_alive %}
ip pim rp keep-alive-timer {{ pim.rp_keep_alive }}
{% endif %}
{% if rp.keep_alive_timer is vyos_defined %}
ip pim rp keep-alive-timer {{ rp.keep_alive_timer }}
{% endif %}
{% if no_v6_secondary is vyos_defined %}
no ip pim send-v6-secondary
{% endif %}
{% if spt_switchover.infinity_and_beyond is vyos_defined %}
ip pim spt-switchover infinity-and-beyond {{ 'prefix-list ' ~ spt_switchover.infinity_and_beyond.prefix_list if spt_switchover.infinity_and_beyond.prefix_list is defined }}
{% endif %}
{% if ssm.prefix_list is vyos_defined %}
ip pim ssm prefix-list {{ ssm.prefix_list }}
{% endif %}
!
{% if igmp.watermark_warning is vyos_defined %}
ip igmp watermark-warn {{ igmp.watermark_warning }}
{% endif %}
!
14 changes: 14 additions & 0 deletions interface-definitions/include/pim/bsm.xml.i
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!-- include start from pim/bsm.xml.i -->
<leafNode name="no-bsm">
<properties>
<help>Do not process bootstrap messages</help>
<valueless/>
</properties>
</leafNode>
<leafNode name="no-unicast-bsm">
<properties>
<help>Do not process unicast bootstrap messages</help>
<valueless/>
</properties>
</leafNode>
<!-- include end -->
14 changes: 14 additions & 0 deletions interface-definitions/include/pim/dr-priority.xml.i
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!-- include start from pim/dr-priority.xml.i -->
<leafNode name="dr-priority">
<properties>
<help>Designated router election priority</help>
<valueHelp>
<format>u32:1-4294967295</format>
<description>DR Priority</description>
</valueHelp>
<constraint>
<validator name="numeric" argument="--range 1-4294967295"/>
</constraint>
</properties>
</leafNode>
<!-- include end -->
14 changes: 14 additions & 0 deletions interface-definitions/include/pim/hello.xml.i
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!-- include start from pim/hello.xml.i -->
<leafNode name="hello">
<properties>
<help>Hello Interval</help>
<valueHelp>
<format>u32:1-180</format>
<description>Hello Interval in seconds</description>
</valueHelp>
<constraint>
<validator name="numeric" argument="--range 1-180"/>
</constraint>
</properties>
</leafNode>
<!-- include end -->
15 changes: 15 additions & 0 deletions interface-definitions/include/pim/join-prune-interval.xml.i
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<!-- include start from pim/join-prune-interval.xml.i -->
<leafNode name="join-prune-interval">
<properties>
<help>Join prune send interval</help>
<valueHelp>
<format>u32:1-65535</format>
<description>Interval in seconds</description>
</valueHelp>
<constraint>
<validator name="numeric" argument="--range 1-65535"/>
</constraint>
</properties>
<defaultValue>60</defaultValue>
</leafNode>
<!-- include end -->
14 changes: 14 additions & 0 deletions interface-definitions/include/pim/keep-alive-timer.xml.i
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!-- include start from pim/keep-alive-timer.xml.i -->
<leafNode name="keep-alive-timer">
<properties>
<help>Keep alive Timer</help>
<valueHelp>
<format>u32:1-65535</format>
<description>Keep alive Timer in seconds</description>
</valueHelp>
<constraint>
<validator name="numeric" argument="--range 1-65535"/>
</constraint>
</properties>
</leafNode>
<!-- include end -->
15 changes: 15 additions & 0 deletions interface-definitions/include/pim/packets.xml.i
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<!-- include start from pim/packets.xml.i -->
<leafNode name="packets">
<properties>
<help>Packets to process at once</help>
<valueHelp>
<format>u32:1-255</format>
<description>Number of packets</description>
</valueHelp>
<constraint>
<validator name="numeric" argument="--range 1-255"/>
</constraint>
</properties>
<defaultValue>3</defaultValue>
</leafNode>
<!-- include end -->
8 changes: 8 additions & 0 deletions interface-definitions/include/pim/passive.xml.i
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<!-- include start from pim/passive.xml.i -->
<leafNode name="passive">
<properties>
<help>Disable sending and receiving PIM control packets on the interface</help>
<valueless/>
</properties>
</leafNode>
<!-- include end -->
14 changes: 14 additions & 0 deletions interface-definitions/include/pim/register-suppress-time.xml.i
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!-- include start from pim/register-suppress-time.xml.i -->
<leafNode name="register-suppress-time">
<properties>
<help>Register suppress timer</help>
<valueHelp>
<format>u32:1-65535</format>
<description>Timer in seconds</description>
</valueHelp>
<constraint>
<validator name="numeric" argument="--range 1-65535"/>
</constraint>
</properties>
</leafNode>
<!-- include end -->
14 changes: 14 additions & 0 deletions interface-definitions/include/policy/prefix-list.xml.i
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!-- include start from policy/prefix-list.xml.i -->
<leafNode name="prefix-list">
<properties>
<help>Prefix-list to use</help>
<valueHelp>
<format>txt</format>
<description>Prefix-list to apply (IPv4)</description>
</valueHelp>
<completionHelp>
<path>policy prefix-list</path>
</completionHelp>
</properties>
</leafNode>
<!-- include end -->
14 changes: 14 additions & 0 deletions interface-definitions/include/policy/prefix-list6.xml.i
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!-- include start from policy/prefix-list6.xml.i -->
<leafNode name="prefix-list6">
<properties>
<help>Prefix-list to use</help>
<valueHelp>
<format>txt</format>
<description>Prefix-list to apply (IPv6)</description>
</valueHelp>
<completionHelp>
<path>policy prefix-list6</path>
</completionHelp>
</properties>
</leafNode>
<!-- include end -->
18 changes: 18 additions & 0 deletions interface-definitions/include/source-address-ipv4-multi.xml.i
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<!-- include start from source-address-ipv4-multi.xml.i -->
<leafNode name="source-address">
<properties>
<help>IPv4 source address used to initiate connection</help>
<completionHelp>
<script>${vyos_completion_dir}/list_local_ips.sh --ipv4</script>
</completionHelp>
<valueHelp>
<format>ipv4</format>
<description>IPv4 source address</description>
</valueHelp>
<constraint>
<validator name="ipv4-address"/>
</constraint>
<multi/>
</properties>
</leafNode>
<!-- include end -->
Loading
Loading