mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-11-02 23:19:28 +00:00
isisd: implement the 'if-state-change' notification
Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
This commit is contained in:
parent
56e22fb62c
commit
392b89f39d
@ -667,11 +667,21 @@ int isis_circuit_up(struct isis_circuit *circuit)
|
||||
|
||||
circuit->tx_queue = isis_tx_queue_new(circuit, send_lsp);
|
||||
|
||||
#ifndef FABRICD
|
||||
/* send northbound notification */
|
||||
isis_notif_if_state_change(circuit, false);
|
||||
#endif /* ifndef FABRICD */
|
||||
|
||||
return ISIS_OK;
|
||||
}
|
||||
|
||||
void isis_circuit_down(struct isis_circuit *circuit)
|
||||
{
|
||||
#ifndef FABRICD
|
||||
/* send northbound notification */
|
||||
isis_notif_if_state_change(circuit, true);
|
||||
#endif /* ifndef FABRICD */
|
||||
|
||||
/* Clear the flags for all the lsps of the circuit. */
|
||||
isis_circuit_update_all_srmflags(circuit, 0);
|
||||
|
||||
|
||||
@ -2529,6 +2529,27 @@ void isis_notif_lsp_too_large(const struct isis_circuit *circuit,
|
||||
nb_notification_send(xpath, arguments);
|
||||
}
|
||||
|
||||
/*
|
||||
* XPath:
|
||||
* /frr-isisd:if-state-change
|
||||
*/
|
||||
void isis_notif_if_state_change(const struct isis_circuit *circuit, bool down)
|
||||
{
|
||||
const char *xpath = "/frr-isisd:if-state-change";
|
||||
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/state", xpath);
|
||||
data = yang_data_new_enum(xpath_arg, !!down);
|
||||
listnode_add(arguments, data);
|
||||
|
||||
nb_notification_send(xpath, arguments);
|
||||
}
|
||||
|
||||
/* clang-format off */
|
||||
const struct frr_yang_module_info frr_isisd_info = {
|
||||
.name = "frr-isisd",
|
||||
|
||||
@ -225,6 +225,8 @@ extern void isis_northbound_init(void);
|
||||
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);
|
||||
extern void isis_notif_if_state_change(const struct isis_circuit *circuit,
|
||||
bool down);
|
||||
/* Master of threads. */
|
||||
extern struct thread_master *master;
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user