summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--isisd/isis_northbound.c25
-rw-r--r--isisd/isis_pdu.c8
-rw-r--r--isisd/isisd.h2
3 files changed, 35 insertions, 0 deletions
diff --git a/isisd/isis_northbound.c b/isisd/isis_northbound.c
index c6cc8515d..593f5be05 100644
--- a/isisd/isis_northbound.c
+++ b/isisd/isis_northbound.c
@@ -2838,6 +2838,31 @@ void isis_notif_id_len_mismatch(const struct isis_circuit *circuit,
nb_notification_send(xpath, arguments);
}
+/*
+ * XPath:
+ * /frr-isisd:version-skew
+ */
+void isis_notif_version_skew(const struct isis_circuit *circuit,
+ uint8_t version, const char *raw_pdu)
+{
+ const char *xpath = "/frr-isisd:version-skew";
+ 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/protocol-version", xpath);
+ data = yang_data_new_uint8(xpath_arg, version);
+ 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);
+
+ nb_notification_send(xpath, arguments);
+}
+
/* clang-format off */
const struct frr_yang_module_info frr_isisd_info = {
.name = "frr-isisd",
diff --git a/isisd/isis_pdu.c b/isisd/isis_pdu.c
index b6586b94a..219900bba 100644
--- a/isisd/isis_pdu.c
+++ b/isisd/isis_pdu.c
@@ -1575,6 +1575,10 @@ int isis_handle_pdu(struct isis_circuit *circuit, uint8_t *ssnpa)
if (version1 != 1) {
zlog_warn("Unsupported ISIS version %" PRIu8, version1);
+#ifndef FABRICD
+ /* send northbound notification */
+ isis_notif_version_skew(circuit, version1, raw_pdu);
+#endif /* ifndef FABRICD */
return ISIS_WARNING;
}
@@ -1614,6 +1618,10 @@ int isis_handle_pdu(struct isis_circuit *circuit, uint8_t *ssnpa)
if (version2 != 1) {
zlog_warn("Unsupported ISIS PDU version %" PRIu8, version2);
+#ifndef FABRICD
+ /* send northbound notification */
+ isis_notif_version_skew(circuit, version2, raw_pdu);
+#endif /* ifndef FABRICD */
return ISIS_WARNING;
}
diff --git a/isisd/isisd.h b/isisd/isisd.h
index e69023f45..87d206514 100644
--- a/isisd/isisd.h
+++ b/isisd/isisd.h
@@ -254,6 +254,8 @@ extern void isis_notif_lsp_gen(const struct isis_area *area, const char *lsp_id,
uint32_t seqno, uint32_t timestamp);
extern void isis_notif_id_len_mismatch(const struct isis_circuit *circuit,
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);
/* Master of threads. */
extern struct thread_master *master;