Skip to content

Commit

Permalink
igmp: T5736: migrate "protocols igmp" to "protocols pim"
Browse files Browse the repository at this point in the history
IGMP and PIM are two different but related things.

FRR has both combined in pimd. As we use get_config_dict() and FRR reload it
is better to have both centrally stored under the same CLI node (as FRR does,
too) to just "fire and forget" the commit to the daemon.

"set protocols igmp interface eth1" -> "set protocols pim interface eth1 igmp"
  • Loading branch information
c-po committed Nov 13, 2023
1 parent 45ea9ed commit bc83fb0
Show file tree
Hide file tree
Showing 15 changed files with 322 additions and 303 deletions.
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.

17 changes: 17 additions & 0 deletions data/templates/frr/pimd.frr.j2
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,26 @@ interface {{ iface }}
{% if iface_config.igmp is vyos_defined %}
ip igmp
{% endif %}
{% 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 %}
exit
{% endfor %}
{% endif %}
Expand Down
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 -->
3 changes: 3 additions & 0 deletions interface-definitions/include/version/pim-version.xml.i
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<!-- include start from include/version/pim-version.xml.i -->
<syntaxVersion component='pim' version='1'></syntaxVersion>
<!-- include end -->
95 changes: 0 additions & 95 deletions interface-definitions/protocols-igmp.xml.in

This file was deleted.

43 changes: 41 additions & 2 deletions interface-definitions/protocols-pim.xml.in
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<children>
<node name="pim" owner="${vyos_conf_scripts_dir}/protocols_pim.py">
<properties>
<help>Protocol Independent Multicast (PIM)</help>
<help>Protocol Independent Multicast (PIM) and IGMP</help>
<priority>400</priority>
</properties>
<children>
Expand All @@ -31,11 +31,50 @@
<help>Internet Group Management Protocol (IGMP) options</help>
</properties>
<children>
<tagNode name="join">
<properties>
<help>IGMP join multicast group</help>
<valueHelp>
<format>ipv4</format>
<description>Multicast group address</description>
</valueHelp>
<constraint>
<validator name="ipv4-address"/>
</constraint>
</properties>
<children>
#include <include/source-address-ipv4-multi.xml.i>
</children>
</tagNode>
<leafNode name="query-interval">
<properties>
<help>IGMP host query interval</help>
<valueHelp>
<format>u32:1-1800</format>
<description>Query interval in seconds</description>
</valueHelp>
<constraint>
<validator name="numeric" argument="--range 1-1800"/>
</constraint>
</properties>
</leafNode>
<leafNode name="query-max-response-time">
<properties>
<help>IGMP max query response time</help>
<valueHelp>
<format>u32:10-250</format>
<description>Query response value in deci-seconds</description>
</valueHelp>
<constraint>
<validator name="numeric" argument="--range 10-250"/>
</constraint>
</properties>
</leafNode>
<leafNode name="version">
<properties>
<help>Interface IGMP version</help>
<completionHelp>
<list>1 2</list>
<list>2 3</list>
</completionHelp>
<valueHelp>
<format>2</format>
Expand Down
1 change: 1 addition & 0 deletions interface-definitions/xml-component-version.xml.in
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#include <include/version/ntp-version.xml.i>
#include <include/version/openconnect-version.xml.i>
#include <include/version/ospf-version.xml.i>
#include <include/version/pim-version.xml.i>
#include <include/version/policy-version.xml.i>
#include <include/version/pppoe-server-version.xml.i>
#include <include/version/pptp-version.xml.i>
Expand Down
12 changes: 6 additions & 6 deletions op-mode-definitions/show-ip-igmp.xml.in
Original file line number Diff line number Diff line change
Expand Up @@ -13,31 +13,31 @@
<properties>
<help>IGMP groups information</help>
</properties>
<command>vtysh -c "show ip igmp groups"</command>
<command>${vyos_op_scripts_dir}/vtysh_wrapper.sh $@</command>
</leafNode>
<leafNode name="interfaces">
<leafNode name="interface">
<properties>
<help>IGMP interfaces information</help>
</properties>
<command>vtysh -c "show ip igmp interface"</command>
<command>${vyos_op_scripts_dir}/vtysh_wrapper.sh $@</command>
</leafNode>
<leafNode name="join">
<properties>
<help>IGMP static join information</help>
</properties>
<command>vtysh -c "show ip igmp join"</command>
<command>${vyos_op_scripts_dir}/vtysh_wrapper.sh $@</command>
</leafNode>
<leafNode name="sources">
<properties>
<help>IGMP sources information</help>
</properties>
<command>vtysh -c "show ip igmp sources"</command>
<command>${vyos_op_scripts_dir}/vtysh_wrapper.sh $@</command>
</leafNode>
<leafNode name="statistics">
<properties>
<help>IGMP statistics</help>
</properties>
<command>vtysh -c "show ip igmp statistics"</command>
<command>${vyos_op_scripts_dir}/vtysh_wrapper.sh $@</command>
</leafNode>
</children>
</node>
Expand Down
17 changes: 17 additions & 0 deletions smoketest/config-tests/igmp-pim-small
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
set interfaces ethernet eth1 address '100.64.0.1/24'
set interfaces ethernet eth2 address '172.16.0.2/24'
set protocols pim interface eth1 igmp join 224.1.0.0 source-address '1.1.1.1'
set protocols pim interface eth1 igmp join 224.1.0.0 source-address '1.1.1.2'
set protocols pim interface eth1 igmp query-interval '1000'
set protocols pim interface eth1 igmp query-max-response-time '30'
set protocols pim interface eth1 igmp version '2'
set protocols pim interface eth2
set protocols pim rp address 172.16.255.1 group '224.0.0.0/4'
set service ntp server 0.pool.ntp.org
set service ntp server 1.pool.ntp.org
set service ntp server 2.pool.ntp.org
set system domain-name 'vyos.io'
set system host-name 'vyos'
set system login user vyos authentication encrypted-password '$6$2Ta6TWHd/U$NmrX0x9kexCimeOcYK1MfhMpITF9ELxHcaBU/znBq.X2ukQOj61fVI2UYP/xBzP4QtiTcdkgs7WOQMHWsRymO/'
set system login user vyos authentication plaintext-password ''
set system console device ttyS0 speed '115200'
Loading

0 comments on commit bc83fb0

Please sign in to comment.