clean up previous patch
authorMarkus Kittenberger <markus@markit.unassigned-domain>
Tue, 2 Nov 2010 22:08:11 +0000 (23:08 +0100)
committerMarkus Kittenberger <markus@markit.unassigned-domain>
Tue, 2 Nov 2010 22:08:11 +0000 (23:08 +0100)
src/neighbor_table.c
src/neighbor_table.h

index c223201..a5115f7 100644 (file)
@@ -154,32 +154,13 @@ olsr_lookup_my_neighbors(const struct neighbor_entry *neighbor, const union olsr
 int 
 olsr_update_neighbor_main_addr(struct neighbor_entry *entry, const union olsr_ip_addr *new_main_addr)
 {
-  /*uint32_t hash = olsr_ip_hashing(&neigh->neighbor_main_addr);
-  
-  struct neighbor_entry *entry;
-
-  entry = neighbortable[hash].next;
-
-  while (entry != &neighbortable[hash]) {
-    if (ipequal(&entry->neighbor_main_addr, &neigh->neighbor_main_addr))
-      break;
-
-    entry = entry->next;
-  }
-
-  if (entry == &neighbortable[hash])
-    return 0;
-
-  if (entry == neigh) printf("bullshit\n");
-  else printf("updating neighbor has!\n");*/
-
-  //remove from old pos
+  /*remove from old pos*/
   DEQUEUE_ELEM(entry);
 
-  //update entry
+  /*update main addr*/
   entry->neighbor_main_addr = *new_main_addr;
 
-  //insert it again
+  /*insert it again*/
   QUEUE_ELEM(neighbortable[olsr_ip_hashing(new_main_addr)], entry);
 
 }
@@ -333,27 +314,6 @@ olsr_lookup_neighbor_table_alias(const union olsr_ip_addr *dst)
 
 }
 
-//check if all neighbour entries are findable in neighbour table
-bool
-olsr_lookup_neighbor_table_check(void)
-{
-  struct ipaddr_str buf1;
-  struct neighbor_entry *entry;
-  printf("\n checking neighbour table: ");
-  /* Neighbors */
-  OLSR_FOR_ALL_NBR_ENTRIES(entry) {
-    printf("%s, ",olsr_ip_to_string(&buf1, &entry->neighbor_main_addr));
-    if (olsr_lookup_neighbor_table_alias(&entry->neighbor_main_addr)==NULL) {
-      struct neighbor_2_list_entry *two_hop_list, *two_hop_to_delete;
-      printf("-> entry has wrong hash!");
-      return true;
-    }
-  }
-  OLSR_FOR_ALL_NBR_ENTRIES_END(neigh);
-  return false;
-}
-
-
 int
 update_neighbor_status(struct neighbor_entry *entry, int lnk)
 {
index 5602869..4cc8794 100644 (file)
@@ -97,8 +97,6 @@ struct neighbor_entry *olsr_lookup_neighbor_table(const union olsr_ip_addr *);
 
 struct neighbor_entry *olsr_lookup_neighbor_table_alias(const union olsr_ip_addr *);
 
-bool olsr_lookup_neighbor_table_check(void);
-
 void olsr_time_out_two_hop_neighbors(struct neighbor_entry *);
 
 void olsr_time_out_neighborhood_tables(void);