mirror of
https://github.com/rtbrick/bngblaster.git
synced 2024-05-06 15:54:57 +00:00
ISIS logging and P2P state #97
This commit is contained in:
committed by
Christian Giese
parent
92fe68529c
commit
5d257dc0c2
@@ -94,8 +94,10 @@ isis_adjacency_up(isis_adjacency_t *adjacency) {
|
||||
return;
|
||||
}
|
||||
|
||||
LOG(ISIS, "ISIS %s adjacency UP on interface %s \n",
|
||||
isis_level_string(adjacency->level), adjacency->interface->name);
|
||||
LOG(ISIS, "ISIS %s adjacency UP to %s on interface %s \n",
|
||||
isis_level_string(adjacency->level),
|
||||
isis_system_id_to_str(adjacency->peer->system_id),
|
||||
adjacency->interface->name);
|
||||
|
||||
adjacency->state = ISIS_ADJACENCY_STATE_UP;
|
||||
|
||||
@@ -136,8 +138,10 @@ isis_adjacency_down(isis_adjacency_t *adjacency) {
|
||||
return;
|
||||
}
|
||||
|
||||
LOG(ISIS, "ISIS %s adjacency DOWN on interface %s \n",
|
||||
isis_level_string(adjacency->level), adjacency->interface->name);
|
||||
LOG(ISIS, "ISIS %s adjacency DOWN to %s on interface %s \n",
|
||||
isis_level_string(adjacency->level),
|
||||
isis_system_id_to_str(adjacency->peer->system_id),
|
||||
adjacency->interface->name);
|
||||
|
||||
adjacency->state = ISIS_ADJACENCY_STATE_DOWN;
|
||||
|
||||
|
||||
@@ -9,24 +9,32 @@
|
||||
#include "isis.h"
|
||||
|
||||
void
|
||||
isis_hello_timeout (timer_s *timer) {
|
||||
isis_p2p_hello_timeout(timer_s *timer) {
|
||||
bbl_interface_s *interface = timer->data;
|
||||
interface->send_requests |= BBL_IF_SEND_ISIS_P2P_HELLO;
|
||||
}
|
||||
|
||||
void
|
||||
isis_holding_timeout(timer_s *timer) {
|
||||
isis_p2p_holding_timeout(timer_s *timer) {
|
||||
isis_adjacency_t *adjacency = timer->data;
|
||||
|
||||
LOG(ISIS, "ISIS %s holding timeout on interface %s\n",
|
||||
isis_level_string(adjacency->level), adjacency->interface->name);
|
||||
if(adjacency->state == ISIS_ADJACENCY_STATE_DOWN) {
|
||||
return;
|
||||
}
|
||||
|
||||
LOG(ISIS, "ISIS %s holding timeout to %s on interface %s\n",
|
||||
isis_level_string(adjacency->level),
|
||||
isis_system_id_to_str(adjacency->peer->system_id),
|
||||
adjacency->interface->name);
|
||||
|
||||
isis_adjacency_down(adjacency);
|
||||
isis_lsp_self_update(adjacency->instance, adjacency->level);
|
||||
|
||||
adjacency->interface->isis_adjacency_p2p->state = ISIS_P2P_ADJACENCY_STATE_DOWN;
|
||||
}
|
||||
|
||||
static void
|
||||
isis_p2p_reset_holding_timers(bbl_interface_s *interface) {
|
||||
isis_p2p_restart_holding_timers(bbl_interface_s *interface) {
|
||||
isis_adjacency_t *adjacency;
|
||||
|
||||
for(int i=0; i<ISIS_LEVELS; i++) {
|
||||
@@ -34,7 +42,7 @@ isis_p2p_reset_holding_timers(bbl_interface_s *interface) {
|
||||
if(adjacency) {
|
||||
timer_add(&interface->ctx->timer_root, &adjacency->timer_holding,
|
||||
"ISIS holding", adjacency->peer->holding_time, 0, adjacency,
|
||||
&isis_holding_timeout);
|
||||
&isis_p2p_holding_timeout);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -67,7 +75,7 @@ isis_p2p_hello_encode(bbl_interface_s *interface,
|
||||
/* Start next timer ... */
|
||||
timer_add(&interface->ctx->timer_root, &interface->timer_isis_hello,
|
||||
"ISIS hello", config->hello_interval, 0, interface,
|
||||
&isis_hello_timeout);
|
||||
&isis_p2p_hello_timeout);
|
||||
|
||||
if(config->level1_auth && config->level1_key) {
|
||||
auth = config->level1_auth;
|
||||
@@ -161,7 +169,7 @@ isis_p2p_hello_handler_rx(bbl_interface_s *interface, isis_pdu_t *pdu) {
|
||||
memcpy(peer->system_id, PDU_OFFSET(pdu, ISIS_OFFSET_P2P_HELLO_SYSTEM_ID), ISIS_SYSTEM_ID_LEN);
|
||||
peer->holding_time = be16toh(*(uint16_t*)PDU_OFFSET(pdu, ISIS_OFFSET_P2P_HELLO_HOLD_TIME));
|
||||
|
||||
isis_p2p_reset_holding_timers(interface);
|
||||
isis_p2p_restart_holding_timers(interface);
|
||||
|
||||
tlv = isis_pdu_first_tlv(pdu);
|
||||
while(tlv) {
|
||||
|
||||
Reference in New Issue
Block a user