?? ospf_inter_area_route_calculation.c
字號(hào):
} return (ignore_advertisement);}/*************************************************************************** ospf_create_and_install_a_new_inter_area_entry_for_N - create new inter area entry ** This routine will create an new inter area entry * for a new destination for a summary link state advertisement.** <destination_N> New destination for summary lsa* * <sptr_advertisement_node> Advertisement node ** <sptr_area> OSPF area** <area_border_router_BR> Area border router identifier** <sptr_routing_table_entry_for_BR> Routing table entry associated with border router** <cost_IAC> Cost of inter area path** <on_new_summary_lsa_received_path> Boolean for checking if summary was received on new path** RETURNS: N/A** ERRNO: N/A** NOMANUAL*/static void ospf_create_and_install_a_new_inter_area_entry_for_N (ULONG destination_N,OSPF_ADVERTISEMENT_NODE *sptr_advertisement_node, OSPF_AREA_ENTRY *sptr_area,ULONG area_border_router_BR,OSPF_ROUTING_TABLE_ENTRY *sptr_routing_table_entry_for_BR, ULONG cost_IAC, enum BOOLEAN on_new_summary_lsa_received_path){ OSPF_ROUTING_TABLE_ENTRY *sptr_routing_table_entry_for_N = NULL; OSPF_ROUTING_TABLE_NODE *sptr_routing_table_node = NULL; enum BOOLEAN I_am_an_area_border_router; OSPF_AREA_ENTRY *sptr_area_to_summarize_new_route_into = NULL; OSPF_AREA_ENTRY *sptr_next_area_to_summarize_new_route_into = NULL; OSPF_PRINTF_PROLOGUE (OSPF_PROLOGUE_PRINTF, "OSPF: Entering ospf_create_and_install_a_new_inter_area_entry_for_N\r\n"); sptr_routing_table_entry_for_N = (OSPF_ROUTING_TABLE_ENTRY *) table_malloc (1, sizeof (OSPF_ROUTING_TABLE_ENTRY)); if (sptr_routing_table_entry_for_N != NULL) { memset (sptr_routing_table_entry_for_N, 0x00, sizeof (OSPF_ROUTING_TABLE_ENTRY)); ospf_install_the_inter_area_path_to_N (destination_N, sptr_routing_table_entry_for_N, sptr_advertisement_node, sptr_area, area_border_router_BR, sptr_routing_table_entry_for_BR, cost_IAC); sptr_routing_table_node = (OSPF_ROUTING_TABLE_NODE *) table_malloc (1, sizeof (OSPF_ROUTING_TABLE_NODE)); if (sptr_routing_table_node != NULL) { memset (sptr_routing_table_node, 0x00, sizeof (OSPF_ROUTING_TABLE_NODE)); sptr_routing_table_node->sptr_forward_link = NULL; sptr_routing_table_node->sptr_backward_link = NULL; sptr_routing_table_node->active_areas_discarded_entry = FALSE; /* sptr_routing_table_node->discard_entry JACK If address range is active this will never reach here. ### */ sptr_routing_table_node->sptr_routing_table_entry = sptr_routing_table_entry_for_N; PARAMETER_NOT_USED (on_new_summary_lsa_received_path); /* SPR#76812 -- Begin */ ospf_add_routing_table_node (sptr_routing_table_node); /* SPR#76812 -- End */#if defined (__RTM__) ospf_export_route_to_other_protocols (OSPF_ADD_PATH, sptr_routing_table_node->sptr_routing_table_entry);#endif I_am_an_area_border_router = ospf_check_if_area_border_router (); if (I_am_an_area_border_router == TRUE) { for (sptr_area_to_summarize_new_route_into = ospf.sptr_area_list; sptr_area_to_summarize_new_route_into != NULL; sptr_area_to_summarize_new_route_into = sptr_next_area_to_summarize_new_route_into) { sptr_next_area_to_summarize_new_route_into = sptr_area_to_summarize_new_route_into->sptr_forward_link; if (sptr_area_to_summarize_new_route_into != ospf.sptr_backbone_area) { ospf_originate_a_single_summary_links_advertisement (sptr_routing_table_node->sptr_routing_table_entry, sptr_area_to_summarize_new_route_into, FALSE); /* Inter area routes are not summarized into backbone */ } } } } else { ospf_print_memory_error_message_and_free_buffer_if_necessary ((void *) sptr_routing_table_entry_for_N, "OSPF_ROUTING_TABLE_NODE"); } } else { ospf_print_memory_error_message_and_free_buffer_if_necessary ((void *) NULL, "OSPF_ROUTING_TABLE_ENTRY"); } return;}/*************************************************************************** ospf_install_the_inter_area_path_to_N - installs the new inter area into the routing table** This routine will install the new inter area path* for a new destination for a summary link state advertisement.** <destination_N> New destination for summary lsa* * <sptr_routing_table_entry_for_N> Routing table entry for destination** <sptr_advertisement_node> Advertisement node ** <sptr_area> OSPF area** <area_border_router_BR> Area border router identifier** <sptr_routing_table_entry_for_BR> Routing table entry associated with border router** <cost_IAC> Cost of inter area path** RETURNS: N/A** ERRNO: N/A** NOMANUAL*/static void ospf_install_the_inter_area_path_to_N (ULONG destination_N,OSPF_ROUTING_TABLE_ENTRY *sptr_routing_table_entry_for_N, OSPF_ADVERTISEMENT_NODE *sptr_advertisement_node,OSPF_AREA_ENTRY *sptr_area,ULONG area_border_router_BR, OSPF_ROUTING_TABLE_ENTRY *sptr_routing_table_entry_for_BR,ULONG cost_IAC) /* NEWRT OSPF_PATRICIA_ Check here for Patricia route replacements */{ enum BOOLEAN I_am_an_area_border_router; OSPF_AREA_ENTRY *sptr_area_to_summarize_new_route_into = NULL; OSPF_AREA_ENTRY *sptr_next_area_to_summarize_new_route_into = NULL; OSPF_PRINTF_PROLOGUE (OSPF_PROLOGUE_PRINTF, "OSPF: Entering ospf_install_the_inter_area_path_to_N\r\n"); if (sptr_advertisement_node->advertisement.sptr_summary->ls_header.type == OSPF_LS_SUMMARY_NETWORK) { sptr_routing_table_entry_for_N->destination_type = OSPF_DESTINATION_TYPE_NETWORK; sptr_routing_table_entry_for_N->address_mask = net_to_host_long (sptr_advertisement_node->advertisement.sptr_summary->network_mask); } else { sptr_routing_table_entry_for_N->destination_type = OSPF_DESTINATION_TYPE_ASBR; sptr_routing_table_entry_for_N->address_mask = 0x00000000L; } sptr_routing_table_entry_for_N->destination_id = destination_N; sptr_routing_table_entry_for_N->optional_capabilities = sptr_advertisement_node->advertisement.sptr_summary->ls_header.options; sptr_routing_table_entry_for_N->type_of_service._byte = 0x00; sptr_routing_table_entry_for_N->sptr_area = sptr_area; sptr_routing_table_entry_for_N->path_type = OSPF_ROUTE_PATH_TYPE_INTER; sptr_routing_table_entry_for_N->path_cost = cost_IAC; sptr_routing_table_entry_for_N->type2_cost = 0x00; sptr_routing_table_entry_for_N->sptr_link_state_origin = &sptr_advertisement_node->advertisement; sptr_routing_table_entry_for_N->link_state_id = net_to_host_long ( sptr_advertisement_node->advertisement.sptr_router->ls_header.id); sptr_routing_table_entry_for_N->link_type = sptr_advertisement_node->advertisement.sptr_router->ls_header.type; if (sptr_routing_table_entry_for_N->sptr_next_hop != NULL) { ospf_free_entire_list ((OSPF_GENERIC_NODE *) sptr_routing_table_entry_for_N->sptr_next_hop); /* Jack July 7/31 ### inher rt_entry not mallocked */ } sptr_routing_table_entry_for_N->sptr_next_hop = ospf_inherit_the_set_of_next_hops_from_node_X (sptr_routing_table_entry_for_BR->sptr_next_hop); sptr_routing_table_entry_for_N->advertising_router = area_border_router_BR; I_am_an_area_border_router = ospf_check_if_area_border_router (); if (I_am_an_area_border_router == TRUE) { for (sptr_area_to_summarize_new_route_into = ospf.sptr_area_list; sptr_area_to_summarize_new_route_into != NULL; sptr_area_to_summarize_new_route_into = sptr_next_area_to_summarize_new_route_into) { sptr_next_area_to_summarize_new_route_into = sptr_area_to_summarize_new_route_into->sptr_forward_link; if (sptr_area_to_summarize_new_route_into != ospf.sptr_backbone_area) /* Inter area routes are not summarized into backbone */ { ospf_originate_a_single_summary_links_advertisement (sptr_routing_table_entry_for_N, sptr_area_to_summarize_new_route_into, FALSE); } } } return;}/*************************************************************************** ospf_invalidate_inter_area_route_entry - invalidates the routing table entry** This routine will invalidate the inter area routing * table entry.** <sptr_summary> Summary link state advertisement header to invalidate** <sptr_area> OSPF area** RETURNS: N/A** ERRNO: N/A** NOMANUAL*/void ospf_invalidate_inter_area_route_entry (OSPF_SUMMARY_LINK_ADVERTISEMENT_HEADER *sptr_summary, OSPF_AREA_ENTRY *sptr_area){ ULONG destination_N =0; ULONG network_mask =0; OSPF_ROUTING_TABLE_NODE *sptr_routing_table_node =NULL; ULONG advertising_router_from_rxed_advertisement =0; OSPF_PRINTF_PROLOGUE (OSPF_PROLOGUE_PRINTF, "OSPF: Entering ospf_invalidate_inter_area_route_entry\r\n"); destination_N = net_to_host_long (sptr_summary->ls_header.id); network_mask = net_to_host_long (sptr_summary->network_mask); advertising_router_from_rxed_advertisement = net_to_host_long (sptr_summary->ls_header.advertising_router); sptr_routing_table_node = ospf_find_routing_table_node (destination_N, (enum OSPF_LS_TYPE) (sptr_summary->ls_header.type)/* OSPF_DESTINATION_TYPE_NETWORK */, OSPF_ROUTE_PATH_TYPE_INTER, sptr_area); /* NEWRT LOOKUP */ if ( (sptr_routing_table_node != NULL) && (advertising_router_from_rxed_advertisement == sptr_routing_table_node->sptr_routing_table_entry->advertising_router) ) { ospf_invalidate_routing_table_entry (sptr_routing_table_node, network_mask, destination_N, sptr_area); /*#$-NOTE:note46-$#*/ ospf_schedule_routing_table_build(); /* SPR 88330 Remove code which floods LSA to other * areas, on receipt of LSU - it will be handled later */ }}/*************************************************************************** ospf_install_the_inter_area_path_to_N_and_replace_rtm_route - install the new inter area path and update rtm** This routine install the new inter area path and* update the routing table manager to notify IP and other* protocols of the new route.** <destination_N> New destination for summary lsa* * <sptr_routing_table_node_for_N> Routing table node for destination** <sptr_advertisement_node> Advertisement node ** <sptr_area> OSPF area** <area_border_router_BR> Area border router identifier** <sptr_routing_table_entry_for_BR> Routing table entry associated with border router** <cost_IAC> Cost of inter area path** RETURNS: N/A** ERRNO: N/A** NOMANUAL*/static void ospf_install_the_inter_area_path_to_N_and_replace_rtm_route (ULONG destination_N, OSPF_ROUTING_TABLE_NODE *sptr_routing_table_node_for_N /* July 7/31 ### */, OSPF_ADVERTISEMENT_NODE *sptr_advertisement_node, OSPF_AREA_ENTRY *sptr_area,ULONG area_border_router_BR, OSPF_ROUTING_TABLE_ENTRY *sptr_routing_table_entry_for_BR,ULONG cost_IAC){ OSPF_ROUTING_TABLE_ENTRY *sptr_routing_table_entry_for_N =NULL; OSPF_PRINTF_PROLOGUE (OSPF_PROLOGUE_PRINTF, "OSPF: Entering ospf_install_the_inter_area_path_to_N_and_replace_rtm_route\r\n"); sptr_routing_table_entry_for_N = sptr_routing_table_node_for_N->sptr_routing_table_entry;#if defined (__RTM__) ospf_export_route_to_other_protocols (OSPF_DELETE_PATH, sptr_routing_table_entry_for_N);#endif ospf_install_the_inter_area_path_to_N (destination_N, sptr_routing_table_entry_for_N, sptr_advertisement_node, sptr_area, area_border_router_BR, sptr_routing_table_entry_for_BR, cost_IAC);#if defined (__RTM__) ospf_export_route_to_other_protocols (OSPF_ADD_PATH, sptr_routing_table_entry_for_N);#endif return;}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -