Skip to content

Commit

Permalink
pim6: T5733: add missing FRR PIM6 related features
Browse files Browse the repository at this point in the history
  • Loading branch information
c-po committed Nov 13, 2023
1 parent 6ce2ecb commit 403d2ff
Show file tree
Hide file tree
Showing 7 changed files with 387 additions and 61 deletions.
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 %}
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 -->
97 changes: 72 additions & 25 deletions interface-definitions/protocols-pim6.xml.in
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<children>
<node name="pim6" owner="${vyos_conf_scripts_dir}/protocols_pim6.py">
<properties>
<help>Protocol Independent Multicast for IPv6 (PIMv6)</help>
<help>Protocol Independent Multicast for IPv6 (PIMv6) and MLD</help>
<priority>400</priority>
</properties>
<children>
Expand All @@ -15,8 +15,15 @@
<completionHelp>
<script>${vyos_completion_dir}/list_interfaces</script>
</completionHelp>
<constraint>
#include <include/constraint/interface-name.xml.i>
</constraint>
</properties>
<children>
#include <include/pim/bsm.xml.i>
#include <include/pim/dr-priority.xml.i>
#include <include/pim/hello.xml.i>
#include <include/pim/passive.xml.i>
<node name="mld">
<properties>
<help>Multicast Listener Discovery (MLD)</help>
Expand Down Expand Up @@ -53,25 +60,29 @@
</leafNode>
</children>
</tagNode>
<leafNode name="version">
<leafNode name="last-member-query-count">
<properties>
<help>MLD version</help>
<completionHelp>
<list>1 2</list>
</completionHelp>
<help>Last member query count</help>
<valueHelp>
<format>1</format>
<description>MLD version 1</description>
<format>u32:1-255</format>
<description>Count</description>
</valueHelp>
<valueHelp>
<format>2</format>
<description>MLD version 2</description>
<constraint>
<validator name="numeric" argument="--range 1-255"/>
</constraint>
</properties>
</leafNode>
<leafNode name="last-member-query-interval">
<properties>
<help>Last member query interval</help>
<valueHelp>
<format>u32:100-6553500</format>
<description>Last member query interval in milliseconds</description>
</valueHelp>
<constraint>
<validator name="numeric" argument="--range 1-2"/>
<validator name="numeric" argument="--range 100-6553500"/>
</constraint>
</properties>
<defaultValue>2</defaultValue>
</leafNode>
<leafNode name="interval">
<properties>
Expand All @@ -97,34 +108,70 @@
</constraint>
</properties>
</leafNode>
<leafNode name="last-member-query-count">
<leafNode name="version">
<properties>
<help>Last member query count</help>
<help>MLD version</help>
<completionHelp>
<list>1 2</list>
</completionHelp>
<valueHelp>
<format>u32:1-255</format>
<description>Count</description>
<format>1</format>
<description>MLD version 1</description>
</valueHelp>
<valueHelp>
<format>2</format>
<description>MLD version 2</description>
</valueHelp>
<constraint>
<validator name="numeric" argument="--range 1-255"/>
<validator name="numeric" argument="--range 1-2"/>
</constraint>
</properties>
<defaultValue>2</defaultValue>
</leafNode>
<leafNode name="last-member-query-interval">
</children>
</node>
</children>
</tagNode>
#include <include/pim/join-prune-interval.xml.i>
#include <include/pim/keep-alive-timer.xml.i>
#include <include/pim/packets.xml.i>
#include <include/pim/register-suppress-time.xml.i>
<node name="rp">
<properties>
<help>Rendezvous Point</help>
</properties>
<children>
<tagNode name="address">
<properties>
<help>Rendezvous Point address</help>
<valueHelp>
<format>ipv6</format>
<description>Rendezvous Point address</description>
</valueHelp>
<constraint>
<validator name="ipv6-address"/>
</constraint>
</properties>
<children>
<leafNode name="group">
<properties>
<help>Last member query interval</help>
<help>Group Address range</help>
<valueHelp>
<format>u32:100-6553500</format>
<description>Last member query interval in milliseconds</description>
<format>ipv6net</format>
<description>Group Address range</description>
</valueHelp>
<constraint>
<validator name="numeric" argument="--range 100-6553500"/>
<validator name="ipv6-prefix"/>
</constraint>
<multi/>
</properties>
</leafNode>
#include <include/policy/prefix-list6.xml.i>
</children>
</node>
</tagNode>
#include <include/pim/keep-alive-timer.xml.i>
</children>
</tagNode>
</node>
</children>
</node>
</children>
Expand Down
42 changes: 42 additions & 0 deletions op-mode-definitions/show-ipv6-mld.xml.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?xml version="1.0"?>
<interfaceDefinition>
<node name="show">
<children>
<node name="ipv6">
<children>
<node name="mld">
<properties>
<help>Show MLD (Multicast Listener Discovery) information</help>
</properties>
<children>
<leafNode name="groups">
<properties>
<help>MLD group information</help>
</properties>
<command>${vyos_op_scripts_dir}/vtysh_wrapper.sh $@</command>
</leafNode>
<leafNode name="interface">
<properties>
<help>MLD interface information</help>
</properties>
<command>${vyos_op_scripts_dir}/vtysh_wrapper.sh $@</command>
</leafNode>
<leafNode name="joins">
<properties>
<help>MLD joined groups and sources</help>
</properties>
<command>${vyos_op_scripts_dir}/vtysh_wrapper.sh $@</command>
</leafNode>
<leafNode name="statistics">
<properties>
<help>MLD statistics</help>
</properties>
<command>${vyos_op_scripts_dir}/vtysh_wrapper.sh $@</command>
</leafNode>
</children>
</node>
</children>
</node>
</children>
</node>
</interfaceDefinition>
120 changes: 120 additions & 0 deletions op-mode-definitions/show-ipv6-pim.xml.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
<?xml version="1.0"?>
<interfaceDefinition>
<node name="show">
<children>
<node name="ipv6">
<children>
<node name="pim">
<properties>
<help>Show PIM (Protocol Independent Multicast) information</help>
</properties>
<children>
<leafNode name="bsm-database">
<properties>
<help>PIM cached bsm packets information</help>
</properties>
<command>${vyos_op_scripts_dir}/vtysh_wrapper.sh $@</command>
</leafNode>
<leafNode name="bsr">
<properties>
<help>PIM boot-strap router information</help>
</properties>
<command>${vyos_op_scripts_dir}/vtysh_wrapper.sh $@</command>
</leafNode>
<leafNode name="bsrp-info">
<properties>
<help>PIM cached group-rp mappings information</help>
</properties>
<command>${vyos_op_scripts_dir}/vtysh_wrapper.sh $@</command>
</leafNode>
<leafNode name="channel">
<properties>
<help>PIM downstream channel info</help>
</properties>
<command>${vyos_op_scripts_dir}/vtysh_wrapper.sh $@</command>
</leafNode>
<leafNode name="interface">
<properties>
<help>PIM interfaces information</help>
</properties>
<command>${vyos_op_scripts_dir}/vtysh_wrapper.sh $@</command>
</leafNode>
<leafNode name="join">
<properties>
<help>PIM join information</help>
</properties>
<command>${vyos_op_scripts_dir}/vtysh_wrapper.sh $@</command>
</leafNode>
<leafNode name="local-membership">
<properties>
<help>PIM interface local-membership</help>
</properties>
<command>${vyos_op_scripts_dir}/vtysh_wrapper.sh $@</command>
</leafNode>
<leafNode name="neighbor">
<properties>
<help>PIM neighbor information</help>
</properties>
<command>${vyos_op_scripts_dir}/vtysh_wrapper.sh $@</command>
</leafNode>
<leafNode name="nexthop">
<properties>
<help>PIM cached nexthop rpf information</help>
</properties>
<command>${vyos_op_scripts_dir}/vtysh_wrapper.sh $@</command>
</leafNode>
<leafNode name="rp-info">
<properties>
<help>PIM rendezvous point information</help>
</properties>
<command>${vyos_op_scripts_dir}/vtysh_wrapper.sh $@</command>
</leafNode>
<leafNode name="rpf">
<properties>
<help>PIM reverse path forwarding information</help>
</properties>
<command>${vyos_op_scripts_dir}/vtysh_wrapper.sh $@</command>
</leafNode>
<leafNode name="secondary">
<properties>
<help>PIM neighbor addresses</help>
</properties>
<command>${vyos_op_scripts_dir}/vtysh_wrapper.sh $@</command>
</leafNode>
<leafNode name="state">
<properties>
<help>PIM state information</help>
</properties>
<command>${vyos_op_scripts_dir}/vtysh_wrapper.sh $@</command>
</leafNode>
<leafNode name="statistics">
<properties>
<help>PIM statistics</help>
</properties>
<command>${vyos_op_scripts_dir}/vtysh_wrapper.sh $@</command>
</leafNode>
<leafNode name="upstream">
<properties>
<help>PIM upstream information</help>
</properties>
<command>${vyos_op_scripts_dir}/vtysh_wrapper.sh $@</command>
</leafNode>
<leafNode name="upstream-join-desired">
<properties>
<help>PIM upstream join-desired</help>
</properties>
<command>${vyos_op_scripts_dir}/vtysh_wrapper.sh $@</command>
</leafNode>
<leafNode name="upstream-rpf">
<properties>
<help>PIM upstream source reverse path forwarding</help>
</properties>
<command>${vyos_op_scripts_dir}/vtysh_wrapper.sh $@</command>
</leafNode>
</children>
</node>
</children>
</node>
</children>
</node>
</interfaceDefinition>
Loading

0 comments on commit 403d2ff

Please sign in to comment.