]> git.proxmox.com Git - mirror_frr.git/commitdiff
isisd: implement the 'attempt-to-exceed-max-sequence' notification
authorEmanuele Di Pascale <emanuele@voltanet.io>
Wed, 14 Nov 2018 14:08:26 +0000 (15:08 +0100)
committerEmanuele Di Pascale <emanuele@voltanet.io>
Tue, 18 Dec 2018 14:24:46 +0000 (15:24 +0100)
Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
isisd/isis_lsp.c
isisd/isis_northbound.c
isisd/isisd.h

index 8d393c7a08f8113e795ec8e8ccbd523222d08789..8b2af9975ce35d6dc46ebad0cbc507b5058ea7fd 100644 (file)
@@ -355,6 +355,15 @@ void lsp_inc_seqno(struct isis_lsp *lsp, uint32_t seqno)
        else
                newseq = seqno + 1;
 
+#ifndef FABRICD
+       /* check for overflow */
+       if (newseq < lsp->hdr.seqno) {
+               /* send northbound notification */
+               isis_notif_lsp_exceed_max(lsp->area,
+                                         rawlspid_print(lsp->hdr.lsp_id));
+       }
+#endif /* ifndef FABRICD */
+
        lsp->hdr.seqno = newseq;
 
        lsp_pack_pdu(lsp);
index 136fec23757bf64beb0da4c08b8b6662447be324..c112c64ca1d5a25d6a96dc15ca8633a438949669 100644 (file)
@@ -2569,6 +2569,25 @@ void isis_notif_corrupted_lsp(const struct isis_area *area, const char *lsp_id)
        nb_notification_send(xpath, arguments);
 }
 
+/*
+ * XPath:
+ * /frr-isisd:attempt-to-exceed-max-sequence
+ */
+void isis_notif_lsp_exceed_max(const struct isis_area *area, const char *lsp_id)
+{
+       const char *xpath = "/frr-isisd:attempt-to-exceed-max-sequence";
+       struct list *arguments = yang_data_list_new();
+       char xpath_arg[XPATH_MAXLEN];
+       struct yang_data *data;
+
+       notif_prep_instance_hdr(xpath, area, "default", arguments);
+       snprintf(xpath_arg, sizeof(xpath_arg), "%s/lsp-id", xpath);
+       data = yang_data_new_string(xpath_arg, lsp_id);
+       listnode_add(arguments, data);
+
+       nb_notification_send(xpath, arguments);
+}
+
 /* clang-format off */
 const struct frr_yang_module_info frr_isisd_info = {
        .name = "frr-isisd",
index 12d3f2bec21fce98e4502353563565f584527f05..6f32dbdd58804112230a64000eceb9a59f8725f2 100644 (file)
@@ -229,6 +229,8 @@ extern void isis_notif_if_state_change(const struct isis_circuit *circuit,
                                       bool down);
 extern void isis_notif_corrupted_lsp(const struct isis_area *area,
                                     const char *lsp_id); /* currently unused */
+extern void isis_notif_lsp_exceed_max(const struct isis_area *area,
+                                     const char *lsp_id);
 /* Master of threads. */
 extern struct thread_master *master;