]> git.proxmox.com Git - mirror_frr.git/commitdiff
isisd: implemented the 'sequence-number-skipped' notification
authorEmanuele Di Pascale <emanuele@voltanet.io>
Wed, 14 Nov 2018 15:09:43 +0000 (16:09 +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_northbound.c
isisd/isis_pdu.c
isisd/isisd.h

index 1b6f46feb1ad57639cf0e0ae5291e3cae6b80c83..f76d85cc36221eb64c052bf919af70ce770034ff 100644 (file)
@@ -2891,6 +2891,28 @@ void isis_notif_lsp_error(const struct isis_circuit *circuit,
        nb_notification_send(xpath, arguments);
 }
 
+/*
+ * XPath:
+ * /frr-isisd:sequence-number-skipped
+ */
+void isis_notif_seqno_skipped(const struct isis_circuit *circuit,
+                             const char *lsp_id)
+{
+       const char *xpath = "/frr-isisd:sequence-number-skipped";
+       struct list *arguments = yang_data_list_new();
+       char xpath_arg[XPATH_MAXLEN];
+       struct yang_data *data;
+       struct isis_area *area = circuit->area;
+
+       notif_prep_instance_hdr(xpath, area, "default", arguments);
+       notif_prepr_iface_hdr(xpath, circuit, 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 2db07ea79ecc360c95e41b35e9a98f38bd7cfa84..a5ec27e47eaea390a46f2b73fefea4fb7abdb707 100644 (file)
@@ -1091,6 +1091,16 @@ dontcheckadj:
                        } else if (lsp->hdr.rem_lifetime != 0) {
                                /* our own LSP -> 7.3.16.4 c) */
                                if (comp == LSP_NEWER) {
+#ifndef FABRICD
+                                       if (lsp->hdr.seqno < hdr.seqno) {
+                                               /* send northbound
+                                                * notification */
+                                               isis_notif_seqno_skipped(
+                                                       circuit,
+                                                       rawlspid_print(
+                                                               hdr.lsp_id));
+                                       }
+#endif /* ifndef FABRICD */
                                        lsp_inc_seqno(lsp, hdr.seqno);
                                        lsp_flood_or_update(lsp, NULL,
                                                            circuit_scoped);
@@ -1131,6 +1141,11 @@ dontcheckadj:
                if (comp == LSP_NEWER) {
                        /* 7.3.16.1  */
                        lsp_inc_seqno(lsp, hdr.seqno);
+#ifndef FABRICD
+                       /* send northbound notification */
+                       isis_notif_seqno_skipped(circuit,
+                                                rawlspid_print(hdr.lsp_id));
+#endif /* ifndef FABRICD */
                        if (isis->debugs & DEBUG_UPDATE_PACKETS) {
                                zlog_debug(
                                        "ISIS-Upd (%s): (2) re-originating LSP %s new seq 0x%08" PRIx32,
index 199e64b442a2e0652f6cc3ffc4ef09794a4aca77..9d0d7f690f5802e1ed7e80af41d69992b8a4317c 100644 (file)
@@ -259,6 +259,8 @@ extern void isis_notif_version_skew(const struct isis_circuit *circuit,
 extern void isis_notif_lsp_error(const struct isis_circuit *circuit,
                                 const char *lsp_id, const char *raw_pdu,
                                 uint32_t offset, uint8_t tlv_type);
+extern void isis_notif_seqno_skipped(const struct isis_circuit *circuit,
+                                    const char *lsp_id);
 /* Master of threads. */
 extern struct thread_master *master;