mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-06 06:14:35 +00:00
isisd: implement the 'lsp-too-large' notification
Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
This commit is contained in:
parent
9414b6f662
commit
56e22fb62c
@ -2466,6 +2466,25 @@ static void notif_prep_instance_hdr(const char *xpath,
|
|||||||
listnode_add(args, data);
|
listnode_add(args, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void notif_prepr_iface_hdr(const char *xpath,
|
||||||
|
const struct isis_circuit *circuit,
|
||||||
|
struct list *args)
|
||||||
|
{
|
||||||
|
char xpath_arg[XPATH_MAXLEN];
|
||||||
|
struct yang_data *data;
|
||||||
|
|
||||||
|
snprintf(xpath_arg, sizeof(xpath_arg), "%s/interface-name", xpath);
|
||||||
|
data = yang_data_new_string(xpath_arg, circuit->interface->name);
|
||||||
|
listnode_add(args, data);
|
||||||
|
snprintf(xpath_arg, sizeof(xpath_arg), "%s/interface-level", xpath);
|
||||||
|
data = yang_data_new_enum(xpath_arg, circuit->is_type);
|
||||||
|
listnode_add(args, data);
|
||||||
|
snprintf(xpath_arg, sizeof(xpath_arg), "%s/extended-circuit-id", xpath);
|
||||||
|
/* we do not seem to have the extended version of the circuit_id */
|
||||||
|
data = yang_data_new_uint32(xpath_arg, (uint32_t)circuit->circuit_id);
|
||||||
|
listnode_add(args, data);
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* XPath:
|
* XPath:
|
||||||
* /frr-isisd:database-overload
|
* /frr-isisd:database-overload
|
||||||
@ -2485,6 +2504,31 @@ void isis_notif_db_overload(const struct isis_area *area, bool overload)
|
|||||||
nb_notification_send(xpath, arguments);
|
nb_notification_send(xpath, arguments);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* XPath:
|
||||||
|
* /frr-isisd:lsp-too-large
|
||||||
|
*/
|
||||||
|
void isis_notif_lsp_too_large(const struct isis_circuit *circuit,
|
||||||
|
uint32_t pdu_size, const char *lsp_id)
|
||||||
|
{
|
||||||
|
const char *xpath = "/frr-isisd:lsp-too-large";
|
||||||
|
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-size", xpath);
|
||||||
|
data = yang_data_new_uint32(xpath_arg, pdu_size);
|
||||||
|
listnode_add(arguments, data);
|
||||||
|
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 */
|
/* 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",
|
||||||
|
@ -2238,6 +2238,11 @@ void send_lsp(struct isis_circuit *circuit, struct isis_lsp *lsp,
|
|||||||
lsp->hdr.checksum, lsp->hdr.rem_lifetime,
|
lsp->hdr.checksum, lsp->hdr.rem_lifetime,
|
||||||
circuit->interface->name, stream_get_endp(lsp->pdu),
|
circuit->interface->name, stream_get_endp(lsp->pdu),
|
||||||
stream_get_size(circuit->snd_stream));
|
stream_get_size(circuit->snd_stream));
|
||||||
|
#ifndef FABRICD
|
||||||
|
/* send a northbound notification */
|
||||||
|
isis_notif_lsp_too_large(circuit, stream_get_endp(lsp->pdu),
|
||||||
|
rawlspid_print(lsp->hdr.lsp_id));
|
||||||
|
#endif /* ifndef FABRICD */
|
||||||
if (isis->debugs & DEBUG_PACKET_DUMP)
|
if (isis->debugs & DEBUG_PACKET_DUMP)
|
||||||
zlog_dump_data(STREAM_DATA(lsp->pdu),
|
zlog_dump_data(STREAM_DATA(lsp->pdu),
|
||||||
stream_get_endp(lsp->pdu));
|
stream_get_endp(lsp->pdu));
|
||||||
|
@ -223,6 +223,8 @@ extern void isis_northbound_init(void);
|
|||||||
|
|
||||||
/* YANG northbound notifications */
|
/* YANG northbound notifications */
|
||||||
extern void isis_notif_db_overload(const struct isis_area *area, bool overload);
|
extern void isis_notif_db_overload(const struct isis_area *area, bool overload);
|
||||||
|
extern void isis_notif_lsp_too_large(const struct isis_circuit *circuit,
|
||||||
|
uint32_t pdu_size, const char *lsp_id);
|
||||||
/* Master of threads. */
|
/* Master of threads. */
|
||||||
extern struct thread_master *master;
|
extern struct thread_master *master;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user