summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEmanuele Di Pascale <emanuele@voltanet.io>2018-11-14 15:27:10 +0100
committerEmanuele Di Pascale <emanuele@voltanet.io>2018-12-18 15:24:46 +0100
commit9d92b84be7f5088fe0aebd870b1ed15b9c1fb1a6 (patch)
tree2524ee3347eb51aa56856c2dbef6edcb90998f07
parentisisd: implement the 'rejected-adjacency' notification (diff)
downloadfrr-9d92b84be7f5088fe0aebd870b1ed15b9c1fb1a6.tar.xz
frr-9d92b84be7f5088fe0aebd870b1ed15b9c1fb1a6.zip
isisd: implement the 'area-mismatch' notification
Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
-rw-r--r--isisd/isis_northbound.c22
-rw-r--r--isisd/isis_pdu.c8
-rw-r--r--isisd/isisd.h2
3 files changed, 32 insertions, 0 deletions
diff --git a/isisd/isis_northbound.c b/isisd/isis_northbound.c
index ec8bd8f1d..cb61c93e1 100644
--- a/isisd/isis_northbound.c
+++ b/isisd/isis_northbound.c
@@ -2733,6 +2733,28 @@ void isis_notif_reject_adjacency(const struct isis_circuit *circuit,
nb_notification_send(xpath, arguments);
}
+/*
+ * XPath:
+ * /frr-isisd:area-mismatch
+ */
+void isis_notif_area_mismatch(const struct isis_circuit *circuit,
+ const char *raw_pdu)
+{
+ const char *xpath = "/frr-isisd:area-mismatch";
+ 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/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 49869ccba..6b8758f5f 100644
--- a/isisd/isis_pdu.c
+++ b/isisd/isis_pdu.c
@@ -683,6 +683,10 @@ static int process_hello(uint8_t pdu_type, struct isis_circuit *circuit,
if (!iih.tlvs->area_addresses.count) {
zlog_warn("No Area addresses TLV in %s", pdu_name);
+#ifndef FABRICD
+ /* send northbound notification */
+ isis_notif_area_mismatch(circuit, raw_pdu);
+#endif /* ifndef FABRICD */
goto out;
}
@@ -736,6 +740,10 @@ static int process_hello(uint8_t pdu_type, struct isis_circuit *circuit,
circuit->area->area_tag, level,
circuit->interface->name);
}
+#ifndef FABRICD
+ /* send northbound notification */
+ isis_notif_area_mismatch(circuit, raw_pdu);
+#endif /* ifndef FABRICD */
goto out;
}
diff --git a/isisd/isisd.h b/isisd/isisd.h
index f934d076d..5169ccb28 100644
--- a/isisd/isisd.h
+++ b/isisd/isisd.h
@@ -245,6 +245,8 @@ extern void isis_notif_adj_state_change(const struct isis_adjacency *adj,
extern void isis_notif_reject_adjacency(const struct isis_circuit *circuit,
const char *reason,
const char *raw_pdu);
+extern void isis_notif_area_mismatch(const struct isis_circuit *circuit,
+ const char *raw_pdu);
/* Master of threads. */
extern struct thread_master *master;