add a cookie for the 2-Hop Neighbor list expiration timer
authorHannes Gredler <hannes@gredler.at>
Mon, 10 Nov 2008 16:31:24 +0000 (17:31 +0100)
committerHannes Gredler <hannes@gredler.at>
Mon, 10 Nov 2008 16:31:24 +0000 (17:31 +0100)
src/neighbor_table.c
src/neighbor_table.h
src/olsr_cookie.h
src/process_package.c

index ef5b842..efe0fb0 100644 (file)
@@ -55,6 +55,8 @@
 
 struct neighbor_entry neighbortable[HASHSIZE];
 
+/* Some cookies for stats keeping */
+struct olsr_cookie_info *nbr2_list_timer_cookie = NULL;
 
 void
 olsr_init_neighbor_table(void)
@@ -66,6 +68,10 @@ olsr_init_neighbor_table(void)
       neighbortable[i].next = &neighbortable[i];
       neighbortable[i].prev = &neighbortable[i];
     }
+
+  nbr2_list_timer_cookie = olsr_alloc_cookie("2-Hop Neighbor List",
+                                             OLSR_COOKIE_TYPE_TIMER);
+
 }
 
 /**
index e5b5495..608e1ee 100644 (file)
@@ -87,6 +87,7 @@ struct neighbor_entry
  */
 extern struct neighbor_entry neighbortable[HASHSIZE];
 
+extern struct olsr_cookie_info *nbr2_list_timer_cookie;
 
 void
 olsr_init_neighbor_table(void);
index 0595df4..f327552 100644 (file)
@@ -44,7 +44,7 @@
 #ifndef _OLSR_COOKIE_H
 #define _OLSR_COOKIE_H
 
-#define COOKIE_ID_MAX  25      /* maximum number of cookies in the system */
+#define COOKIE_ID_MAX  40      /* maximum number of cookies in the system */
 
 typedef enum olsr_cookie_type_ {
   OLSR_COOKIE_TYPE_MIN,
index 998f2c8..787a0f0 100644 (file)
@@ -110,7 +110,7 @@ process_message_neighbors(struct neighbor_entry *neighbor, const struct hello_me
         olsr_set_timer(&two_hop_neighbor_yet->nbr2_list_timer,
                        message->vtime, OLSR_NBR2_LIST_JITTER,
                        OLSR_TIMER_ONESHOT, &olsr_expire_nbr2_list,
-                       two_hop_neighbor_yet, 0);
+                       two_hop_neighbor_yet, nbr2_list_timer_cookie->ci_id);
         two_hop_neighbor = two_hop_neighbor_yet->neighbor_2;
 
         /*