#include "defs.h"#include "olsr_clock.h"#include "olsr_types.h"#include "common/avl.h"#include "tc_set.h"

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_entry * | olsr_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_entry * | olsr_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_con * | olsr_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 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) |
Definition at line 119 of file neighbor_table.h.
Referenced by olsr_calculate_lq_mpr2(), olsr_delete_nbr2_entry(), and olsr_print_neighbor_table().
| #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) |
Definition at line 105 of file neighbor_table.h.
Referenced by build_neigh_body(), lq_etxff_timer(), olsr_calculate_lq_mpr(), olsr_calculate_lq_mpr2(), olsr_calculate_routing_table(), olsr_change_myself_tc(), olsr_event2(), olsr_output_lq_tc_internal(), olsr_print_neighbor_table(), pcf_event(), txtinfo_neigh(), and txtinfo_neigh2().
| #define OLSR_NBR2_LIST_JITTER 5 |
Definition at line 71 of file neighbor_table.h.
Referenced by olsr_link_nbr_nbr2().
| 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().

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

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

1.6.3