]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
OSPF: Add LSA retransmission counter
authorOndrej Zajicek (work) <santiago@crfreenet.org>
Fri, 21 Dec 2018 13:26:04 +0000 (14:26 +0100)
committerOndrej Zajicek (work) <santiago@crfreenet.org>
Fri, 21 Dec 2018 13:26:04 +0000 (14:26 +0100)
proto/ospf/iface.c
proto/ospf/lsupd.c
proto/ospf/neighbor.c
proto/ospf/ospf.h

index 7c80c22684b060c7f1d6b6f8a00a85ee85f7fbea..f7961514020ad54b182ce8b1e26e703d6baeaaa3 100644 (file)
@@ -1397,6 +1397,13 @@ ospf_iface_info(struct ospf_iface *ifa)
     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:");
   ospf_iface_stats(-1015, &ifa->stats);
+
 }
index 37139b963c5ca4284d3f62d7f228754bf9ea9079..09a38e3d34982792064846de2dd046406ff1e2fa 100644 (file)
@@ -129,8 +129,9 @@ ospf_lsa_lsrt_up(struct top_hash_entry *en, struct ospf_neighbor *n)
 
   if (!SNODE_VALID(ret))
   {
-    en->ret_count++;
     s_add_tail(&n->lsrtl, SNODE ret);
+    n->lsrt_count++;
+    en->ret_count++;
   }
 
   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);
   ospf_hash_delete(n->lsrth, ret);
+  n->lsrt_count--;
 
   if (EMPTY_SLIST(n->lsrtl))
     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);
       ospf_hash_delete(n->lsrth, ret);
+      n->lsrt_count--;
 
       continue;
     }
index f2d3505ecc69ff6fb703a37866235c35a2573c8e..ff27cd411a6f6f7318e80798822234b18c266991 100644 (file)
@@ -39,6 +39,7 @@ init_lists(struct ospf_proto *p, struct ospf_neighbor *n)
 
   s_init_list(&(n->lsrtl));
   n->lsrth = ospf_top_new(p, n->pool);
+  n->lsrt_count = 0;
 }
 
 static void
index 8e49a7c564348c1e38c9fa09418e0cb663de7093..90fbd562dc2a206d80125e725691a7ccee437105 100644 (file)
@@ -390,6 +390,7 @@ struct ospf_neighbor
    */
   slist lsrtl;                 /* slist of struct top_hash_entry from n->lsrth */
   struct top_graph *lsrth;
+  u32 lsrt_count;              /* Number of entries in Link state retransmission list */
   timer *dbdes_timer;          /* DBDES exchange timer */
   timer *lsrq_timer;           /* LSA request timer */
   timer *lsrt_timer;           /* LSA retransmission timer */