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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? ospf_receive_packet.c

?? vxworks下ospf協議棧
?? C
?? 第 1 頁 / 共 2 頁
字號:
/* ospf_receive_packet.c - OSPF receive packet *//* Copyright 2000-2003 Wind River Systems, Inc. */#include "copyright_wrs.h"/*modification history--------------------02f,18aug03,agi Changed call to ospf_MD_string() to common code mdString()02e,30jul03,agi Changed call to MD_string() to ospf_MD_string()                updated copyright02d,26may03,agi Changed rwos_get_system_elapsed_time_second() to                ospf_get_system_elapsed_time_second()02a,03dec02,ram SPR 84312 - Change elapsed time to return seconds21,10April02,bt	modified PTMP to follow the same path of POINT-TO-POINT20,11january02,jkw			Fix TSR 72091, neighbors not being added.19,12november,jkw			Virtual link hello fix.18,21sep01,kc     			Obsolete ospf_router_receive_packet() routine.17,20jun01,jkw	  			Added unnumbered link support16,26september00,reshma	Added WindRiver CopyRight15,25september00,reshma	RFC-1587 implementation for OSPF NSSA Option, also tested against ANVL.14,07july00,reshma			Unix compatibility related changes.13,04april00,reshma		Added some MIB support (Read only).Passed all important ANVL OSPF tests.12,23december99,reshma		Compatibility with VxWorks-IP and VxWorks RTM-interface11,28december98,jack		Compiled and added some comments10,11november98,jack		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_receive_packet.c is used for processing received packets.  This file will validate the OSPFpacket header.  This file will find out the specific packet type and pass the packet to theappropriate file.This file is used whenever a new OSPF packet is received.*/#include "ospf.h"#if defined (__OSPF_VIRTUAL_STACK__)#include "ospf_vs_lib.h"#endif /* __OSPF_VIRTUAL_STACK__ */#include	<net/if.h>/*******************************************************************************************************************************//*opaque lsa added error condition for opaque lsa jkw*/static char *cptr_packet_state_string[] = {"Good","Bad Acknowledgement","Duplicate Acknowledgement",	"Bad State in Acknowledgement","Bad Type in Acknowledgement","Mismatched E_bit in Database Description",	"Bad Router ID in Database Description","Bad State in Database Description","Bad Type in Database Description",	"Mismatched E_bit in Hello","Bad ID in Hello","Bad Mask in Hello","Bad Router Dead Interval in Hello",	"Bad Timer in Hello","Bad Virtual in Hello","Bad Authentication Key","Bad Authentication Type",	"Interface is Down","Bad Packet Type","Request is Bogus","Request is Empty","Bad State in Update",    "Stop Processing the Packet","","","Opaque Option not Enabled","Interface Mismatch MTU"};/*#endif*/ /*__NSSA__*//*******************************************************************************************************************************/static enum TEST ospf_check_validity_of_interface (OSPF_INTERFACE *sptr_interface,ULONG source_address,ULONG destination_address);static enum TEST ospf_check_validity_of_multicast_interface (OSPF_INTERFACE *sptr_interface,ULONG destination_address);static enum TEST ospf_check_validity_of_unicast_packet (OSPF_INTERFACE *sptr_interface,ULONG destination_address);static enum TEST ospf_check_size_of_ospf_packet (USHORT total_length_of_packet,USHORT size_of_ospf_packet);static enum TEST ospf_verify_ospf_header_and_get_neighbor (USHORT packet_size,OSPF_HEADER *sptr_ospf_header,	OSPF_INTERFACE **ptr_to_sptr_interface, ULONG source_address,ULONG size_of_ospf_packet,OSPF_NEIGHBOR **ptr_to_sptr_neighbor,	ULONG *sptr_cryptographic_sequence_number);static enum TEST ospf_verify_checksum_field_in_ospf_packet_header (OSPF_HEADER *sptr_ospf_header,ULONG size_of_ospf_packet);static enum TEST ospf_verify_area_id_and_get_neighbor (OSPF_HEADER *sptr_ospf_header,OSPF_INTERFACE **ptr_to_sptr_interface, ULONG source_address,	OSPF_NEIGHBOR **ptr_to_sptr_neighbor);static enum TEST ospf_authenticate_packet (USHORT packet_size,OSPF_HEADER *sptr_ospf_header,OSPF_INTERFACE *sptr_interface,	OSPF_AUTHENTICATION *sptr_ospf_authentication,OSPF_NEIGHBOR *sptr_neighbor,ULONG *sptr_cryptographic_sequence_number);static enum TEST ospf_do_md5_authentication (USHORT packet_size,OSPF_HEADER *sptr_ospf_header,	OSPF_INTERFACE *sptr_interface,OSPF_NEIGHBOR *sptr_neighbor);static enum TEST ospf_find_matching_key_for_md5_authentication (OSPF_INTERFACE *sptr_interface, BYTE received_key,	OSPF_AUTHENTICATION_KEY **ptr_to_sptr_authentication_key);static enum OSPF_PACKET_STATE ospf_process_specific_packet_type (OSPF_HEADER *sptr_ospf_header,OSPF_INTERFACE *sptr_interface,	OSPF_NEIGHBOR *sptr_neighbor,ULONG source_address,ULONG destination_address,ULONG size_of_ospf_packet,ULONG cryptographic_sequence_number);static enum TEST ospf_verify_area_id_and_virtual_neighbor (ULONG router_id, ULONG area_id, OSPF_INTERFACE **ptr_to_sptr_interface, OSPF_NEIGHBOR **ptr_to_sptr_neighbor);/***************************************************************************************************************************** *  The IP stack must call the following routine to pass an OSPF protocol packet down to the OSPF level for processing. * *  According to section 8.2 of the OSPF specification (page 57), "In order for the packet to be accepted at the IP level, *  it must pass a number of tests, even before the packet is passed to OSPF for processing: *       1. The IP checksum must be correct. *       2. The packet's IP destination address must be the IP address of the receiving interface, *          or one of the IP multicast addresses AllSPFRouters or AllDRouters. *       3. The IP protocol specified must be OSPF (89). *       4. Locally originated packets should not be passed on to OSPF.  That is, the source IP *          address should be examined to make sure this is not a multicast packet that the router *          itself generated." * *  ospf_router_rx_packet () assumes the packet has already passed these tests. * ****************************************************************************//* section 8.2 of OSPF specification (page 56) */void ospf_router_rx_packet (OSPF_INTERFACE *sptr_interface, OSPF_PACKET *sptr_ospf_packet, USHORT packet_size,							ULONG source_ip_address, ULONG destination_ip_address){	OSPF_HEADER *sptr_ospf_header;	USHORT size_of_ospf_packet;	USHORT total_length_of_packet;	ULONG cryptographic_sequence_number;	OSPF_NEIGHBOR *sptr_neighbor;	enum TEST return_type;	enum OSPF_PACKET_STATE packet_processing_return_type;	ULONG source_address_in_host_order;	ULONG destination_address_in_host_order;	OSPF_PRINTF_DEBUG (OSPF_DEBUG_PRINTF, "OSPF: Entering ospf_router_rx_packet\r\n");	sptr_ospf_header = &sptr_ospf_packet->header;	if (sptr_interface == NULL)		{		return;		}	source_address_in_host_order = source_ip_address;	source_address_in_host_order = net_to_host_long (source_address_in_host_order);	destination_address_in_host_order = destination_ip_address;	destination_address_in_host_order = net_to_host_long (destination_address_in_host_order);	return_type = ospf_check_validity_of_interface (sptr_interface, source_address_in_host_order,		destination_address_in_host_order);	if (return_type == FAIL)		{		OSPF_PRINTF_ALARM (OSPF_ALARM_PRINTF, "OSPF: Dropped incoming packet - Invalid Interface\r\n");		return;		}	size_of_ospf_packet = sptr_ospf_header->length;	size_of_ospf_packet = net_to_host_short (size_of_ospf_packet);    total_length_of_packet = (USHORT)sptr_ospf_packet->ip_header.ip_len;	total_length_of_packet = net_to_host_short (total_length_of_packet);	return_type = ospf_check_size_of_ospf_packet (total_length_of_packet, size_of_ospf_packet);	if (return_type == FAIL)		{		OSPF_PRINTF_ALARM (OSPF_ALARM_PRINTF, "OSPF: Dropped incoming packet - Invalid Size of Packet\r\n");		return;		}	return_type = ospf_verify_ospf_header_and_get_neighbor (packet_size, sptr_ospf_header,		&sptr_interface, source_address_in_host_order, (ULONG) size_of_ospf_packet, &sptr_neighbor, &cryptographic_sequence_number);	if (return_type == FAIL)		{		OSPF_PRINTF_ALARM (OSPF_ALARM_PRINTF, "OSPF: Dropped incoming packet - Invalid OSPF Header or unable to find associated Neighbor\r\n");		return;		}    ospf_display_packet (sptr_ospf_packet, TRUE);	packet_processing_return_type = ospf_process_specific_packet_type (sptr_ospf_header, sptr_interface, sptr_neighbor,		source_address_in_host_order, destination_address_in_host_order, (ULONG) size_of_ospf_packet, cryptographic_sequence_number);	if ((packet_processing_return_type != GOOD_RECEIVE) && (packet_processing_return_type != STOP_PROCESSING_PACKET))		{		OSPF_PRINTF_ALARM (OSPF_ALARM_PRINTF, "OSPF: Received Packet Dropped due to Error:  %s\r\n",			cptr_packet_state_string[packet_processing_return_type]);		}	return;}/******************************************************************************************************************************/static enum TEST ospf_check_validity_of_interface (OSPF_INTERFACE *sptr_interface,ULONG source_address,ULONG destination_address){	enum TEST return_type;	OSPF_PRINTF_DEBUG (OSPF_DEBUG_PRINTF, "OSPF: Entering ospf_check_validity_of_interface\r\n");	if (sptr_interface->state == OSPF_INTERFACE_IS_DOWN)		/* something is wrong because the interface state is set to DOWN */		{		return (FAIL);		}	if (ospf.ip_multicast == TRUE)		{		return_type = ospf_check_validity_of_multicast_interface (sptr_interface, destination_address);		}	else		{		return_type = ospf_check_validity_of_unicast_packet (sptr_interface, destination_address);		}	if (return_type == FAIL)		{		return (FAIL);		}	if (source_address == sptr_interface->address)		{		return (FAIL);		}	else		{		return (PASS);		}}/******************************************************************************************************************************/static enum TEST ospf_check_validity_of_multicast_interface (OSPF_INTERFACE *sptr_interface,ULONG destination_address){	enum TEST return_type;	OSPF_PRINTF_DEBUG (OSPF_DEBUG_PRINTF, "OSPF: Entering ospf_check_validity_of_multicast_interface\r\n");	if (destination_address == OSPF_ADDR_ALLSPF)		{		/* Multicast to All SPF routers */		if (sptr_interface == NULL)			{			return (FAIL);			}		switch (sptr_interface->type)			{			case OSPF_POINT_TO_POINT:			case OSPF_BROADCAST:				break;			default:				{				return (FAIL);				}			}		}	else if (destination_address == OSPF_ADDR_ALLDR)		{		/* Multicast to All Designated Router routers */		if ((sptr_interface == NULL) || ((destination_address & OSPF_IF_MULTICAST_ALLDR) != 0x00000000L))			{			return (FAIL);			}		switch (sptr_interface->state)			{			case OSPF_INTERFACE_DESIGNATED_ROUTER:					/* third bullet item under verifying the OSPF packet header (page 58) */			case OSPF_INTERFACE_BACKUP_DESIGNATED_ROUTER:				{				if ((sptr_interface->type == OSPF_BROADCAST) && (sptr_interface->priority > 0x0000))					{					return (PASS);					}				else					{					return (FAIL);					}				}			default:				{				return (FAIL);				}			}		}	else		{		return_type = ospf_check_validity_of_unicast_packet (sptr_interface, destination_address);		return (return_type);		}	return (PASS);}/******************************************************************************************************************************/static enum TEST ospf_check_validity_of_unicast_packet (OSPF_INTERFACE *sptr_interface,ULONG destination_address){	enum BOOLEAN I_am_an_area_border_router;	OSPF_PRINTF_DEBUG (OSPF_DEBUG_PRINTF, "OSPF: Entering ospf_check_validity_of_unicast_packet\r\n");	I_am_an_area_border_router = ospf_check_if_area_border_router ();	/* Unicast packet */	if (sptr_interface != NULL)		{		/* Local source */		if ( (destination_address != sptr_interface->address) && (I_am_an_area_border_router == FALSE) )			{#if defined (__UNNUMBERED_LINK__)			if ((sptr_interface->address == 0x00000000L) && (sptr_interface->type == OSPF_POINT_TO_POINT))				{				return (PASS); /* unnumbered links excused */				}			else				{				return (FAIL);				}#else /* __UNNUMBERED_LINK__ */			return (FAIL);#endif /* __UNNUMBERED_LINK__ */			}		else if (destination_address == sptr_interface->address)			{			return (PASS);  /* NEW */			}		}	if (I_am_an_area_border_router == TRUE)		{		/* Non-local source, could be a virtual link */		return (PASS);		}	return (FAIL);}/******************************************************************************************************************************/static enum TEST ospf_check_size_of_ospf_packet (USHORT total_length_of_packet,USHORT size_of_ospf_packet){	OSPF_PRINTF_DEBUG (OSPF_DEBUG_PRINTF, "OSPF: Entering ospf_check_size_of_ospf_packet\r\n");	if (size_of_ospf_packet < OSPF_PACKET_SIZE)		{		return (FAIL);		}	else if (size_of_ospf_packet > total_length_of_packet)		{		return (FAIL);		}	else		{		return (PASS);		}}/**************************************************************************//* section 8.2 of OSPF specification (page 57-58) */static enum TEST ospf_verify_ospf_header_and_get_neighbor (USHORT packet_size,OSPF_HEADER *sptr_ospf_header,	OSPF_INTERFACE **ptr_to_sptr_interface, ULONG source_address,ULONG size_of_ospf_packet,OSPF_NEIGHBOR **ptr_to_sptr_neighbor,	ULONG *sptr_cryptographic_sequence_number){	OSPF_AUTHENTICATION	*sptr_ospf_authentication;	USHORT swapped_auth_type;	enum TEST return_type;	OSPF_PRINTF_DEBUG (OSPF_DEBUG_PRINTF, "OSPF: Entering ospf_verify_ospf_header_and_get_neighbor\r\n");	*ptr_to_sptr_neighbor = NULL;	if (sptr_ospf_header->version != OSPF_VERSION)	/* first bullet item under verifying the OSPF packet header (page 57) */		{		OSPF_PRINTF_ALARM (OSPF_ALARM_PRINTF, "OSPF: Version mismatch\r\n");		return (FAIL);		}	/* part of fifth bullet item under verifying the OSPF packet header (page 58) */	return_type = ospf_verify_checksum_field_in_ospf_packet_header (sptr_ospf_header, size_of_ospf_packet);	if (return_type == FAIL)		{		return (FAIL);		}	/* second bullet item under verifying the OSPF packet header (pages 57-58) */	return_type = ospf_verify_area_id_and_get_neighbor (sptr_ospf_header, ptr_to_sptr_interface, source_address, ptr_to_sptr_neighbor);	if (return_type == FAIL)		{		return (FAIL);		}	/* forth and fifth bullet items under verifying the OSPF packet header (page 58) */	swapped_auth_type = net_to_host_short (sptr_ospf_header->authentication_type);	if (swapped_auth_type == (*ptr_to_sptr_interface)->authentication.type)		{		sptr_ospf_authentication = &((*ptr_to_sptr_interface)->authentication);		}	else if (( (*ptr_to_sptr_interface)->flags._bit.secondary_authentication == TRUE) &&		(swapped_auth_type == (*ptr_to_sptr_interface)->authentication2.type))		{		sptr_ospf_authentication = &((*ptr_to_sptr_interface)->authentication2);		}	else		{		OSPF_PRINTF_ALARM (OSPF_ALARM_PRINTF, "OSPF: Received Authentication Type is not supported on this interface\r\n");		return (FAIL);		}	return_type = ospf_authenticate_packet (packet_size, sptr_ospf_header, *ptr_to_sptr_interface, sptr_ospf_authentication,		*ptr_to_sptr_neighbor, sptr_cryptographic_sequence_number);	return (return_type);}/******************************************************************************************************************************/static enum TEST ospf_verify_checksum_field_in_ospf_packet_header (OSPF_HEADER *sptr_ospf_header,ULONG size_of_ospf_packet){	UNION_OSPF_AUTHENTICATION_FIELD authentication_field;	USHORT swapped_auth_type;	enum TEST return_type;	OSPF_PRINTF_DEBUG (OSPF_DEBUG_PRINTF, "OSPF: Entering ospf_verify_checksum_field_in_ospf_packet_header\r\n");

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久国内精品自在自线400部| 国产精品麻豆久久久| 亚洲成人资源在线| 色国产综合视频| 一区二区三区精品在线| 欧美日韩在线观看一区二区| 亚洲午夜免费电影| 在线成人免费视频| 久久精品免费观看| 国产欧美视频在线观看| 成人黄色一级视频| 一区二区三区中文在线| 欧美亚洲一区二区三区四区| 亚洲成av人片一区二区三区| 欧美一区二区二区| 韩国av一区二区三区| 欧美经典三级视频一区二区三区| 懂色av一区二区三区蜜臀 | 裸体健美xxxx欧美裸体表演| 欧美猛男超大videosgay| 美腿丝袜亚洲三区| 欧美韩日一区二区三区| 欧洲精品一区二区三区在线观看| 日韩国产成人精品| 国产午夜亚洲精品不卡| 色综合久久88色综合天天| 日本一不卡视频| 欧美韩国日本综合| 5858s免费视频成人| 国产成人精品免费在线| 亚洲午夜激情网站| 国产午夜亚洲精品午夜鲁丝片| 91精品91久久久中77777| 奇米一区二区三区| 国产精品久久毛片| 日韩欧美久久久| 91在线观看成人| 精品无人码麻豆乱码1区2区| 亚洲另类在线一区| 久久久亚洲综合| 在线免费观看一区| 国产成人日日夜夜| 日韩精品91亚洲二区在线观看| 欧美国产一区在线| 4438x成人网最大色成网站| 波多野结衣视频一区| 麻豆精品一区二区综合av| 中文字幕一区二区5566日韩| 日韩精品中文字幕一区二区三区| av在线不卡电影| 黑人精品欧美一区二区蜜桃| 亚洲国产精品久久久久秋霞影院| 国产拍欧美日韩视频二区| 欧美久久久久久久久久| 在线精品视频一区二区三四| 国产suv精品一区二区三区| 天堂久久久久va久久久久| 亚洲天天做日日做天天谢日日欢 | av成人老司机| 国产一区91精品张津瑜| 丝袜a∨在线一区二区三区不卡| 国产精品无码永久免费888| 亚洲精品在线一区二区| 欧美三区在线观看| 91麻豆国产福利精品| 成人污污视频在线观看| 精东粉嫩av免费一区二区三区| 亚洲国产欧美日韩另类综合| 亚洲人一二三区| 欧美国产精品中文字幕| 国产午夜精品一区二区三区视频 | 在线免费观看视频一区| 99视频精品在线| 国产宾馆实践打屁股91| 国内精品国产成人| 国产一区中文字幕| 国产综合成人久久大片91| 狠狠色丁香婷婷综合久久片| 捆绑调教一区二区三区| 日韩成人精品在线| 日韩激情在线观看| 日韩精品视频网| 蜜桃视频在线一区| 麻豆视频观看网址久久| 国内外成人在线视频| 国产一区二区三区香蕉| 国产乱码字幕精品高清av| 国内精品免费**视频| 国模冰冰炮一区二区| 国产精品影音先锋| 成人高清免费在线播放| zzijzzij亚洲日本少妇熟睡| 99精品视频在线播放观看| 色婷婷综合久久久中文一区二区| 在线中文字幕不卡| 91精品综合久久久久久| 日韩一级成人av| 国产拍欧美日韩视频二区| 中文字幕亚洲不卡| 亚洲va欧美va人人爽| 日本女优在线视频一区二区| 激情图片小说一区| 成熟亚洲日本毛茸茸凸凹| 色呦呦国产精品| 欧美日韩国产不卡| 精品免费视频一区二区| 国产精品久久久久久久久晋中| 一区二区三区自拍| 日韩av不卡一区二区| 国产一区亚洲一区| 色综合欧美在线视频区| 欧美一区三区二区| 欧美激情艳妇裸体舞| 亚洲成人先锋电影| 国产成人免费在线视频| 欧美性三三影院| 亚洲男同1069视频| 日韩精品一级中文字幕精品视频免费观看 | 亚洲桃色在线一区| 午夜欧美电影在线观看| 美女视频黄 久久| 大陆成人av片| 4438x亚洲最大成人网| 国产精品日日摸夜夜摸av| 五月天亚洲精品| 国产精品1024久久| 欧美艳星brazzers| 欧美经典三级视频一区二区三区| 亚洲国产毛片aaaaa无费看| 蜜臀av亚洲一区中文字幕| 不卡视频一二三| 欧美一区二区三区系列电影| 国产精品久久久久影院色老大| 日韩高清在线一区| 99国产精品久久久久久久久久久| 日韩一级高清毛片| 亚洲一区二区三区影院| 高清shemale亚洲人妖| 欧美一二区视频| 亚洲一区av在线| 丰满亚洲少妇av| 日韩欧美中文一区二区| 一区二区三区在线免费播放| 国产综合成人久久大片91| 6080yy午夜一二三区久久| 亚洲精品视频在线| 成人精品免费网站| 精品国产免费人成电影在线观看四季 | 精品国产99国产精品| 亚洲小说春色综合另类电影| 国产iv一区二区三区| 日韩美女主播在线视频一区二区三区| 亚洲精品视频免费看| 成人午夜精品在线| 久久精品夜夜夜夜久久| 激情国产一区二区| 日韩欧美国产一区二区在线播放 | 不卡av免费在线观看| 精品国产乱码久久久久久浪潮| 婷婷中文字幕一区三区| 在线一区二区三区| 曰韩精品一区二区| 99精品在线免费| 1区2区3区精品视频| 波多野结衣一区二区三区| 国产精品免费丝袜| 99热精品一区二区| 亚洲欧洲av色图| 91在线观看视频| 亚洲免费观看在线视频| 91免费版在线| 夜夜爽夜夜爽精品视频| 欧美性色综合网| 99精品欧美一区二区三区综合在线| 久久久噜噜噜久久中文字幕色伊伊| 久久精品99国产精品| 欧美电视剧在线看免费| 九九久久精品视频| 26uuu国产在线精品一区二区| 精品在线免费视频| 久久久久久久久蜜桃| 丁香亚洲综合激情啪啪综合| 国产精品婷婷午夜在线观看| 99久久精品国产观看| 亚洲精品中文在线| 欧美日韩在线一区二区| 青青草国产成人99久久| 欧美变态tickle挠乳网站| 国产在线精品一区二区夜色| 欧美激情一区二区三区四区| 成人免费毛片嘿嘿连载视频| 中文字幕一区二区三区不卡| 在线视频中文字幕一区二区| 亚洲va国产天堂va久久en| 欧美一区二区视频免费观看| 国产一区二区三区精品欧美日韩一区二区三区 | 日韩高清不卡一区二区三区| 91精品久久久久久蜜臀| 国内精品第一页| 亚洲婷婷在线视频|