mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-14 23:53:28 +00:00
isisd: implement the 'database-overload' notification
Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
This commit is contained in:
parent
20600086b2
commit
9414b6f662
@ -2443,6 +2443,48 @@ static int lib_interface_isis_multi_topology_ipv6_dstsrc_modify(
|
||||
ISIS_MT_IPV6_DSTSRC);
|
||||
}
|
||||
|
||||
/*
|
||||
* NOTIFICATIONS
|
||||
*/
|
||||
static void notif_prep_instance_hdr(const char *xpath,
|
||||
const struct isis_area *area,
|
||||
const char *routing_instance,
|
||||
struct list *args)
|
||||
{
|
||||
char xpath_arg[XPATH_MAXLEN];
|
||||
struct yang_data *data;
|
||||
|
||||
snprintf(xpath_arg, sizeof(xpath_arg), "%s/routing-instance", xpath);
|
||||
data = yang_data_new_string(xpath_arg, routing_instance);
|
||||
listnode_add(args, data);
|
||||
snprintf(xpath_arg, sizeof(xpath_arg), "%s/routing-protocol-name",
|
||||
xpath);
|
||||
data = yang_data_new_string(xpath_arg, area->area_tag);
|
||||
listnode_add(args, data);
|
||||
snprintf(xpath_arg, sizeof(xpath_arg), "%s/isis-level", xpath);
|
||||
data = yang_data_new_enum(xpath_arg, area->is_type);
|
||||
listnode_add(args, data);
|
||||
}
|
||||
|
||||
/*
|
||||
* XPath:
|
||||
* /frr-isisd:database-overload
|
||||
*/
|
||||
void isis_notif_db_overload(const struct isis_area *area, bool overload)
|
||||
{
|
||||
const char *xpath = "/frr-isisd:database-overload";
|
||||
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/overload", xpath);
|
||||
data = yang_data_new_enum(xpath_arg, !!overload);
|
||||
listnode_add(arguments, data);
|
||||
|
||||
nb_notification_send(xpath, arguments);
|
||||
}
|
||||
|
||||
/* clang-format off */
|
||||
const struct frr_yang_module_info frr_isisd_info = {
|
||||
.name = "frr-isisd",
|
||||
|
@ -1763,6 +1763,9 @@ void isis_area_overload_bit_set(struct isis_area *area, bool overload_bit)
|
||||
area->overload_bit = new_overload_bit;
|
||||
lsp_regenerate_schedule(area, IS_LEVEL_1 | IS_LEVEL_2, 1);
|
||||
}
|
||||
#ifndef FABRICD
|
||||
isis_notif_db_overload(area, overload_bit);
|
||||
#endif /* ifndef FABRICD */
|
||||
}
|
||||
|
||||
void isis_area_attached_bit_set(struct isis_area *area, bool attached_bit)
|
||||
|
@ -220,6 +220,9 @@ int isis_area_passwd_hmac_md5_set(struct isis_area *area, int level,
|
||||
|
||||
extern const struct frr_yang_module_info frr_isisd_info;
|
||||
extern void isis_northbound_init(void);
|
||||
|
||||
/* YANG northbound notifications */
|
||||
extern void isis_notif_db_overload(const struct isis_area *area, bool overload);
|
||||
/* Master of threads. */
|
||||
extern struct thread_master *master;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user