isisd: implement the 'attempt-to-exceed-max-sequence' notification

Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
This commit is contained in:
Emanuele Di Pascale 2018-11-14 15:08:26 +01:00
parent a23705455f
commit b21b068dc9
3 changed files with 30 additions and 0 deletions

View File

@ -355,6 +355,15 @@ void lsp_inc_seqno(struct isis_lsp *lsp, uint32_t seqno)
else
newseq = seqno + 1;
#ifndef FABRICD
/* check for overflow */
if (newseq < lsp->hdr.seqno) {
/* send northbound notification */
isis_notif_lsp_exceed_max(lsp->area,
rawlspid_print(lsp->hdr.lsp_id));
}
#endif /* ifndef FABRICD */
lsp->hdr.seqno = newseq;
lsp_pack_pdu(lsp);

View File

@ -2569,6 +2569,25 @@ void isis_notif_corrupted_lsp(const struct isis_area *area, const char *lsp_id)
nb_notification_send(xpath, arguments);
}
/*
* XPath:
* /frr-isisd:attempt-to-exceed-max-sequence
*/
void isis_notif_lsp_exceed_max(const struct isis_area *area, const char *lsp_id)
{
const char *xpath = "/frr-isisd:attempt-to-exceed-max-sequence";
struct list *arguments = yang_data_list_new();
char xpath_arg[XPATH_MAXLEN];
struct yang_data *data;
notif_prep_instance_hdr(xpath, area, "default", arguments);
snprintf(xpath_arg, sizeof(xpath_arg), "%s/lsp-id", xpath);
data = yang_data_new_string(xpath_arg, lsp_id);
listnode_add(arguments, data);
nb_notification_send(xpath, arguments);
}
/* clang-format off */
const struct frr_yang_module_info frr_isisd_info = {
.name = "frr-isisd",

View File

@ -229,6 +229,8 @@ extern void isis_notif_if_state_change(const struct isis_circuit *circuit,
bool down);
extern void isis_notif_corrupted_lsp(const struct isis_area *area,
const char *lsp_id); /* currently unused */
extern void isis_notif_lsp_exceed_max(const struct isis_area *area,
const char *lsp_id);
/* Master of threads. */
extern struct thread_master *master;