nb_notification_send(xpath, arguments);
}
+/*
+ * XPath:
+ * /frr-isisd:lsp-error-detected
+ */
+void isis_notif_lsp_error(const struct isis_circuit *circuit,
+ const char *lsp_id, const char *raw_pdu,
+ __attribute__((unused)) uint32_t offset,
+ __attribute__((unused)) uint8_t tlv_type)
+{
+ const char *xpath = "/frr-isisd:lsp-error-detected";
+ 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);
+ snprintf(xpath_arg, sizeof(xpath_arg), "%s/raw-pdu", xpath);
+ data = yang_data_new(xpath_arg, raw_pdu);
+ listnode_add(arguments, data);
+ /* ignore offset and tlv_type which cannot be set properly */
+
+ nb_notification_send(xpath, arguments);
+}
+
/* clang-format off */
const struct frr_yang_module_info frr_isisd_info = {
.name = "frr-isisd",
circuit->rcv_stream, &tlvs, &error_log)) {
zlog_warn("Something went wrong unpacking the LSP: %s",
error_log);
+#ifndef FABRICD
+ /* send northbound notification. Note that the tlv-type and
+ * offset cannot correctly be set here as they are not returned
+ * by isis_unpack_tlvs, but in there I cannot fire a
+ * notification because I have no circuit information. So until
+ * we change the code above to return those extra fields, we
+ * will send dummy values which are ignored in the callback
+ */
+ isis_notif_lsp_error(circuit, rawlspid_print(hdr.lsp_id),
+ raw_pdu, 0, 0);
+#endif /* ifndef FABRICD */
goto out;
}
uint8_t rcv_id_len, const char *raw_pdu);
extern void isis_notif_version_skew(const struct isis_circuit *circuit,
uint8_t version, const char *raw_pdu);
+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);
/* Master of threads. */
extern struct thread_master *master;