#include <assert.h>#include <stdlib.h>#include "common/avl.h"#include "avl_olsr_comp.h"#include "ipcalc.h"#include "defs.h"#include "mid_set.h"#include "neighbor_table.h"#include "olsr.h"#include "olsr_timer.h"#include "olsr_socket.h"#include "link_set.h"#include "net_olsr.h"#include "olsr_logging.h"
Go to the source code of this file.
| static void internal_delete_nbr_con | ( | struct nbr_con * | connector | ) | [static] |
Deletes a nbr-connector without deleting the 2-hop neighbor
| connector | the connector between neighbors |
Definition at line 395 of file neighbor_table.c.
References avl_delete(), nbr2_entry::con_tree, nbr_entry::con_tree, nbr_con::nbr, nbr_con::nbr2, nbr_con::nbr2_con_timer, nbr_con::nbr2_tree_node, nbr_con::nbr_tree_node, olsr_memcookie_free(), and olsr_timer_stop().
Referenced by olsr_delete_nbr2_entry(), and olsr_delete_nbr_con().

| struct nbr2_entry* olsr_add_nbr2_entry | ( | const union olsr_ip_addr * | addr | ) | [read] |
Insert a new entry to the two hop neighbor table.
| addr | the entry to insert |
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().

| struct nbr_entry* olsr_add_nbr_entry | ( | const union olsr_ip_addr * | addr | ) | [read] |
Insert a neighbor entry in the neighbor table.
| addr | the main address of the new node |
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().

| void olsr_delete_nbr2_entry | ( | struct nbr2_entry * | nbr2 | ) |
Delete an entry from the two hop neighbor table.
| 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().

| void olsr_delete_nbr_con | ( | struct nbr_con * | connector | ) |
Unlinks an one-hop and a 2-hop neighbor.
| 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().

| 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!!!
| 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().

| static void olsr_expire_nbr_con | ( | void * | context | ) | [static] |
Definition at line 457 of file neighbor_table.c.
References nbr_con::nbr2_con_timer, and olsr_delete_nbr_con().
Referenced by olsr_init_neighbor_table().

| 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().

| 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.
| 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().

| struct nbr_con* 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.
| nbr2 | the 2-hop neighbor | |
| nbr_addr | the ip of the one-hop neighbor |
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* olsr_lookup_nbr2_entry | ( | const union olsr_ip_addr * | addr, | |
| bool | lookupalias | |||
| ) | [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().

| struct nbr_con* 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.
| nbr | the one-hop neighbor | |
| nbr2_addr | the ip of the 2-hop neighbor |
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* 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.
| addr | the IP address of the neighbor to look up |
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().

| void olsr_print_neighbor_table | ( | void | ) |
Print the registered neighbors and two hop neighbors to STDOUT.
Definition at line 473 of file neighbor_table.c.
References get_best_link_to_neighbor_ip(), olsr_config::ip_version, nbr_entry::is_mpr, nbr_entry::is_sym, LOG_2NEIGH, LOG_NEIGHTABLE, LQTEXT_MAXLENGTH, nbr_entry::mprs_count, nbr_con::nbr, nbr2_entry::nbr2_addr, nbr_entry::nbr_addr, olsr_clock_getWallclockString(), olsr_cnf, OLSR_FOR_ALL_NBR2_CON_ENTRIES, OLSR_FOR_ALL_NBR2_ENTRIES, OLSR_FOR_ALL_NBR_ENTRIES, olsr_get_linkcost_text(), OLSR_INFO, OLSR_INFO_NH, olsr_ip_to_string(), nbr_con::path_linkcost, and nbr_entry::willingness.
Referenced by olsr_process_changes().

| void olsr_update_nbr_status | ( | struct nbr_entry * | entry | ) |
Definition at line 216 of file neighbor_table.c.
References changes_neighborhood, changes_topology, get_best_link_to_neighbor(), nbr_entry::is_mpr, nbr_entry::is_sym, LOG_NEIGHTABLE, lookup_link_status(), nbr_entry::nbr_addr, olsr_cnf, OLSR_DEBUG, olsr_delete_nbr2_entry(), olsr_ip_to_string(), olsr_lookup_nbr2_entry(), signal_link_changes(), SYM_LINK, and olsr_config::tc_redundancy.
Referenced by olsr_expire_link_hello_timer(), olsr_expire_link_sym_timer(), and update_link_entry().

struct olsr_memcookie_info* nbr2_mem_cookie = NULL [static] |
Definition at line 63 of file neighbor_table.c.
Definition at line 60 of file neighbor_table.c.
Referenced by olsr_add_nbr2_entry(), olsr_delete_nbr2_entry(), olsr_init_neighbor_table(), and olsr_lookup_nbr2_entry().
struct olsr_memcookie_info* nbr_connector_mem_cookie = NULL [static] |
Definition at line 65 of file neighbor_table.c.
struct olsr_timer_info* nbr_connector_timer_info = NULL [static] |
Definition at line 68 of file neighbor_table.c.
struct olsr_memcookie_info* nbr_mem_cookie = NULL [static] |
Definition at line 64 of file neighbor_table.c.
Definition at line 59 of file neighbor_table.c.
Referenced by olsr_add_nbr_entry(), olsr_delete_nbr_entry(), olsr_init_neighbor_table(), and olsr_lookup_nbr_entry().
1.6.3