mirror of
https://github.com/FRRouting/frr.git
synced 2026-01-16 23:14:01 +00:00
isisd: Do not use yang:timestamp
yang:timestamp is meant for backwards compatability with SNMP. This is a mistake in that it's a weird time since the epoch in 32 bits. Which is not good enough anymore. Convert the isisd yang to use the unix-timestamps as defined by FRR and convert the functions to return it properly. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
This commit is contained in:
parent
a6013a91be
commit
02cc33f694
3 changed files with 16 additions and 14 deletions
|
|
@ -765,11 +765,10 @@ void isis_notif_reject_adjacency(const struct isis_circuit *circuit,
|
|||
size_t raw_pdu_len);
|
||||
void isis_notif_area_mismatch(const struct isis_circuit *circuit,
|
||||
const char *raw_pdu, size_t raw_pdu_len);
|
||||
void isis_notif_lsp_received(const struct isis_circuit *circuit,
|
||||
const uint8_t *lsp_id, uint32_t seqno,
|
||||
uint32_t timestamp, const char *sys_id);
|
||||
void isis_notif_lsp_gen(const struct isis_area *area, const uint8_t *lsp_id,
|
||||
uint32_t seqno, uint32_t timestamp);
|
||||
void isis_notif_lsp_received(const struct isis_circuit *circuit, const uint8_t *lsp_id,
|
||||
uint32_t seqno, time_t timestamp, const char *sys_id);
|
||||
void isis_notif_lsp_gen(const struct isis_area *area, const uint8_t *lsp_id, uint32_t seqno,
|
||||
time_t timestamp);
|
||||
void isis_notif_id_len_mismatch(const struct isis_circuit *circuit,
|
||||
uint8_t rcv_id_len, const char *raw_pdu,
|
||||
size_t raw_pdu_len);
|
||||
|
|
|
|||
|
|
@ -390,9 +390,8 @@ void isis_notif_area_mismatch(const struct isis_circuit *circuit,
|
|||
/*
|
||||
* XPath: /frr-isisd:lsp-received
|
||||
*/
|
||||
void isis_notif_lsp_received(const struct isis_circuit *circuit,
|
||||
const uint8_t *lsp_id, uint32_t seqno,
|
||||
uint32_t timestamp, const char *sys_id)
|
||||
void isis_notif_lsp_received(const struct isis_circuit *circuit, const uint8_t *lsp_id,
|
||||
uint32_t seqno, time_t timestamp, const char *sys_id)
|
||||
{
|
||||
const char *xpath = "/frr-isisd:lsp-received";
|
||||
struct list *arguments = yang_data_list_new();
|
||||
|
|
@ -411,7 +410,7 @@ void isis_notif_lsp_received(const struct isis_circuit *circuit,
|
|||
data = yang_data_new_uint32(xpath_arg, seqno);
|
||||
listnode_add(arguments, data);
|
||||
snprintf(xpath_arg, sizeof(xpath_arg), "%s/received-timestamp", xpath);
|
||||
data = yang_data_new_uint32(xpath_arg, timestamp);
|
||||
data = yang_data_new_uint64(xpath_arg, timestamp);
|
||||
listnode_add(arguments, data);
|
||||
snprintf(xpath_arg, sizeof(xpath_arg), "%s/neighbor-system-id", xpath);
|
||||
data = yang_data_new_string(xpath_arg, sys_id);
|
||||
|
|
@ -423,8 +422,8 @@ void isis_notif_lsp_received(const struct isis_circuit *circuit,
|
|||
/*
|
||||
* XPath: /frr-isisd:lsp-generation
|
||||
*/
|
||||
void isis_notif_lsp_gen(const struct isis_area *area, const uint8_t *lsp_id,
|
||||
uint32_t seqno, uint32_t timestamp)
|
||||
void isis_notif_lsp_gen(const struct isis_area *area, const uint8_t *lsp_id, uint32_t seqno,
|
||||
time_t timestamp)
|
||||
{
|
||||
const char *xpath = "/frr-isisd:lsp-generation";
|
||||
struct list *arguments = yang_data_list_new();
|
||||
|
|
@ -441,7 +440,7 @@ void isis_notif_lsp_gen(const struct isis_area *area, const uint8_t *lsp_id,
|
|||
data = yang_data_new_uint32(xpath_arg, seqno);
|
||||
listnode_add(arguments, data);
|
||||
snprintf(xpath_arg, sizeof(xpath_arg), "%s/send-timestamp", xpath);
|
||||
data = yang_data_new_uint32(xpath_arg, timestamp);
|
||||
data = yang_data_new_uint64(xpath_arg, timestamp);
|
||||
listnode_add(arguments, data);
|
||||
|
||||
nb_notification_send(xpath, arguments);
|
||||
|
|
|
|||
|
|
@ -28,6 +28,10 @@ module frr-isisd {
|
|||
prefix frr-route-types;
|
||||
}
|
||||
|
||||
import frr-routing {
|
||||
prefix frr-rt;
|
||||
}
|
||||
|
||||
organization
|
||||
"FRRouting";
|
||||
contact
|
||||
|
|
@ -2550,7 +2554,7 @@ module frr-isisd {
|
|||
}
|
||||
|
||||
leaf received-timestamp {
|
||||
type yang:timestamp;
|
||||
type frr-rt:unix-timestamp;
|
||||
description
|
||||
"Timestamp when the LSP was received.";
|
||||
}
|
||||
|
|
@ -2582,7 +2586,7 @@ module frr-isisd {
|
|||
}
|
||||
|
||||
leaf send-timestamp {
|
||||
type yang:timestamp;
|
||||
type frr-rt:unix-timestamp;
|
||||
description
|
||||
"Timestamp when our LSP was regenerated.";
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue