#include "defs.h"#include "common/avl.h"#include "common/list.h"#include "olsr_protocol.h"#include "lq_packet.h"#include "olsr_timer.h"#include "olsr_socket.h"#include "olsr_memcookie.h"#include "duplicate_set.h"

Go to the source code of this file.
Data Structures | |
| struct | tc_edge_entry |
| struct | tc_entry |
Defines | |
| #define | OLSR_TC_EDGE_GC_TIME (2*1000) |
| #define | OLSR_TC_EDGE_GC_JITTER 5 |
| #define | OLSR_TC_VTIME_JITTER 5 |
| #define | OLSR_FOR_ALL_TC_ENTRIES(tc, iterator) avl_for_each_element_safe(&tc_tree, tc, vertex_node, iterator) |
| #define | OLSR_FOR_ALL_TC_EDGE_ENTRIES(tc, tc_edge, iterator) avl_for_each_element_safe(&tc->edge_tree, tc_edge, edge_node, iterator) |
| #define | OLSR_FOR_ALL_PREFIX_ENTRIES(tc, rtp, iterator) avl_for_each_element_safe(&tc->prefix_tree, rtp, rtp_prefix_tree_node, iterator) |
Functions | |
| struct avl_tree | EXPORT (tc_tree) |
| struct olsr_memcookie_info * | EXPORT (tc_mem_cookie) |
| void | olsr_init_tc (void) |
| void | olsr_change_myself_tc (void) |
| void | olsr_print_tc_table (void) |
| void | olsr_time_out_tc_set (void) |
| void | olsr_input_tc (struct olsr_message *, struct interface *, union olsr_ip_addr *, enum duplicate_status) |
| struct tc_entry *EXPORT() | olsr_lookup_tc_entry (const union olsr_ip_addr *) |
| struct tc_entry *EXPORT() | olsr_locate_tc_entry (const union olsr_ip_addr *) |
| struct tc_edge_entry *EXPORT() | olsr_lookup_tc_edge (struct tc_entry *, const union olsr_ip_addr *) |
| struct tc_edge_entry * | olsr_add_tc_edge_entry (struct tc_entry *, const union olsr_ip_addr *, uint16_t) |
| void | olsr_delete_tc_entry (struct tc_entry *) |
| void | olsr_delete_tc_edge_entry (struct tc_edge_entry *) |
| bool | olsr_calc_tc_edge_entry_etx (struct tc_edge_entry *) |
| void | olsr_set_tc_edge_timer (struct tc_edge_entry *, unsigned int) |
| void | olsr_delete_all_tc_entries (void) |
| uint32_t EXPORT() | getRelevantTcCount (void) |
| uint16_t EXPORT() | get_local_ansn_number (void) |
| void | increase_local_ansn_number (void) |
| void | olsr_output_lq_tc (void *ifp) |
Variables | |
| struct tc_entry * | tc_myself |
| #define OLSR_FOR_ALL_PREFIX_ENTRIES | ( | tc, | |||
| rtp, | |||||
| iterator | ) | avl_for_each_element_safe(&tc->prefix_tree, rtp, rtp_prefix_tree_node, iterator) |
Definition at line 114 of file tc_set.h.
Referenced by olsr_calculate_routing_table(), and olsr_delete_tc_entry().
| #define OLSR_FOR_ALL_TC_EDGE_ENTRIES | ( | tc, | |||
| tc_edge, | |||||
| iterator | ) | avl_for_each_element_safe(&tc->edge_tree, tc_edge, edge_node, iterator) |
Definition at line 113 of file tc_set.h.
Referenced by build_topo_body(), delete_outdated_tc_edges(), mapwrite_work(), olsr_delete_all_tc_entries(), olsr_delete_revoked_tc_edges(), olsr_delete_tc_entry(), olsr_print_tc_table(), olsr_spf_relax(), pcf_event(), and txtinfo_topology().
| #define OLSR_FOR_ALL_TC_ENTRIES | ( | tc, | |||
| iterator | ) | avl_for_each_element_safe(&tc_tree, tc, vertex_node, iterator) |
Definition at line 112 of file tc_set.h.
Referenced by build_mid_body(), build_topo_body(), mapwrite_work(), olsr_calculate_routing_table(), olsr_delete_all_tc_entries(), olsr_print_hna_set(), olsr_print_mid_set(), olsr_print_tc_table(), pcf_event(), txtinfo_hna(), txtinfo_mid(), and txtinfo_topology().
| #define OLSR_TC_EDGE_GC_JITTER 5 |
Definition at line 100 of file tc_set.h.
Referenced by olsr_input_tc().
| #define OLSR_TC_EDGE_GC_TIME (2*1000) |
Definition at line 99 of file tc_set.h.
Referenced by olsr_input_tc().
| #define OLSR_TC_VTIME_JITTER 5 |
Definition at line 102 of file tc_set.h.
Referenced by olsr_input_tc().
| struct olsr_memcookie_info* EXPORT | ( | tc_mem_cookie | ) | [read] |
| uint16_t EXPORT() get_local_ansn_number | ( | void | ) |
Definition at line 940 of file tc_set.c.
References local_ansn_number.
Referenced by olsr_output_lq_tc_internal().
| uint32_t EXPORT() getRelevantTcCount | ( | void | ) |
Definition at line 878 of file tc_set.c.
References relevantTcCount.
| void increase_local_ansn_number | ( | void | ) |
Definition at line 945 of file tc_set.c.
References local_ansn_number.
Referenced by olsr_process_changes().
| struct tc_edge_entry* olsr_add_tc_edge_entry | ( | struct tc_entry * | tc, | |
| const union olsr_ip_addr * | addr, | |||
| uint16_t | ansn | |||
| ) | [read] |
Add a new tc_edge_entry to the tc_edge_tree
| (last)adr | address of the entry |
Definition at line 368 of file tc_set.c.
References tc_entry::addr, avl_insert(), tc_edge_entry::edge_inv, tc_entry::edge_tree, LOG_TC, olsr_add_tc_edge_entry(), olsr_add_tc_entry(), olsr_calc_tc_cost(), OLSR_DEBUG, olsr_ip_to_string(), olsr_lookup_tc_edge(), olsr_lookup_tc_entry(), olsr_malloc_tc_edge_entry(), olsr_tc_edge_to_string(), and tc_edge_entry::virtual.
Referenced by olsr_add_nbr_entry(), olsr_add_tc_edge_entry(), olsr_change_myself_tc(), and olsr_tc_update_edge().

| bool olsr_calc_tc_edge_entry_etx | ( | struct tc_edge_entry * | ) |
| void olsr_change_myself_tc | ( | void | ) |
The main ip address has changed. Do the needful.
check if a main ip change destroyed our TC entries
Definition at line 164 of file tc_set.c.
References tc_entry::addr, changes_topology, nbr_entry::nbr_addr, tc_edge_entry::neighbor, olsr_add_tc_edge_entry(), olsr_add_tc_entry(), olsr_cnf, olsr_delete_tc_edge_entry(), olsr_delete_tc_entry(), OLSR_FOR_ALL_NBR_ENTRIES, olsr_ipcmp(), olsr_config::router_id, and nbr_entry::tc_edge.
Referenced by add_interface(), and olsr_calculate_routing_table().

| void olsr_delete_all_tc_entries | ( | void | ) |
Definition at line 884 of file tc_set.c.
References tc_edge_entry::edge_inv, internal_delete_tc_edge_entry(), tc_edge_entry::neighbor, olsr_delete_tc_entry(), OLSR_FOR_ALL_TC_EDGE_ENTRIES, OLSR_FOR_ALL_TC_ENTRIES, and nbr_entry::tc_edge.
Referenced by olsr_shutdown().

| void olsr_delete_tc_edge_entry | ( | struct tc_edge_entry * | tc_edge | ) |
Delete a TC edge entry.
| tc | the TC entry | |
| tc_edge | the TC edge entry |
Definition at line 460 of file tc_set.c.
References changes_topology, tc_edge_entry::edge_inv, internal_delete_tc_edge_entry(), LOG_TC, tc_edge_entry::neighbor, OLSR_DEBUG, olsr_tc_edge_to_string(), olsr_timer_set(), tc_edge_entry::tc, tc_entry::validity_timer, tc_entry::virtual, and tc_edge_entry::virtual.
Referenced by delete_outdated_tc_edges(), olsr_change_myself_tc(), olsr_delete_nbr_entry(), olsr_delete_revoked_tc_edges(), and olsr_delete_tc_entry().

| void olsr_delete_tc_entry | ( | struct tc_entry * | tc | ) |
Attempts to delete a tc entry. This will work unless there are virtual edges left that cannot be removed
| entry | the TC entry to delete |
Definition at line 228 of file tc_set.c.
References tc_entry::addr, tc_entry::ansn, avl_delete(), avl_tree::count, tc_entry::edge_gc_timer, tc_entry::edge_tree, LOG_TC, OLSR_DEBUG, olsr_delete_rt_path(), olsr_delete_tc_edge_entry(), olsr_flush_hna_nets(), olsr_flush_mid_entries(), OLSR_FOR_ALL_PREFIX_ENTRIES, OLSR_FOR_ALL_TC_EDGE_ENTRIES, olsr_ip_to_string(), olsr_memcookie_free(), olsr_timer_stop(), tc_tree, tc_entry::validity_timer, tc_entry::vertex_node, and tc_entry::virtual.
Referenced by olsr_change_myself_tc(), olsr_delete_all_tc_entries(), olsr_expire_tc_entry(), and olsr_flush_tc_duplicates().

| void olsr_init_tc | ( | void | ) |
Initialize the topology set
Definition at line 141 of file tc_set.c.
References avl_comp_default, avl_init(), local_ansn_number, LOG_TC, olsr_expire_tc_edge_gc(), olsr_expire_tc_entry(), OLSR_INFO, olsr_memcookie_add(), olsr_timer_add(), random(), and tc_tree.
Referenced by main().

| void olsr_input_tc | ( | struct olsr_message * | , | |
| struct interface * | , | |||
| union olsr_ip_addr * | , | |||
| enum | duplicate_status | |||
| ) |
| struct tc_entry* EXPORT() olsr_locate_tc_entry | ( | const union olsr_ip_addr * | ) | [read] |
Definition at line 290 of file tc_set.c.
References olsr_add_tc_entry(), and olsr_lookup_tc_entry().
Referenced by olsr_input_hna(), olsr_input_mid(), olsr_insert_mid_entry(), olsr_insert_routing_table(), and olsr_update_hna_entry().

| struct tc_edge_entry* EXPORT() olsr_lookup_tc_edge | ( | struct tc_entry * | tc, | |
| const union olsr_ip_addr * | edge_addr | |||
| ) | [read] |
Lookup an edge hanging off a TC entry.
| entry | the entry to check | |
| dst_addr | the destination address to check for |
Definition at line 645 of file tc_set.c.
References avl_find_element, tc_edge_entry::edge_node, and tc_entry::edge_tree.
Referenced by FindNeighbors(), olsr_add_nbr_entry(), olsr_add_tc_edge_entry(), and olsr_tc_update_edge().
| struct tc_entry* EXPORT() olsr_lookup_tc_entry | ( | const union olsr_ip_addr * | adr | ) | [read] |
Look up a entry from the TC tree based on address
| adr | the address to look for |
Definition at line 278 of file tc_set.c.
References avl_find_element, tc_tree, and tc_entry::vertex_node.
Referenced by FindNeighbors(), olsr_add_tc_edge_entry(), olsr_delete_routing_table(), olsr_flush_tc_duplicates(), olsr_input_tc(), olsr_locate_tc_entry(), and write_hosts_file().
| void olsr_output_lq_tc | ( | void * | ifp | ) |
Definition at line 1089 of file tc_set.c.
References olsr_output_lq_tc_internal().
Referenced by main().

| void olsr_print_tc_table | ( | void | ) |
Print the topology table to stdout
Definition at line 657 of file tc_set.c.
References tc_entry::addr, tc_edge_entry::ansn, millitxt_buf::buf, tc_edge_entry::common_cost, tc_edge_entry::cost, olsr_config::ip_version, LOG_TC, LQTEXT_MAXLENGTH, olsr_clock_getRelative(), olsr_clock_getWallclockString(), olsr_clock_to_string(), olsr_cnf, OLSR_FOR_ALL_TC_EDGE_ENTRIES, OLSR_FOR_ALL_TC_ENTRIES, olsr_get_linkcost_text(), olsr_get_linklabel(), olsr_get_linklabel_maxlength(), OLSR_INFO, OLSR_INFO_NH, olsr_ip_to_string(), tc_edge_entry::T_dest_addr, olsr_timer_entry::timer_clock, tc_entry::validity_timer, and tc_edge_entry::virtual.
Referenced by olsr_process_changes().

| void olsr_set_tc_edge_timer | ( | struct tc_edge_entry * | , | |
| unsigned | int | |||
| ) |
| void olsr_time_out_tc_set | ( | void | ) |
Definition at line 66 of file tc_set.c.
Referenced by olsr_add_nbr_entry(), and olsr_calculate_routing_table().
1.6.3