diff options
author | Isabella de Leon <ideleon@microsoft.com> | 2023-01-06 19:06:23 +0100 |
---|---|---|
committer | Isabella de Leon <ideleon@microsoft.com> | 2023-02-28 20:39:12 +0100 |
commit | d74f913c5f487a722b19bd01442b8fe13c4714e8 (patch) | |
tree | cb9cf781ba9111e2bdbcba8aee687cc994a071b6 /isisd | |
parent | Merge pull request #12840 from dorDiogo/isis_advertise_passive_only (diff) | |
download | frr-d74f913c5f487a722b19bd01442b8fe13c4714e8.tar.xz frr-d74f913c5f487a722b19bd01442b8fe13c4714e8.zip |
isisd: Add advertise-high-metrics CLI/YANG support, modify show output
New config and show functionality:
r1# conf
r1(config)# router isis 1
r1(config-router)#
advertise-high-metrics Advertise high metric value on all interfaces
area-password Configure the authentication password for an area
...
r1(config-router)# advertise-high-metrics
r1(config-router)# end
r1# show isis summary
...
Area 1:
Net: 49.0001.1720.1700.0002.00
TX counters per PDU type:
L2 IIH: 1
P2P IIH: 36
LSP RXMT: 0
RX counters per PDU type:
Advertise high metrics: Enabled
Level-2:
...
r1# conf
r1(config)# router isis 1
r1(config-router)# no advertise-high-metrics
r1(config-router)# end
r1# show isis summary
...
Area 1:
Net: 49.0001.1720.1700.0002.00
TX counters per PDU type:
L2 IIH: 1
P2P IIH: 45
LSP RXMT: 0
RX counters per PDU type:
Advertise high metrics: Disabled
Level-2:
...
r1#
Signed-off-by: Isabella de Leon <ideleon@microsoft.com>
Diffstat (limited to 'isisd')
-rw-r--r-- | isisd/isis_cli.c | 25 | ||||
-rw-r--r-- | isisd/isis_nb.c | 7 | ||||
-rw-r--r-- | isisd/isis_nb.h | 4 | ||||
-rw-r--r-- | isisd/isis_nb_config.c | 18 | ||||
-rw-r--r-- | isisd/isisd.c | 9 | ||||
-rw-r--r-- | isisd/isisd.h | 4 |
6 files changed, 67 insertions, 0 deletions
diff --git a/isisd/isis_cli.c b/isisd/isis_cli.c index 5c7f61088..4a598aa8c 100644 --- a/isisd/isis_cli.c +++ b/isisd/isis_cli.c @@ -440,6 +440,29 @@ void cli_show_isis_overload_on_startup(struct vty *vty, } /* + * XPath: /frr-isisd:isis/instance/advertise-high-metrics + */ +DEFPY_YANG(advertise_high_metrics, advertise_high_metrics_cmd, + "[no] advertise-high-metrics", + NO_STR "Advertise high metric value on all interfaces\n") +{ + nb_cli_enqueue_change(vty, "./advertise-high-metrics", NB_OP_MODIFY, + no ? "false" : "true"); + + return nb_cli_apply_changes(vty, NULL); +} + +void cli_show_advertise_high_metrics(struct vty *vty, + const struct lyd_node *dnode, + bool show_defaults) +{ + if (yang_dnode_get_bool(dnode, NULL)) + vty_out(vty, " advertise-high-metrics\n"); + else if (show_defaults) + vty_out(vty, " no advertise-high-metrics\n"); +} + +/* * XPath: /frr-isisd:isis/instance/attach-send */ DEFPY_YANG(attached_bit_send, attached_bit_send_cmd, "[no] attached-bit send", @@ -3160,6 +3183,8 @@ void isis_cli_init(void) install_element(ISIS_NODE, &metric_style_cmd); install_element(ISIS_NODE, &no_metric_style_cmd); + install_element(ISIS_NODE, &advertise_high_metrics_cmd); + install_element(ISIS_NODE, &area_passwd_cmd); install_element(ISIS_NODE, &domain_passwd_cmd); install_element(ISIS_NODE, &no_area_passwd_cmd); diff --git a/isisd/isis_nb.c b/isisd/isis_nb.c index 5caa61a4d..7dc3a0eb3 100644 --- a/isisd/isis_nb.c +++ b/isisd/isis_nb.c @@ -82,6 +82,13 @@ const struct frr_yang_module_info frr_isisd_info = { } }, { + .xpath = "/frr-isisd:isis/instance/advertise-high-metrics", + .cbs = { + .cli_show = cli_show_advertise_high_metrics, + .modify = isis_instance_advertise_high_metrics_modify, + } + }, + { .xpath = "/frr-isisd:isis/instance/metric-style", .cbs = { .cli_show = cli_show_isis_metric_style, diff --git a/isisd/isis_nb.h b/isisd/isis_nb.h index c90f6dca3..480b2ce04 100644 --- a/isisd/isis_nb.h +++ b/isisd/isis_nb.h @@ -26,6 +26,7 @@ int isis_instance_attached_receive_modify(struct nb_cb_modify_args *args); int isis_instance_attached_modify(struct nb_cb_modify_args *args); int isis_instance_overload_enabled_modify(struct nb_cb_modify_args *args); int isis_instance_overload_on_startup_modify(struct nb_cb_modify_args *args); +int isis_instance_advertise_high_metrics_modify(struct nb_cb_modify_args *args); int isis_instance_metric_style_modify(struct nb_cb_modify_args *args); int isis_instance_purge_originator_modify(struct nb_cb_modify_args *args); int isis_instance_lsp_mtu_modify(struct nb_cb_modify_args *args); @@ -464,6 +465,9 @@ void cli_show_isis_overload(struct vty *vty, const struct lyd_node *dnode, void cli_show_isis_overload_on_startup(struct vty *vty, const struct lyd_node *dnode, bool show_defaults); +void cli_show_advertise_high_metrics(struct vty *vty, + const struct lyd_node *dnode, + bool show_defaults); void cli_show_isis_metric_style(struct vty *vty, const struct lyd_node *dnode, bool show_defaults); void cli_show_isis_area_pwd(struct vty *vty, const struct lyd_node *dnode, diff --git a/isisd/isis_nb_config.c b/isisd/isis_nb_config.c index ea021a4ff..2b3355bc9 100644 --- a/isisd/isis_nb_config.c +++ b/isisd/isis_nb_config.c @@ -361,6 +361,24 @@ int isis_instance_overload_on_startup_modify(struct nb_cb_modify_args *args) } /* + * XPath: /frr-isisd:isis/instance/advertise-high-metrics + */ +int isis_instance_advertise_high_metrics_modify(struct nb_cb_modify_args *args) +{ + struct isis_area *area; + bool advertise_high_metrics; + + if (args->event != NB_EV_APPLY) + return NB_OK; + + advertise_high_metrics = yang_dnode_get_bool(args->dnode, NULL); + area = nb_running_get_entry(args->dnode, NULL, true); + isis_area_advertise_high_metrics_set(area, advertise_high_metrics); + + return NB_OK; +} + +/* * XPath: /frr-isisd:isis/instance/metric-style */ int isis_instance_metric_style_modify(struct nb_cb_modify_args *args) diff --git a/isisd/isisd.c b/isisd/isisd.c index 852d7b88e..523333300 100644 --- a/isisd/isisd.c +++ b/isisd/isisd.c @@ -2503,6 +2503,9 @@ static void common_isis_summary_vty(struct vty *vty, struct isis *isis) vty_out(vty, " RX counters per PDU type:\n"); pdu_counter_print(vty, " ", area->pdu_rx_counters); + vty_out(vty, " Advertise high metrics: %s\n", + area->advertise_high_metrics ? "Enabled" : "Disabled"); + for (level = ISIS_LEVEL1; level <= ISIS_LEVELS; level++) { if ((area->is_type & level) == 0) continue; @@ -3247,6 +3250,12 @@ void config_end_lsp_generate(struct isis_area *area) } } +void isis_area_advertise_high_metrics_set(struct isis_area *area, + bool advertise_high_metrics) +{ + /* TODO */ +} + /* * Returns the path of the file (non-volatile memory) that contains restart * information. diff --git a/isisd/isisd.h b/isisd/isisd.h index 0f1161e57..37a36fd37 100644 --- a/isisd/isisd.h +++ b/isisd/isisd.h @@ -175,6 +175,8 @@ struct isis_area { uint32_t overload_on_startup_time; /* advertise prefixes of passive interfaces only? */ bool advertise_passive_only; + /* Are we advertising high metrics? */ + bool advertise_high_metrics; /* L1/L2 router identifier for inter-area traffic */ char attached_bit_send; char attached_bit_rcv_ignore; @@ -289,6 +291,8 @@ void isis_area_switchover_routes(struct isis_area *area, int family, void isis_area_overload_bit_set(struct isis_area *area, bool overload_bit); void isis_area_overload_on_startup_set(struct isis_area *area, uint32_t startup_time); +void isis_area_advertise_high_metrics_set(struct isis_area *area, + bool advertise_high_metrics); void isis_area_attached_bit_send_set(struct isis_area *area, bool attached_bit); void isis_area_attached_bit_receive_set(struct isis_area *area, bool attached_bit); |