return NB_OK;
}
+/*
+ * XPath: /frr-ripd:authentication-type-failure
+ */
+void ripd_notif_send_auth_type_failure(const char *ifname)
+{
+ const char *xpath = "/frr-ripd:authentication-type-failure";
+ struct list *arguments;
+ char xpath_arg[XPATH_MAXLEN];
+ struct yang_data *data;
+
+ arguments = yang_data_list_new();
+
+ snprintf(xpath_arg, sizeof(xpath_arg), "%s/interface-name", xpath);
+ data = yang_data_new_string(xpath_arg, ifname);
+ listnode_add(arguments, data);
+
+ nb_notification_send(xpath, arguments);
+}
+
+/*
+ * XPath: /frr-ripd:authentication-failure
+ */
+void ripd_notif_send_auth_failure(const char *ifname)
+{
+ const char *xpath = "/frr-ripd:authentication-failure";
+ struct list *arguments;
+ char xpath_arg[XPATH_MAXLEN];
+ struct yang_data *data;
+
+ arguments = yang_data_list_new();
+
+ snprintf(xpath_arg, sizeof(xpath_arg), "%s/interface-name", xpath);
+ data = yang_data_new_string(xpath_arg, ifname);
+ listnode_add(arguments, data);
+
+ nb_notification_send(xpath, arguments);
+}
+
/* clang-format off */
const struct frr_yang_module_info frr_ripd_info = {
.name = "frr-ripd",
zlog_debug(
"packet RIPv%d is dropped because authentication disabled",
packet->version);
+ ripd_notif_send_auth_type_failure(ifp->name);
rip_peer_bad_packet(&from);
return -1;
}
zlog_debug(
"RIPv1"
" dropped because authentication enabled");
+ ripd_notif_send_auth_type_failure(ifp->name);
rip_peer_bad_packet(&from);
return -1;
}
if (IS_RIP_DEBUG_PACKET)
zlog_debug(
"RIPv2 authentication failed: no auth RTE in packet");
+ ripd_notif_send_auth_type_failure(ifp->name);
rip_peer_bad_packet(&from);
return -1;
}
zlog_debug(
"RIPv2"
" dropped because authentication enabled");
+ ripd_notif_send_auth_type_failure(ifp->name);
rip_peer_bad_packet(&from);
return -1;
}
if (IS_RIP_DEBUG_PACKET)
zlog_debug("RIPv2 %s authentication failure",
auth_desc);
+ ripd_notif_send_auth_failure(ifp->name);
rip_peer_bad_packet(&from);
return -1;
}
extern void rip_offset_init(void);
extern void rip_offset_clean(void);
+/* YANG notifications */
+extern void ripd_notif_send_auth_type_failure(const char *ifname);
+extern void ripd_notif_send_auth_failure(const char *ifname);
+
/* There is only one rip strucutre. */
extern struct rip *rip;