⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ospf_routing_table_updates.c

📁 vxworks下ospf协议栈
💻 C
📖 第 1 页 / 共 3 页
字号:
    if (sptr_routing_table_node_for_N != NULL)        {        return;        }    /* Fix for SPR# 297651 (SPR#83274) */    sptr_routing_table_node_for_N = ospf_find_router_or_network_routing_table_node (destination_N, sptr_type_7->ls_header.type, OSPF_ROUTE_PATH_TYPE_INTER,                                                                                    sptr_area_A);   /* NEWRT LOOKUP */    if (sptr_routing_table_node_for_N != NULL)        {        return;        }    /* Fix for SPR# 297651 (SPR#83274) */    sptr_routing_table_node_for_N = ospf_find_router_or_network_routing_table_node (destination_N, sptr_type_7->ls_header.type, OSPF_ROUTE_PATH_TYPE_WILDCARD,                                                                                    sptr_area_A);    if (sptr_routing_table_node_for_N != NULL)  /* NEWRT LOOKUP */        {        ospf_invalidate_routing_table_entry (sptr_routing_table_node_for_N, sptr_type_7->network_mask, destination_N, sptr_area_A);        }    for (sptr_area = ospf.sptr_area_list; sptr_area != NULL; sptr_area = sptr_next_area)        {        sptr_next_area = sptr_area->sptr_forward_link;        for (index = 0x00000000L, sptr_ls_database_head = &(sptr_area->ls_database_hash_table[OSPF_LS_TYPE_7][index]);  /* for each hash list */            index < OSPF_HASH_TABLE_SIZE; ++index, sptr_ls_database_head = &(sptr_area->ls_database_hash_table[OSPF_LS_TYPE_7][index]))            {            if (sptr_ls_database_head == NULL)                {                continue;                }	        /* SPR#76812 */	       	for (sptr_database_entry = sptr_ls_database_head->sptr_linear_database_entry;	       		sptr_database_entry != NULL;	       	    sptr_database_entry = sptr_next_database_entry)                {				sptr_next_database_entry = sptr_database_entry->sptr_forward_link;                if (sptr_database_entry->advertisement.sptr_type_7 != NULL)                    {                    link_state_id = net_to_host_long (sptr_database_entry->advertisement.sptr_type_7->ls_header.id);                    if (link_state_id == destination_N)                        {                        ospf_calculate_type_7_routes_to_a_single_external_destination (&(sptr_database_entry->advertisement), new_type_7_lsa_received);                        }                    }                }            }        }    ospf_display_routing_table ();    return;    }#endif /*__NSSA__*//*******************************************************************************************************************************/void ospf_invalidate_routing_table_entry (OSPF_ROUTING_TABLE_NODE *sptr_routing_table_node_for_N,ULONG network_mask,                                          ULONG destination_N,OSPF_AREA_ENTRY *sptr_area_A)    {    OSPF_ADDRESS_RANGE_LIST_ENTRY *sptr_address_range;    ULONG network_mask_in_host_order;    OSPF_PRINTF_DEBUG (OSPF_DEBUG_PRINTF, "OSPF: Entering ospf_invalidate_routing_table_entry\r\n");    /* SPR#76812 -- Begin */	ospf_delete_routing_table_node (sptr_routing_table_node_for_N);	/* SPR#76812 -- End */#if defined (__RTM__)    ospf_export_route_to_other_protocols (OSPF_REPLACE_PATH, sptr_routing_table_node_for_N->sptr_routing_table_entry);#endif    /*     * the function .....receipt_of_a_new_external_link.... also calls this function     * do not do the following check on external advertisements     */    if (sptr_routing_table_node_for_N->sptr_routing_table_entry->path_type == OSPF_ROUTE_PATH_TYPE_INTER && sptr_area_A != NULL)        {        for (sptr_address_range = sptr_area_A->sptr_address_ranges; sptr_address_range != NULL;            sptr_address_range = sptr_address_range->sptr_forward_link)            {            network_mask_in_host_order = net_to_host_long (network_mask);            if ((sptr_address_range->network == destination_N) && (sptr_address_range->mask == network_mask_in_host_order))                {                if (sptr_address_range->sptr_discard_entries == NULL)                    {                    sptr_address_range->sptr_discard_entries = sptr_routing_table_node_for_N;                    }                else                    {                    ospf_add_node_to_end_of_list ((OSPF_GENERIC_NODE *) sptr_routing_table_node_for_N,                                                  (OSPF_GENERIC_NODE *) sptr_address_range->sptr_discard_entries);                    }                break;                }            }        }    /* SPR 83981 --- Begin */    /* For external route we need to free the memory */    else if ( sptr_area_A == NULL)        {        sptr_routing_table_node_for_N->sptr_forward_link = NULL; /* Just in case it did not reset by removing                                                                  * the entry from the list                                                                  */        ospf_free_routing_table_nodes(sptr_routing_table_node_for_N);        }    /* SPR 83981 --- End */    return;    }/* SPR#76812 -- Begin *//*******************************************************************************************************************************/void ospf_add_routing_table_node (OSPF_ROUTING_TABLE_NODE* sptr_routing_table_node){	ULONG hash_id;	enum OSPF_ROUTE_TABLE_TYPE table_type;	OSPF_PRINTF_PROLOGUE (OSPF_PROLOGUE_PRINTF, "OSPF: Entering ospf_add_routing_table_node\r\n");	if(sptr_routing_table_node == NULL)	{		OSPF_PRINTF_ALARM (OSPF_ALARM_PRINTF, "OSPF: ospf_add_routing_table_node null node detected\r\n");		return;	}	if(sptr_routing_table_node->sptr_routing_table_entry == NULL)	{		OSPF_PRINTF_ALARM (OSPF_ALARM_PRINTF, "OSPF: ospf_add_routing_table_node null routing table entry\r\n");		return;	}	switch(sptr_routing_table_node->sptr_routing_table_entry->destination_type)	{		case OSPF_DESTINATION_TYPE_ASBR:		case OSPF_DESTINATION_TYPE_ABR:			table_type = OSPF_ROUTE_TABLE_ROUTER;			break;		case OSPF_DESTINATION_TYPE_VIRTUAL:		case OSPF_DESTINATION_TYPE_NETWORK:		case OSPF_DESTINATION_TYPE_ASE:			table_type = OSPF_ROUTE_TABLE_NETWORK;			break;		default:			OSPF_PRINTF_ALARM (OSPF_ALARM_PRINTF, "OSPF: ospf_add_routing_table_node invalid destination type\r\n");			return;	}	hash_id = sptr_routing_table_node->sptr_routing_table_entry->destination_id;	hash_id = hash_id & OSPF_RT_HASH_MASK;	if(ospf.sptr_routing_table_head[table_type][hash_id] == NULL)	{		ospf.sptr_routing_table_head[table_type][hash_id] = sptr_routing_table_node;	}	else	{		ospf_add_node_to_end_of_list ((OSPF_GENERIC_NODE *)sptr_routing_table_node,            						 (OSPF_GENERIC_NODE *)ospf.sptr_routing_table_head[table_type][hash_id]);	}}/*******************************************************************************************************************************/void ospf_delete_routing_table_node (OSPF_ROUTING_TABLE_NODE* sptr_routing_table_node){	ULONG hash_id;	enum OSPF_ROUTE_TABLE_TYPE table_type;	OSPF_PRINTF_PROLOGUE (OSPF_PROLOGUE_PRINTF, "OSPF: Entering ospf_delete_routing_table_node\r\n");	if(sptr_routing_table_node == NULL)	{		OSPF_PRINTF_ALARM (OSPF_ALARM_PRINTF, "OSPF: ospf_delete_routing_table_node null routing table node\r\n");		return;	}	if(sptr_routing_table_node->sptr_routing_table_entry == NULL)	{		OSPF_PRINTF_ALARM (OSPF_ALARM_PRINTF, "OSPF: ospf_delete_routing_table_node null routing table entry\r\n");		return;	}	switch(sptr_routing_table_node->sptr_routing_table_entry->destination_type)	{		case OSPF_DESTINATION_TYPE_ASBR:		case OSPF_DESTINATION_TYPE_ABR:			table_type = OSPF_ROUTE_TABLE_ROUTER;			break;		case OSPF_DESTINATION_TYPE_VIRTUAL:		case OSPF_DESTINATION_TYPE_NETWORK:		case OSPF_DESTINATION_TYPE_ASE:			table_type = OSPF_ROUTE_TABLE_NETWORK;			break;		default:			OSPF_PRINTF_ALARM (OSPF_ALARM_PRINTF, "OSPF: ospf_delete_routing_table_node invalid destination type\r\n");			return;	}	hash_id = sptr_routing_table_node->sptr_routing_table_entry->destination_id;	hash_id = hash_id & OSPF_RT_HASH_MASK;	ospf_remove_node_from_list ((OSPF_GENERIC_NODE **)ospf.sptr_routing_table_head[table_type][hash_id],            					(OSPF_GENERIC_NODE *)sptr_routing_table_node);}/* SPR#76812 -- End */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -