mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-13 21:01:47 +00:00
isisd: implement the 'id-len-mismatch' notification
Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
This commit is contained in:
parent
998011fa8b
commit
e98d763376
@ -2813,6 +2813,31 @@ void isis_notif_lsp_gen(const struct isis_area *area, const char *lsp_id,
|
||||
nb_notification_send(xpath, arguments);
|
||||
}
|
||||
|
||||
/*
|
||||
* XPath:
|
||||
* /frr-isisd:id-len-mismatch
|
||||
*/
|
||||
void isis_notif_id_len_mismatch(const struct isis_circuit *circuit,
|
||||
uint8_t rcv_id_len, const char *raw_pdu)
|
||||
{
|
||||
const char *xpath = "/frr-isisd:id-len-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/pdu-field-len", xpath);
|
||||
data = yang_data_new_uint8(xpath_arg, rcv_id_len);
|
||||
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",
|
||||
|
@ -1584,6 +1584,10 @@ int isis_handle_pdu(struct isis_circuit *circuit, uint8_t *ssnpa)
|
||||
"IDFieldLengthMismatch: ID Length field in a received PDU %" PRIu8
|
||||
", while the parameter for this IS is %u",
|
||||
id_len, ISIS_SYS_ID_LEN);
|
||||
#ifndef FABRICD
|
||||
/* send northbound notification */
|
||||
isis_notif_id_len_mismatch(circuit, id_len, raw_pdu);
|
||||
#endif /* ifndef FABRICD */
|
||||
return ISIS_ERROR;
|
||||
}
|
||||
|
||||
|
@ -252,6 +252,8 @@ extern void isis_notif_lsp_received(const struct isis_circuit *circuit,
|
||||
uint32_t timestamp, const char *sys_id);
|
||||
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);
|
||||
/* Master of threads. */
|
||||
extern struct thread_master *master;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user