]> git.puffer.fish Git - mirror/frr.git/commitdiff
isisd: Add log-pdu-drops CLI/YANG support
authorIsabella de Leon <ideleon@microsoft.com>
Thu, 30 Mar 2023 23:25:02 +0000 (16:25 -0700)
committerIsabella de Leon <ideleon@microsoft.com>
Tue, 4 Apr 2023 16:23:16 +0000 (09:23 -0700)
New config functionality:

r1# conf
r1(config)# router isis 1
r1(config-router)# log-
  log-adjacency-changes  Log changes in adjacency state
  log-pdu-drops          Log any dropped PDUs
r1(config-router)# log-pdu-drops
r1(config-router)# end

Signed-off-by: Isabella de Leon <ideleon@microsoft.com>
isisd/isis_cli.c
isisd/isis_nb.c
isisd/isis_nb.h
isisd/isis_nb_config.c
isisd/isisd.h
yang/frr-isisd.yang

index 7e1bb9255c491b984c43f6321e7a1c3bce737c2d..ee51e468587009a15b709b903593f84c874217a7 100644 (file)
@@ -3025,6 +3025,26 @@ void cli_show_isis_log_adjacency(struct vty *vty, const struct lyd_node *dnode,
        vty_out(vty, " log-adjacency-changes\n");
 }
 
+/*
+ * XPath: /frr-isisd:isis/instance/log-pdu-drops
+ */
+DEFPY_YANG(log_pdu_drops, log_pdu_drops_cmd, "[no] log-pdu-drops",
+          NO_STR "Log any dropped PDUs\n")
+{
+       nb_cli_enqueue_change(vty, "./log-pdu-drops", NB_OP_MODIFY,
+                             no ? "false" : "true");
+
+       return nb_cli_apply_changes(vty, NULL);
+}
+
+void cli_show_isis_log_pdu_drops(struct vty *vty, const struct lyd_node *dnode,
+                                bool show_defaults)
+{
+       if (!yang_dnode_get_bool(dnode, NULL))
+               vty_out(vty, " no");
+       vty_out(vty, " log-pdu-drops\n");
+}
+
 /*
  * XPath: /frr-isisd:isis/instance/mpls/ldp-sync
  */
@@ -3290,6 +3310,7 @@ void isis_cli_init(void)
        install_element(INTERFACE_NODE, &isis_ti_lfa_cmd);
 
        install_element(ISIS_NODE, &log_adj_changes_cmd);
+       install_element(ISIS_NODE, &log_pdu_drops_cmd);
 
        install_element(ISIS_NODE, &isis_mpls_ldp_sync_cmd);
        install_element(ISIS_NODE, &no_isis_mpls_ldp_sync_cmd);
index 7dc3a0eb3da6025cc425e478b903a29a26653f0f..9141bfc46ce7b10e5dc1112a56e46f59e3d1a66b 100644 (file)
@@ -558,6 +558,13 @@ const struct frr_yang_module_info frr_isisd_info = {
                                .modify = isis_instance_log_adjacency_changes_modify,
                        },
                },
+               {
+                       .xpath = "/frr-isisd:isis/instance/log-pdu-drops",
+                       .cbs = {
+                               .cli_show = cli_show_isis_log_pdu_drops,
+                               .modify = isis_instance_log_pdu_drops_modify,
+                       },
+               },
                {
                        .xpath = "/frr-isisd:isis/instance/mpls-te",
                        .cbs = {
index 480b2ce04132927a660a08e543ce854b30408c43..9a1f1f786f41febcc2f0705b1bca35cb3af1213f 100644 (file)
@@ -196,6 +196,7 @@ int isis_instance_fast_reroute_level_2_remote_lfa_prefix_list_modify(
 int isis_instance_fast_reroute_level_2_remote_lfa_prefix_list_destroy(
        struct nb_cb_destroy_args *args);
 int isis_instance_log_adjacency_changes_modify(struct nb_cb_modify_args *args);
+int isis_instance_log_pdu_drops_modify(struct nb_cb_modify_args *args);
 int isis_instance_mpls_te_create(struct nb_cb_create_args *args);
 int isis_instance_mpls_te_destroy(struct nb_cb_destroy_args *args);
 int isis_instance_mpls_te_router_address_modify(struct nb_cb_modify_args *args);
@@ -609,6 +610,8 @@ void cli_show_ip_isis_priority(struct vty *vty, const struct lyd_node *dnode,
                               bool show_defaults);
 void cli_show_isis_log_adjacency(struct vty *vty, const struct lyd_node *dnode,
                                 bool show_defaults);
+void cli_show_isis_log_pdu_drops(struct vty *vty, const struct lyd_node *dnode,
+                                bool show_defaults);
 void cli_show_isis_mpls_ldp_sync(struct vty *vty, const struct lyd_node *dnode,
                                 bool show_defaults);
 void cli_show_isis_mpls_ldp_sync_holddown(struct vty *vty,
index 3817465a643a3796b873051873f7a9ce30ab7708..6a9133f20b799dede8e77060565c73c2ee7d1372 100644 (file)
@@ -1829,6 +1829,23 @@ int isis_instance_log_adjacency_changes_modify(struct nb_cb_modify_args *args)
        return NB_OK;
 }
 
+/*
+ * XPath: /frr-isisd:isis/instance/log-pdu-drops
+ */
+int isis_instance_log_pdu_drops_modify(struct nb_cb_modify_args *args)
+{
+       struct isis_area *area;
+       bool log = yang_dnode_get_bool(args->dnode, NULL);
+
+       if (args->event != NB_EV_APPLY)
+               return NB_OK;
+
+       area = nb_running_get_entry(args->dnode, NULL, true);
+       area->log_pdu_drops = log ? 1 : 0;
+
+       return NB_OK;
+}
+
 /*
  * XPath: /frr-isisd:isis/instance/mpls-te
  */
index 0b1f1cb620c18e85b5e461297b135453cbef890a..e0f7ca882ed3fc9204f2bf972af7ab9dcfa04068 100644 (file)
@@ -195,6 +195,8 @@ struct isis_area {
        int ip_circuits;
        /* logging adjacency changes? */
        uint8_t log_adj_changes;
+       /* logging pdu drops? */
+       uint8_t log_pdu_drops;
        /* multi topology settings */
        struct list *mt_settings;
        /* MPLS-TE settings */
index 66ec6a410d5b682c6086183ebc7b1d26573dec46..de925b48238a887dd62f37e0f5edafe775ff71c9 100644 (file)
@@ -1594,6 +1594,13 @@ module frr-isisd {
           "Log changes to the IS-IS adjacencies in this area.";
       }
 
+      leaf log-pdu-drops {
+        type boolean;
+        default "false";
+        description
+          "Log any dropped PDUs in this area.";
+      }
+
       container mpls-te {
         presence "Present if MPLS-TE is enabled.";
         description