0
0
mirror of https://gitlab.nic.cz/labs/bird.git synced 2024-12-22 17:51:53 +00:00

OSPF: Add LSA retransmission counter

This commit is contained in:
Ondrej Zajicek (work) 2018-12-21 14:26:04 +01:00
parent c217fe593a
commit c6faca916a
4 changed files with 13 additions and 1 deletions

View File

@ -1397,6 +1397,13 @@ ospf_iface_info(struct ospf_iface *ifa)
cli_msg(-1015, "\tBackup designated router (IP): %I", ifa->bdrip); cli_msg(-1015, "\tBackup designated router (IP): %I", ifa->bdrip);
} }
uint lsrt_count = 0;
struct ospf_neighbor *n;
WALK_LIST(n, ifa->neigh_list)
lsrt_count += n->lsrt_count;
cli_msg(-1015, "\tTotal LSA retransmission list length: %u", lsrt_count);
cli_msg(-1015, "\tStatistics:"); cli_msg(-1015, "\tStatistics:");
ospf_iface_stats(-1015, &ifa->stats); ospf_iface_stats(-1015, &ifa->stats);
} }

View File

@ -129,8 +129,9 @@ ospf_lsa_lsrt_up(struct top_hash_entry *en, struct ospf_neighbor *n)
if (!SNODE_VALID(ret)) if (!SNODE_VALID(ret))
{ {
en->ret_count++;
s_add_tail(&n->lsrtl, SNODE ret); s_add_tail(&n->lsrtl, SNODE ret);
n->lsrt_count++;
en->ret_count++;
} }
ret->lsa = en->lsa; ret->lsa = en->lsa;
@ -148,6 +149,7 @@ ospf_lsa_lsrt_down_(struct top_hash_entry *en, struct ospf_neighbor *n, struct t
s_rem_node(SNODE ret); s_rem_node(SNODE ret);
ospf_hash_delete(n->lsrth, ret); ospf_hash_delete(n->lsrth, ret);
n->lsrt_count--;
if (EMPTY_SLIST(n->lsrtl)) if (EMPTY_SLIST(n->lsrtl))
tm_stop(n->lsrt_timer); tm_stop(n->lsrt_timer);
@ -450,6 +452,7 @@ ospf_rxmt_lsupd(struct ospf_proto *p, struct ospf_neighbor *n)
s_rem_node(SNODE ret); s_rem_node(SNODE ret);
ospf_hash_delete(n->lsrth, ret); ospf_hash_delete(n->lsrth, ret);
n->lsrt_count--;
continue; continue;
} }

View File

@ -39,6 +39,7 @@ init_lists(struct ospf_proto *p, struct ospf_neighbor *n)
s_init_list(&(n->lsrtl)); s_init_list(&(n->lsrtl));
n->lsrth = ospf_top_new(p, n->pool); n->lsrth = ospf_top_new(p, n->pool);
n->lsrt_count = 0;
} }
static void static void

View File

@ -390,6 +390,7 @@ struct ospf_neighbor
*/ */
slist lsrtl; /* slist of struct top_hash_entry from n->lsrth */ slist lsrtl; /* slist of struct top_hash_entry from n->lsrth */
struct top_graph *lsrth; struct top_graph *lsrth;
u32 lsrt_count; /* Number of entries in Link state retransmission list */
timer *dbdes_timer; /* DBDES exchange timer */ timer *dbdes_timer; /* DBDES exchange timer */
timer *lsrq_timer; /* LSA request timer */ timer *lsrq_timer; /* LSA request timer */
timer *lsrt_timer; /* LSA retransmission timer */ timer *lsrt_timer; /* LSA retransmission timer */