/home/aaron/olsrd-current/olsrd/src/core/neighbor_table.h File Reference

#include "defs.h"
#include "olsr_clock.h"
#include "olsr_types.h"
#include "common/avl.h"
#include "tc_set.h"
Include dependency graph for neighbor_table.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  nbr_con
struct  nbr_entry
struct  nbr2_entry

Defines

#define NB2S_COVERED   0x1
#define OLSR_NBR2_LIST_JITTER   5
#define OLSR_FOR_ALL_NBR_ENTRIES(nbr, iterator)   avl_for_each_element_safe(&nbr_tree, nbr, nbr_node, iterator)
#define OLSR_FOR_ALL_NBR_CON_ENTRIES(nbr, con, iterator)   avl_for_each_element_safe(&nbr->con_tree, con, nbr_tree_node, iterator)
#define OLSR_FOR_ALL_NBR2_ENTRIES(nbr2, iterator)   avl_for_each_element_safe(&nbr2_tree, nbr2, nbr2_node, iterator)
#define OLSR_FOR_ALL_NBR2_CON_ENTRIES(nbr2, con, iterator)   avl_for_each_element_safe(&nbr2->con_tree, con, nbr2_tree_node, iterator)

Functions

struct avl_tree EXPORT (nbr_tree)
struct avl_tree EXPORT (nbr2_tree)
void olsr_init_neighbor_table (void)
struct nbr_entryolsr_add_nbr_entry (const union olsr_ip_addr *)
void olsr_delete_nbr_entry (struct nbr_entry *)
struct nbr_entry *EXPORT() olsr_lookup_nbr_entry (const union olsr_ip_addr *, bool aliaslookup)
void olsr_update_nbr_status (struct nbr_entry *)
struct nbr2_entryolsr_add_nbr2_entry (const union olsr_ip_addr *)
void olsr_delete_nbr2_entry (struct nbr2_entry *)
struct nbr2_entry *EXPORT() olsr_lookup_nbr2_entry (const union olsr_ip_addr *, bool aliaslookup)
struct nbr_conolsr_link_nbr_nbr2 (struct nbr_entry *, const union olsr_ip_addr *, uint32_t)
void olsr_delete_nbr_con (struct nbr_con *)
struct nbr_con *EXPORT() olsr_lookup_nbr_con_entry (struct nbr_entry *, const union olsr_ip_addr *)
struct nbr_con *EXPORT() olsr_lookup_nbr2_con_entry (struct nbr2_entry *, const union olsr_ip_addr *)
void olsr_print_neighbor_table (void)

Define Documentation

#define NB2S_COVERED   0x1

Definition at line 52 of file neighbor_table.h.

#define OLSR_FOR_ALL_NBR2_CON_ENTRIES ( nbr2,
con,
iterator   )     avl_for_each_element_safe(&nbr2->con_tree, con, nbr2_tree_node, iterator)
#define OLSR_FOR_ALL_NBR2_ENTRIES ( nbr2,
iterator   )     avl_for_each_element_safe(&nbr2_tree, nbr2, nbr2_node, iterator)

Definition at line 117 of file neighbor_table.h.

Referenced by olsr_calculate_lq_mpr2(), and olsr_print_neighbor_table().

#define OLSR_FOR_ALL_NBR_CON_ENTRIES ( nbr,
con,
iterator   )     avl_for_each_element_safe(&nbr->con_tree, con, nbr_tree_node, iterator)

Definition at line 107 of file neighbor_table.h.

Referenced by build_neigh_body(), olsr_delete_nbr_entry(), and txtinfo_neigh2().

#define OLSR_FOR_ALL_NBR_ENTRIES ( nbr,
iterator   )     avl_for_each_element_safe(&nbr_tree, nbr, nbr_node, iterator)
#define OLSR_NBR2_LIST_JITTER   5

Definition at line 71 of file neighbor_table.h.

Referenced by olsr_link_nbr_nbr2().


Function Documentation

struct avl_tree EXPORT ( nbr2_tree   )  [read]
struct avl_tree EXPORT ( nbr_tree   )  [read]
struct nbr2_entry* olsr_add_nbr2_entry ( const union olsr_ip_addr addr  )  [read]

Insert a new entry to the two hop neighbor table.

Parameters:
addr the entry to insert
Returns:
nada

Definition at line 268 of file neighbor_table.c.

References avl_comp_default, avl_init(), avl_insert(), nbr2_entry::con_tree, avl_node::key, LOG_2NEIGH, nbr2_entry::nbr2_addr, nbr2_entry::nbr2_node, nbr2_tree, OLSR_DEBUG, olsr_ip_to_string(), olsr_lookup_nbr2_entry(), and olsr_memcookie_malloc().

Referenced by olsr_link_nbr_nbr2().

Here is the call graph for this function:

struct nbr_entry* olsr_add_nbr_entry ( const union olsr_ip_addr addr  )  [read]

Insert a neighbor entry in the neighbor table.

Parameters:
addr the main address of the new node
Returns:
pointer to an already existting (or new created) neighbor entry

Definition at line 98 of file neighbor_table.c.

References avl_comp_default, avl_init(), avl_insert(), nbr_entry::con_tree, nbr_entry::is_mpr, nbr_entry::is_sym, avl_node::key, nbr_entry::linkcount, LOG_NEIGHTABLE, nbr_entry::nbr_addr, nbr_entry::nbr_node, nbr_tree, tc_edge_entry::neighbor, olsr_add_tc_edge_entry(), OLSR_DEBUG, olsr_ip_to_string(), olsr_lookup_nbr_entry(), olsr_lookup_tc_edge(), olsr_memcookie_malloc(), nbr_entry::tc_edge, tc_myself, nbr_entry::was_mpr, WILL_NEVER, and nbr_entry::willingness.

Referenced by add_link_entry(), and olsr_fixup_mid_main_addr().

Here is the call graph for this function:

void olsr_delete_nbr2_entry ( struct nbr2_entry nbr2  ) 

Delete an entry from the two hop neighbor table.

Parameters:
nbr2 the two hop neighbor to delete.

Definition at line 304 of file neighbor_table.c.

References avl_delete(), changes_neighborhood, internal_delete_nbr_con(), LOG_NEIGHTABLE, nbr2_entry::nbr2_addr, nbr2_entry::nbr2_node, nbr2_tree, OLSR_DEBUG, OLSR_FOR_ALL_NBR2_CON_ENTRIES, olsr_ip_to_string(), and olsr_memcookie_free().

Referenced by olsr_delete_nbr_con(), olsr_flush_nbr2_duplicates(), and olsr_update_nbr_status().

Here is the call graph for this function:

void olsr_delete_nbr_con ( struct nbr_con connector  ) 

Unlinks an one-hop and a 2-hop neighbor.

Parameters:
connector the connector between the neighbors

Definition at line 411 of file neighbor_table.c.

References nbr2_entry::con_tree, avl_tree::count, internal_delete_nbr_con(), nbr_con::nbr2, and olsr_delete_nbr2_entry().

Referenced by olsr_delete_nbr_entry(), and olsr_expire_nbr_con().

Here is the call graph for this function:

void olsr_delete_nbr_entry ( struct nbr_entry nbr  ) 

Delete a neighbor table entry.

Remember: Deleting a neighbor entry results the deletion of its 2 hop neighbors list!!!

Parameters:
addr the neighbor entry to delete

Definition at line 153 of file neighbor_table.c.

References avl_delete(), changes_neighborhood, changes_topology, LOG_NEIGHTABLE, nbr_entry::nbr_addr, nbr_entry::nbr_node, nbr_tree, tc_edge_entry::neighbor, OLSR_DEBUG, olsr_delete_nbr_con(), olsr_delete_tc_edge_entry(), OLSR_FOR_ALL_NBR_CON_ENTRIES, olsr_ip_to_string(), olsr_memcookie_free(), and nbr_entry::tc_edge.

Referenced by olsr_delete_link_entry(), olsr_fixup_mid_main_addr(), and olsr_flush_nbr2_duplicates().

Here is the call graph for this function:

void olsr_init_neighbor_table ( void   ) 

Definition at line 77 of file neighbor_table.c.

References avl_comp_default, avl_init(), LOG_NEIGHTABLE, nbr2_tree, nbr_tree, olsr_expire_nbr_con(), OLSR_INFO, olsr_memcookie_add(), and olsr_timer_add().

Referenced by main().

Here is the call graph for this function:

struct nbr_con* olsr_link_nbr_nbr2 ( struct nbr_entry nbr,
const union olsr_ip_addr nbr2_addr,
uint32_t  vtime 
) [read]

Links a one-hop neighbor with a 2-hop neighbor.

Parameters:
nbr the 1-hop neighbor
nbr2 the 2-hop neighbor
vtime validity time of the 2hop neighbor

Definition at line 354 of file neighbor_table.c.

References avl_insert(), nbr2_entry::con_tree, nbr_entry::con_tree, avl_node::key, LINK_COST_BROKEN, nbr_con::nbr, nbr_con::nbr2, nbr2_entry::nbr2_addr, nbr_con::nbr2_con_timer, nbr_con::nbr2_tree_node, nbr_entry::nbr_addr, nbr_con::nbr_tree_node, olsr_add_nbr2_entry(), olsr_lookup_nbr_con_entry(), olsr_memcookie_malloc(), OLSR_NBR2_LIST_JITTER, olsr_timer_change(), olsr_timer_start(), and nbr_con::path_linkcost.

Referenced by process_message_neighbors().

Here is the call graph for this function:

struct nbr_con* EXPORT() olsr_lookup_nbr2_con_entry ( struct nbr2_entry nbr2,
const union olsr_ip_addr nbr_addr 
) [read]

Looks up the connection object of an 2-hop neighbor to an one-hop neighbor ip address.

Parameters:
nbr2 the 2-hop neighbor
nbr_addr the ip of the one-hop neighbor
Returns:
nbr_con, or NULL if not found

Definition at line 447 of file neighbor_table.c.

References avl_find_element, nbr2_entry::con_tree, and nbr_con::nbr2_tree_node.

struct nbr2_entry* EXPORT() olsr_lookup_nbr2_entry ( const union olsr_ip_addr ,
bool  aliaslookup 
) [read]

Definition at line 328 of file neighbor_table.c.

References avl_find_element, nbr2_entry::nbr2_node, nbr2_tree, and olsr_lookup_main_addr_by_alias().

Referenced by olsr_add_nbr2_entry(), olsr_flush_nbr2_duplicates(), and olsr_update_nbr_status().

Here is the call graph for this function:

struct nbr_con* EXPORT() olsr_lookup_nbr_con_entry ( struct nbr_entry nbr,
const union olsr_ip_addr nbr2_addr 
) [read]

Looks up the connection object of an one-hop neighbor to a 2-hop neighbor ip address.

Parameters:
nbr the one-hop neighbor
nbr2_addr the ip of the 2-hop neighbor
Returns:
nbr_con, or NULL if not found

Definition at line 432 of file neighbor_table.c.

References avl_find_element, nbr_entry::con_tree, and nbr_con::nbr_tree_node.

Referenced by olsr_link_nbr_nbr2(), and process_message_neighbors().

struct nbr_entry* EXPORT() olsr_lookup_nbr_entry ( const union olsr_ip_addr addr,
bool  lookupalias 
) [read]

Lookup a neighbor entry in the neighbortable based on an address. Unalias the passed in address before.

Parameters:
addr the IP address of the neighbor to look up
Returns:
a pointer to the neighbor struct registered on the given address. NULL if not found.

Definition at line 197 of file neighbor_table.c.

References avl_find_element, nbr_entry::nbr_node, nbr_tree, and olsr_lookup_main_addr_by_alias().

Referenced by add_link_entry(), get_best_link_to_neighbor_ip(), isMprOfAddress(), olsr_add_nbr_entry(), olsr_calculate_lq_mpr2(), olsr_fixup_mid_main_addr(), olsr_flush_nbr2_duplicates(), and olsr_forward_message().

Here is the call graph for this function:

void olsr_print_neighbor_table ( void   ) 
void olsr_update_nbr_status ( struct nbr_entry  ) 
Generated on Tue Jun 18 06:00:05 2013 for olsrd by  doxygen 1.6.3