mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-08 05:27:47 +00:00
isisd: implement the 'version-skew' notification
Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
This commit is contained in:
parent
e98d763376
commit
0532bd84ab
@ -2838,6 +2838,31 @@ void isis_notif_id_len_mismatch(const struct isis_circuit *circuit,
|
|||||||
nb_notification_send(xpath, arguments);
|
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 */
|
/* clang-format off */
|
||||||
const struct frr_yang_module_info frr_isisd_info = {
|
const struct frr_yang_module_info frr_isisd_info = {
|
||||||
.name = "frr-isisd",
|
.name = "frr-isisd",
|
||||||
|
@ -1575,6 +1575,10 @@ int isis_handle_pdu(struct isis_circuit *circuit, uint8_t *ssnpa)
|
|||||||
|
|
||||||
if (version1 != 1) {
|
if (version1 != 1) {
|
||||||
zlog_warn("Unsupported ISIS version %" PRIu8, version1);
|
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;
|
return ISIS_WARNING;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1614,6 +1618,10 @@ int isis_handle_pdu(struct isis_circuit *circuit, uint8_t *ssnpa)
|
|||||||
|
|
||||||
if (version2 != 1) {
|
if (version2 != 1) {
|
||||||
zlog_warn("Unsupported ISIS PDU version %" PRIu8, version2);
|
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;
|
return ISIS_WARNING;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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);
|
uint32_t seqno, uint32_t timestamp);
|
||||||
extern void isis_notif_id_len_mismatch(const struct isis_circuit *circuit,
|
extern void isis_notif_id_len_mismatch(const struct isis_circuit *circuit,
|
||||||
uint8_t rcv_id_len, const char *raw_pdu);
|
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. */
|
/* Master of threads. */
|
||||||
extern struct thread_master *master;
|
extern struct thread_master *master;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user