]> git.puffer.fish Git - matthieu/frr.git/commitdiff
isisd: implemented the 'own-lsp-purge' notification
authorEmanuele Di Pascale <emanuele@voltanet.io>
Wed, 14 Nov 2018 15:27:51 +0000 (16:27 +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 f76d85cc36221eb64c052bf919af70ce770034ff..9d7371c9c4baf82bee822eebcae353c716e7ca7f 100644 (file)
@@ -2913,6 +2913,28 @@ void isis_notif_seqno_skipped(const struct isis_circuit *circuit,
        nb_notification_send(xpath, arguments);
 }
 
+/*
+ * XPath:
+ * /frr-isisd:own-lsp-purge
+ */
+void isis_notif_own_lsp_purge(const struct isis_circuit *circuit,
+                             const char *lsp_id)
+{
+       const char *xpath = "/frr-isisd:own-lsp-purge";
+       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 a5ec27e47eaea390a46f2b73fefea4fb7abdb707..330da9b216b62a5c760200dacf64f6bb0b3adf57 100644 (file)
@@ -1117,6 +1117,13 @@ dontcheckadj:
                                                circuit->area->area_tag,
                                                rawlspid_print(hdr.lsp_id),
                                                lsp->hdr.seqno);
+                       } else {
+                               /* our own LSP with 0 remaining life time */
+#ifndef FABRICD
+                               /* send northbound notification */
+                               isis_notif_own_lsp_purge(
+                                       circuit, rawlspid_print(hdr.lsp_id));
+#endif /* ifndef FABRICD */
                        }
                }
                goto out;
index 9d0d7f690f5802e1ed7e80af41d69992b8a4317c..fb879395c1b70ec8cf9c51140933a858fcc9e698 100644 (file)
@@ -261,6 +261,9 @@ extern void isis_notif_lsp_error(const struct isis_circuit *circuit,
                                 uint32_t offset, uint8_t tlv_type);
 extern void isis_notif_seqno_skipped(const struct isis_circuit *circuit,
                                     const char *lsp_id);
+extern void isis_notif_own_lsp_purge(const struct isis_circuit *circuit,
+                                    const char *lsp_id);
+
 /* Master of threads. */
 extern struct thread_master *master;