亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? ospf_to_rtm.c

?? vxworks下ospf協(xié)議棧
?? C
字號:
/* ospf_to_rtm.c *//* Copyright 2000-2003 Wind River Systems, Inc. */#include "copyright_wrs.h"/*modification history--------------------02i,11jun03,ram SPR#88825 Added support for policy best match on redistributed routes02h,08may03,asr Changes to make OSPF virtual stack compatible02g,14may03,agi Changed RWOS semaphores to vxWorks semaphores02f,28jan03,ram SPR 85050 Added support for external route redistribution based on                OSPF external metric values02e,14jan03,asr SPR 85632 Disallow redistribution of loopback address02d,06jan03,ram SPR 85432 Changes to allow more OSPF external route processing02c,09dec02,ram SPR 83418 Added support for OSPF metric type and value configuration02b,03dec02,ram Modified ospf_export_route_from_rtm to allow static routes                with full mask. SPR#8458802a,08oct02,agi Fixed compiler warnings27,22jun02,kc   Modified ospf_export_route_from_rtm() to also checked			and ignore routes with OSPF_INTERNAL route tag.26,30may02,kc           Fixed ospf_export_route_from_rtm() to correctly process			the route information from tRtmOspf task. Modified                        ospf_is_protocol_redistributed() to check for default			route redistibution capability.25,24may02,kc           Modified ospf_register_with_rtm() for Synth Stack to use                        ospf_sysctl_input as argument to protocol_rtm_init().24,06april02,kc         Properly check the protocol_rtm_init() return value.23,07february02,jkw	Fix forwarding address for external lsa.22,27sep01,kc		Modified ospf_export_route_from_rtm() so that it no			longer reference21,26september00,reshma	Added WindRiver CopyRight20,25september00,reshma	RFC-1587 implementation for OSPF NSSA Option, also			tested against ANVL.19,07july00,reshma	Unix compatibility related changes.18,04april00,reshma	Added some MIB support (Read only).Passed all important			ANVL OSPF tests.17,23december99,reshma	Compatibility with VxWorks-IP and VxWorks RTM-interface16,22july99,jack	Changes and more checks in export from bgp and export			from RTM into OSPF15,19july99,jack	RFC 1745 tag related changes14,10may99,jack		removed some debug stuff13,22february99,jack	Changes in function ospf_is_protocol_redistributed to			reflect changes in kroute.h (chnage in definition of                        OTHER_ROUTING_PROTOCOL_TYPE )12,22february99,jack	Changes in ospf_is_protocol_redistributed  to reflect			changes in kroute.h11,28december98,jack	Compiled and added some comments10,11november98,jac	Config changes, linted and big endian changes09,30october98,jack	Incorporate changes for compilation on Vxworks08,23august98,jack	ANVL tested OSPF with PATRICIA tree route table and no                        recursion07,10august98,jack	PATRICIA Route Table Based OSPF Code Base06,04june98,jack	Integration with RTM and BGP05,24april98,jack	RTM changes04,10july97,cindy	Pre-release v1.52b03,02october97,cindy	Release Version 1.5202,22october96,cindy	Release Version 1.5001,05june96,cindy	First Beta Release*//*DESCRIPTIONospf_to_rtm.c is used for importing and exporting routes to the routing tablemanager.  This file registers the OSPF protocol to the routing table manager.This file is used every time a route needs to be exported or imported.*/#include "ospf.h"#if defined (__OSPF_VIRTUAL_STACK__)#include "ospf_vs_lib.h"#endif /* __OSPF_VIRTUAL_STACK__ */#if defined(__OSPF_ROUTER_STACK__)#include "protocol_rtm_interface.h"#endif /*__OSPF_ROUTER_STACK__*//************************************************************************/#if defined (__RTM__)/**********************************************************************************************************************************/static enum TEST ospf_is_network_redistributed (IP_ROUTE_ENTRY *sptr_ip_route, LINK *sptr_address_mask_pair);/* SPR 83418 -- Begin */static void ospf_set_default_redistribution_metrics (IP_ROUTE_ENTRY *sptr_ip_route);/* SPR 83418 -- End *//**********************************************************************************************************************************/enum TEST ospf_register_with_rtm (void){	RTM_HANDLE protocol_handle = 0;#if defined (__OSPF_ROUTER_STACK__)	protocol_handle = protocol_rtm_init(#if defined (VIRTUAL_STACK)	                  ospf.ospf_vsid,#endif /* VIRTUAL_STACK */	                  ospf_export_route_from_rtm,	                  ospf_sysctl_input,	                  "tRtmOspf" );    if ( protocol_handle == (RTM_HANDLE)NULL )	 {		OSPF_PRINTF_RTM (OSPF_RTM_PRINTF, "OSPF_RTM_PRINTF: Unable to register the routing call backs \n");		return (FAIL);	 }#else /*__OSPF_ROUTER_STACK__*/	OSPF_PRINTF_DEBUG (OSPF_DEBUG_PRINTF, "OSPF: Entering ospf_register_with_rtm\r\n");	OSPF_PRINTF_RTM (OSPF_RTM_PRINTF, "OSPF_RTM_PRINTF: Registering with RTM  \r\n");	protocol_handle = rtm_register_protocol (RTM_IP, RTM_OSPF_PROTOCOL_TYPE, 1, &ospf_export_route_from_rtm, 0x00);	if (protocol_handle == NULL)		{		OSPF_PRINTF_RTM (OSPF_RTM_PRINTF, "OSPF_RTM_PRINTF: Failed to register with RTM: error code:%lx \r\n",			protocol_handle);		return (FAIL);		}#endif /* __OSPF_ROUTER_STACK__ */	ospf.ospf_rtm_handle = protocol_handle;	return (PASS);}/**********************************************************************************************************************************/STATUS ospf_export_route_from_rtm (int rtm_operation, ROUTE_DESC *sptr_rtm_route){	IP_ROUTE_ENTRY ip_route;	enum BOOLEAN mutex_acquired;	OSPF_PRINTF_DEBUG (OSPF_DEBUG_PRINTF, "OSPF: Entering ospf_export_route_from_rtm\r\n");    if ( sptr_rtm_route == NULL )        return ERROR;    memset( (char *)&ip_route, 0, sizeof(IP_ROUTE_ENTRY) );	rtm_translate_route_desc_to_ip_route_entry (sptr_rtm_route, &ip_route);    /* ignore routes that ospf added to the routing table */    if ( (ip_route.ipRouteProto == RTM_OSPF_PROTOCOL_TYPE) ||         (ip_route.route_tag == OSPF_INTERNAL) )        return OK;    /* if the RTF_GATEWAY flag is not set, this is direct connected route. Sanity     * check to determine if the route is also a default route. Default route has     * destination address 0.0.0.0, netmask 0.0.0.0, next hop of non-zero value     * and rtm flags of 0x101 (RTF_CLONING and RTF_UP).     */    if ( (sptr_rtm_route->flags & RTF_GATEWAY) != RTF_GATEWAY )    {        if ( sptr_rtm_route->flags & (RTF_CLONING | RTF_UP) )        {            if ( (ip_route.target != 0x00000000) || (ip_route.mask != 0x00000000) )                return OK;        }        else            return OK;  /* direct connected route with other RTF flags set, ignore it */    }	mutex_acquired = semTake (ospf_global_mutex, WAIT_FOREVER);	/* SPR 85432 -- Begin */	if (ospf_is_protocol_redistributed (&ip_route) == FAIL)		{		semGive (ospf_global_mutex);		return (ERROR);		}       semGive (ospf_global_mutex);	/* SPR 85432 -- End */	switch (rtm_operation)        {		case RTM_ADD:		/* SPR 85050 */		case RTM_ADDEXTRA:			{            /*             * the largest hop count for a RIP route is 15. If the metric value             * exceeded the max, ignore this RIP route since RIP will eventually             * remove this route when the garbage collection timer kicks in. If             * RIP later determines that the route is again reachable, the metric             * will be updated and we will receive the route change event via the             * routing socket message.             */			if ((ip_route.ipRouteProto == RTM_RIP_PROTOCOL_TYPE) &&                (ip_route.metric == 0x10))				{				break; /* ip_route.metric = OSPF_LSInfinity; */				}            /*             * When an AS external advertisement (LS Type = 5) is describing a default             * route, its Link State ID is set to DefaultDestination (0.0.0.0).             */			if (ospf.autonomous_system_border_router == TRUE)				{				/* SPR 85050 */				semTake (ospf_external_route_mutex, WAIT_FOREVER);				ospf_queue_export_route_to_ospf (ip_route.target,ip_route.mask,ip_route.metric, /*DefaultDestination*/ ip_route.gateway,												 ip_route.route_tag, ip_route.ipRouteProto);                semGive (ospf_external_route_mutex);				}			break;			}		case RTM_DELETE:		/* SPR 85050 */		case RTM_DELEXTRA:			{            delete_exported_route_from_ospf(ip_route.target,ip_route.mask, ip_route.metric, ip_route.gateway, ip_route.route_tag, ip_route.ipRouteProto);			break;			}		default:			break;		}	return (OK);}/**********************************************************************************************************************************/enum TEST ospf_is_protocol_redistributed (IP_ROUTE_ENTRY *sptr_ip_route){	OSPF_PRINTF_DEBUG (OSPF_DEBUG_PRINTF, "OSPF: Entering ospf_is_protocol_redistributed\r\n");	switch (sptr_ip_route->ipRouteProto)		{		case IP_ROUTING_PROTOCOL_TYPE:	/* covers OTHER_ROUTING_PROTOCOL_TYPE as well - satic  both have a value of 1*/		case LOCALLY_CONFIGURED_TYPE:			if (ospf.ospf_redistribution_configuration.redistribute_all_static == TRUE)				{				/* SPR 83418 -- Begin */				/* check first if this subnet is redistributed, if it is then the metric				 * type and value is set to the configured values else the default type and				 * value will apply */				 if (ospf_is_network_redistributed (sptr_ip_route,					(LINK *) &ospf.ospf_redistribution_configuration.ospf_imported_static_subnets) == FAIL)					{					ospf_set_default_redistribution_metrics(sptr_ip_route);					}				/* SPR 83418 -- End */				return (PASS);				}			if (ospf_is_network_redistributed (sptr_ip_route,				(LINK *) &ospf.ospf_redistribution_configuration.ospf_imported_static_subnets) == PASS)				{				return (PASS);				}            /* also check if default route redistribution capability is set */            /* SPR 83418 -- Begin */            if ((sptr_ip_route->target == 0x00000000) &&            	(ospf.ospf_redistribution_configuration.redistribute_ip_default_route == TRUE ))                {				ospf_set_default_redistribution_metrics(sptr_ip_route);                return (PASS);                }            /* SPR 83418 -- End */			break;		case RIP_PROTOCOL_TYPE:			if (ospf.ospf_redistribution_configuration.redistribute_all_rip == TRUE)				{				/* SPR 83418 -- Begin */				if (ospf_is_network_redistributed (sptr_ip_route,				   (LINK *) &ospf.ospf_redistribution_configuration.ospf_imported_rip_subnets) == FAIL)				   {				   ospf_set_default_redistribution_metrics(sptr_ip_route);				   }				/* SPR 83418 -- End */				return (PASS);				}			if (ospf_is_network_redistributed (sptr_ip_route,				(LINK *) &ospf.ospf_redistribution_configuration.ospf_imported_rip_subnets) == PASS)				{				return (PASS);				}			break;		case BGP_PROTOCOL_TYPE:			if (ospf.ospf_redistribution_configuration.redistribute_all_bgp == TRUE)				{				/* SPR 83418 -- Begin */				if (ospf_is_network_redistributed (sptr_ip_route,					(LINK *) &ospf.ospf_redistribution_configuration.ospf_imported_bgp_subnets) == FAIL)					{					ospf_set_default_redistribution_metrics(sptr_ip_route);					}				/* SPR 83418 -- End */				return (PASS);				}			if (ospf_is_network_redistributed (sptr_ip_route,				(LINK *) &ospf.ospf_redistribution_configuration.ospf_imported_bgp_subnets) == PASS)				{				return (PASS);				}			break;		default:			break;		}	return (FAIL);}/**********************************************************************************************************************************/static enum TEST ospf_is_network_redistributed (IP_ROUTE_ENTRY *sptr_ip_route, LINK *sptr_address_mask_pair){	OSPF_ADDRESS_MASK_PAIRS *sptr_address_mask_pair_to_check;	OSPF_ADDRESS_MASK_PAIRS *sptr_best_match_pair = NULL;	OSPF_PRINTF_DEBUG (OSPF_DEBUG_PRINTF, "OSPF: Entering ospf_is_network_redistributed\r\n");	/* SPR#88825 */	/* Find the best match for the redistributed route, if there is a match*/	for (sptr_address_mask_pair_to_check = (OSPF_ADDRESS_MASK_PAIRS *) sptr_address_mask_pair->sptr_forward_link;		sptr_address_mask_pair_to_check != NULL; sptr_address_mask_pair_to_check = sptr_address_mask_pair_to_check->sptr_forward_link)		{        /* special consideration for default route. If the redistribution policy         * is for default route, the comparison is only meaningful if the target         * entry is a default route as well. Otherwise, the present of the         * default route in the redistribution policy becomes the catch all for         * all the routes and that is not what we want         */        if ((sptr_address_mask_pair_to_check->network_address == 0x00000000) &&            (sptr_address_mask_pair_to_check->network_mask == 0x00000000) &&            (sptr_ip_route->target != 0x000000000) && (sptr_ip_route->mask != 0x00000000))            continue;		if ((sptr_address_mask_pair_to_check->network_address & sptr_address_mask_pair_to_check->network_mask) ==			(sptr_ip_route->target & sptr_address_mask_pair_to_check->network_mask))		{			if(sptr_best_match_pair == NULL)			{				/* First match found save it*/				sptr_best_match_pair = sptr_address_mask_pair_to_check;			}			else			{				/* A match was found before, choose the one with a larger mask*/				if(sptr_best_match_pair->network_mask < sptr_address_mask_pair_to_check->network_mask)				{					sptr_best_match_pair = sptr_address_mask_pair_to_check;				}			}		}	}	/* Apply policy if a match was found*/	if(sptr_best_match_pair != NULL)	{		/* SPR 83418 -- Begin */		/* Set the metric type and value */		if(sptr_best_match_pair->metric_value == 0x00000000)		{			sptr_ip_route->metric = sptr_ip_route->metric_4;		}		else		{			sptr_ip_route->metric = sptr_best_match_pair->metric_value;		}		sptr_ip_route->metric = (sptr_ip_route->metric & 0x00ffffff);		if(sptr_ip_route->metric == 0x00000000)			sptr_ip_route->metric = OSPF_EXTERNAL_DEFAULT_METRIC;		if(sptr_best_match_pair->metric_type == OSPF_EXTERNAL_METRIC_TYPE_2)		{			sptr_ip_route->metric = (sptr_ip_route->metric | OSPF_ASE_bit_E);		}		/* SPR 83418 -- End */		return (PASS);	}	return (FAIL);}/* SPR 83418 -- Begin *//**********************************************************************************************************************************/static void ospf_set_default_redistribution_metrics (IP_ROUTE_ENTRY *sptr_ip_route){	OSPF_PRINTF_DEBUG (OSPF_DEBUG_PRINTF, "OSPF: Entering ospf_set_redistribution_metrics\r\n");	/* Set the metric to the value entered by the external protocol, if that is zero	 * set the metric to 20 (external default) also the default type is type 2 external*/	sptr_ip_route->metric = sptr_ip_route->metric_4;	sptr_ip_route->metric = (sptr_ip_route->metric & 0x00ffffff);	if (sptr_ip_route->metric == 0x00000000)		sptr_ip_route->metric = OSPF_EXTERNAL_DEFAULT_METRIC;		sptr_ip_route->metric = (sptr_ip_route->metric | OSPF_ASE_bit_E);}/* SPR 83418 -- End */#endif

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲猫色日本管| 99久久精品费精品国产一区二区| 午夜一区二区三区在线观看| 亚洲欧洲av色图| 国产精品久久久久婷婷二区次| 久久婷婷成人综合色| 久久免费偷拍视频| 久久久精品国产免大香伊| 精品国产乱码久久久久久浪潮| 日韩一区二区免费在线观看| 欧美一卡二卡在线观看| 日韩欧美中文字幕精品| 日韩午夜激情电影| 久久婷婷成人综合色| 国产精品天天看| 日韩毛片视频在线看| 亚洲精品日日夜夜| 亚洲电影在线免费观看| 日韩电影一区二区三区四区| 美女www一区二区| 国产一区二区在线观看免费 | 国产成人高清视频| 风间由美一区二区av101| av一二三不卡影片| 91国偷自产一区二区三区成为亚洲经典 | 一本色道久久综合狠狠躁的推荐| 日本乱人伦aⅴ精品| 欧美日韩dvd在线观看| 日韩精品一区二区三区在线观看| 久久女同性恋中文字幕| 国产精品久久久久永久免费观看| 亚洲尤物在线视频观看| 日韩av在线免费观看不卡| 国产一区二区在线观看免费| 91在线看国产| 91麻豆精品国产91久久久久久 | 亚洲婷婷在线视频| 亚洲成av人影院| 国产麻豆午夜三级精品| 99精品欧美一区二区蜜桃免费| 欧美伊人久久久久久午夜久久久久| 欧美一区二区三区日韩视频| 国产精品视频一区二区三区不卡| 亚洲一区二区三区四区在线| 久久精品理论片| 91在线精品一区二区| 欧美精品成人一区二区三区四区| 亚洲综合图片区| 国产一区二区三区在线观看免费视频 | 亚洲一区二区三区四区在线| 久久99久久久久| 99re热这里只有精品视频| 欧美嫩在线观看| 国产精品天天看| 日本不卡视频在线| 成人手机电影网| 欧美一级夜夜爽| 亚洲手机成人高清视频| 久草精品在线观看| 在线免费观看日韩欧美| 欧美精品一区二| 午夜精品在线视频一区| 丁香桃色午夜亚洲一区二区三区| 欧美日韩专区在线| 欧美激情艳妇裸体舞| 美女网站视频久久| 在线精品视频一区二区三四| 国产天堂亚洲国产碰碰| 日韩成人一区二区| 在线精品视频免费观看| 欧美激情综合网| 黑人巨大精品欧美一区| 欧美网站大全在线观看| 国产精品麻豆视频| 国产一区欧美一区| 日韩欧美专区在线| 亚洲一区二区三区免费视频| 成人开心网精品视频| 精品久久一区二区三区| 日韩高清一区二区| 欧美性感一区二区三区| 亚洲欧洲日韩av| 粉嫩蜜臀av国产精品网站| 精品国产一区a| 奇米色777欧美一区二区| 欧美日韩一区不卡| 亚洲精品视频在线观看免费 | 久久久久久免费网| 青青草国产精品97视觉盛宴| 91国产免费看| 亚洲视频 欧洲视频| 成人av午夜电影| 欧美激情一区二区三区| 国产成人午夜视频| 久久日韩粉嫩一区二区三区| 韩国欧美国产1区| 欧美大片拔萝卜| 久久国产精品色| 91精品国产一区二区三区香蕉| 亚洲1区2区3区4区| 欧美日韩午夜在线| 亚洲福利国产精品| 欧美色综合天天久久综合精品| 亚洲乱码国产乱码精品精的特点 | 91精品国产免费| 日韩精品电影在线| 91精品久久久久久久99蜜桃 | 一本大道久久a久久精二百| 亚洲婷婷综合久久一本伊一区| 99re这里只有精品首页| 亚洲少妇最新在线视频| 色丁香久综合在线久综合在线观看| 一区二区三区中文在线观看| 欧美伊人久久大香线蕉综合69| 亚洲午夜av在线| 91精品国产品国语在线不卡| 另类人妖一区二区av| 久久网站最新地址| 99精品一区二区| 一区二区三区视频在线观看| 欧美日韩高清一区二区不卡| av在线综合网| 亚洲午夜视频在线观看| 欧美一区二区在线看| 国产在线国偷精品免费看| 中文一区一区三区高中清不卡| 色综合久久中文字幕综合网| 亚洲午夜精品在线| 精品福利在线导航| 99精品久久只有精品| 亚洲国产精品麻豆| 欧美成va人片在线观看| 国产精品一区一区三区| 日韩一区二区在线观看| 午夜精品视频在线观看| 日韩视频中午一区| 国产精品中文欧美| 成人欧美一区二区三区白人| 色噜噜狠狠色综合欧洲selulu| 日本不卡的三区四区五区| 精品噜噜噜噜久久久久久久久试看 | 粉嫩av一区二区三区| 国产日韩综合av| 粉嫩嫩av羞羞动漫久久久| 综合久久久久久久| 一本大道久久a久久精二百| 亚洲免费在线电影| 日韩欧美精品在线| 成人激情图片网| 亚洲国产精品一区二区久久| 欧美精品高清视频| 成人av网站在线| 午夜精品一区二区三区三上悠亚| 日韩欧美第一区| 成人福利在线看| 香蕉影视欧美成人| 国产精品人妖ts系列视频| 欧美日韩在线免费视频| 国内精品久久久久影院色 | 一区二区三区中文字幕| 色综合天天视频在线观看| 国产偷v国产偷v亚洲高清| 不卡的看片网站| 亚洲国产精品精华液网站| 欧美群妇大交群的观看方式| 国产美女娇喘av呻吟久久| 亚洲一区二区三区免费视频| 亚洲精品一线二线三线无人区| 成人午夜精品在线| 国内欧美视频一区二区 | 亚洲成人自拍偷拍| 久久久精品免费免费| 欧美一级专区免费大片| 成人久久久精品乱码一区二区三区 | 国产精品嫩草99a| 91精品国产综合久久久久久漫画 | 亚洲精品乱码久久久久久久久| 制服视频三区第一页精品| 国产成人午夜片在线观看高清观看| 日本在线不卡视频| 中文字幕在线播放不卡一区| 欧美一级视频精品观看| 在线观看亚洲一区| 成人精品亚洲人成在线| 麻豆国产精品一区二区三区| 亚洲欧洲一区二区在线播放| 日韩欧美不卡在线观看视频| 91麻豆精品国产无毒不卡在线观看| av电影天堂一区二区在线观看| 美女性感视频久久| 亚洲亚洲精品在线观看| 亚洲三级久久久| 中文子幕无线码一区tr| 日韩欧美在线一区二区三区| 国产一区二区在线观看免费| 日本美女一区二区| 有坂深雪av一区二区精品| 国产精品初高中害羞小美女文| 国产精品久久精品日日| 久久久久高清精品|