diff options
| author | Jafar Al-Gharaibeh <jafar@atcorp.com> | 2025-02-13 09:32:07 -0600 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-02-13 09:32:07 -0600 |
| commit | f70530c8e8ada9fcc7fd6a83e7a1e211b11b2131 (patch) | |
| tree | d2644254bc60786a7307a62e9815bcec89cad989 /pimd/pim6_cmd.c | |
| parent | 007243d94de48e285b7912cd4323098774b24320 (diff) | |
| parent | 3d272221a4d921bc2eac95c47e92c773dd0b3b3c (diff) | |
Merge pull request #18032 from opensourcerouting/gmp-limit
pimd,pim6d: implement GMP group / source limits
Diffstat (limited to 'pimd/pim6_cmd.c')
| -rw-r--r-- | pimd/pim6_cmd.c | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/pimd/pim6_cmd.c b/pimd/pim6_cmd.c index 12493b7dbb..40bd7caf7d 100644 --- a/pimd/pim6_cmd.c +++ b/pimd/pim6_cmd.c @@ -1612,6 +1612,43 @@ DEFPY (interface_no_ipv6_mld_version, "frr-routing:ipv6"); } +DEFPY_YANG(interface_ipv6_mld_limits, + interface_ipv6_mld_limits_cmd, + "[no] ipv6 mld <max-sources$do_src (0-4294967295)$val" + "|max-groups$do_grp (0-4294967295)$val>", + NO_STR + IPV6_STR + IFACE_MLD_STR + "Limit number of MLDv2 sources to track\n" + "Permitted number of sources\n" + "Limit number of MLD group memberships to track\n" + "Permitted number of groups\n") +{ + const char *xpath; + + assert(do_src || do_grp); + if (do_src) + xpath = "./max-sources"; + else + xpath = "./max-groups"; + + if (no) + nb_cli_enqueue_change(vty, xpath, NB_OP_DESTROY, NULL); + else + nb_cli_enqueue_change(vty, xpath, NB_OP_MODIFY, val_str); + + return nb_cli_apply_changes(vty, FRR_GMP_INTERFACE_XPATH, FRR_PIM_AF_XPATH_VAL); +} + +ALIAS_YANG(interface_ipv6_mld_limits, + no_interface_ipv6_mld_limits_cmd, + "no ipv6 mld <max-sources$do_src|max-groups$do_grp>", + NO_STR + IPV6_STR + IFACE_MLD_STR + "Limit number of MLDv2 sources to track\n" + "Limit number of MLD group memberships to track\n") + DEFPY (interface_ipv6_mld_query_interval, interface_ipv6_mld_query_interval_cmd, "ipv6 mld query-interval (1-65535)$q_interval", @@ -2341,6 +2378,32 @@ DEFPY (show_ipv6_pim_bsrp, return pim_show_group_rp_mappings_info_helper(vrf, vty, !!json); } +DEFPY(clear_ipv6_mld_interfaces, + clear_ipv6_mld_interfaces_cmd, + "clear ipv6 mld [vrf NAME$vrf_name] interfaces", + CLEAR_STR + IPV6_STR + "MLD clear commands\n" + VRF_CMD_HELP_STR + "Reset MLD interfaces\n") +{ + struct interface *ifp; + struct vrf *vrf; + + vrf = vrf_name ? vrf_lookup_by_name(vrf_name) : vrf_lookup_by_id(VRF_DEFAULT); + if (!vrf) { + vty_out(vty, "Specified VRF: %s does not exist\n", vrf_name); + return CMD_WARNING; + } + + FOR_ALL_INTERFACES (vrf, ifp) + pim_if_addr_del_all(ifp); + FOR_ALL_INTERFACES (vrf, ifp) + pim_if_addr_add_all(ifp); + + return CMD_SUCCESS; +} + DEFPY (clear_ipv6_pim_statistics, clear_ipv6_pim_statistics_cmd, "clear ipv6 pim statistics [vrf NAME]$name", @@ -2865,6 +2928,9 @@ void pim_cmd_init(void) install_element(INTERFACE_NODE, &interface_no_ipv6_pim_boundary_oil_cmd); install_element(INTERFACE_NODE, &interface_ipv6_mroute_cmd); install_element(INTERFACE_NODE, &interface_no_ipv6_mroute_cmd); + install_element(INTERFACE_NODE, &interface_ipv6_mld_limits_cmd); + install_element(INTERFACE_NODE, &no_interface_ipv6_mld_limits_cmd); + /* Install BSM command */ install_element(INTERFACE_NODE, &ipv6_pim_bsm_cmd); install_element(INTERFACE_NODE, &no_ipv6_pim_bsm_cmd); @@ -2935,6 +3001,7 @@ void pim_cmd_init(void) install_element(VIEW_NODE, &show_ipv6_pim_bsr_cmd); install_element(VIEW_NODE, &show_ipv6_pim_bsm_db_cmd); install_element(VIEW_NODE, &show_ipv6_pim_bsrp_cmd); + install_element(ENABLE_NODE, &clear_ipv6_mld_interfaces_cmd); install_element(ENABLE_NODE, &clear_ipv6_pim_statistics_cmd); install_element(ENABLE_NODE, &clear_ipv6_mroute_cmd); install_element(ENABLE_NODE, &clear_ipv6_pim_oil_cmd); |
