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

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

?? radius_attribute.c

?? vxworks下radius協議棧 的源代碼
?? C
?? 第 1 頁 / 共 2 頁
字號:
/* radius_attribute.c *//* Implementation of functions to verify the validity of RADIUS attributes,	*//* and to read and write RADIUS attributes from/to RADIUS packets.			*//* Copyright 1984 - 2000 Wind River Systems, Inc. */#include "copyright_wrs.h"/*modification history____________________01d,26aug03,snd Changes done to remove Compilation warnings01c,22mar02,md  concatenate multiple EAP Message attributes upon received 				from RADIUS server into one EAP packet data01b,27feb02,md  bug fixes01a,19dec00,md  merged from visual source safe*//************************************************************************//*	Copyright (C) 1993 - 1999 RouterWare, Inc.   								*//*	Unpublished - rights reserved under the Copyright Laws of the			*//*	United States.  Use, duplication, or disclosure by the 					*//*	Government is subject to restrictions as set forth in 					*//*	subparagraph (c)(1)(ii) of the Rights in Technical Data and 			*//*	Computer Software clause at 252.227-7013.										*//*	RouterWare, Inc., 3961 MacArthur Suite 212 Newport Beach, CA 92660	*//************************************************************************/#include <ctype.h>#include <stdio.h>#include <string.h>#include "radius.h"#include "attribute_control_structures.h"/************************************************************************************************/static ATTRIBUTE_CONTROL *radius_get_attribute_control_table (enum RADIUS_CODE code);static enum TEST radius_check_attribute (ATTRIBUTE_CONTROL *sptr_attribute_control, ATTRIBUTE_COUNT *sptr_attribute_count, 	UINT index);static enum TEST radius_verify_modifier (ATTRIBUTE_CONTROL *sptr_attribute_control, ATTRIBUTE_COUNT *attribute_count, UINT index);static void convert_bytes_to_printable_ascii (BYTE *bptr_input_buffer, UINT length, char *cptr_output_buffer);#ifdef __EAP__static enum TEST radius_read_eap_attributes_from_packet (RADIUS_ATTRIBUTE_ENTRY_IN_PACKET *sptr_attribute_entry_in_packet, UINT packet_length,														 RADIUS_LIST_CONTROLLER* p_radius_attribute_list_controller);#endif /* __EAP__ */#ifdef __RADIUS_ATTRIBUTE_VERIFICATION_DEBUG__bool radius_verify_attribute_value (RADIUS_ATTRIBUTE_ENTRY* p_attribute);#endif /*__RADIUS_ATTRIBUTE_VERIFICATION_DEBUG__*//************************************************************************************************* radius_verify_attributes ()	verifies that the attributes in response packet comply with draft rfc. 	Verification algorithm:  	1: Scan attribute list, getting attribute type, and count.	2: Scan the attribute table.	   For each attribute check the following		switch (presence)			ILLEGAL - if attribute in list, error			ZERO OR MORE - if not present, check modifier alternate			                if present, check modifier both and dependent			ONLY_ONE - self explanatory			ONE_OR_MORE - self explanatory ************************************************************************************************/bool radius_verify_attributes (enum RADIUS_CODE code,  RADIUS_LIST_CONTROLLER* p_radius_attribute_list_controller){	ATTRIBUTE_COUNT attribute_count;	ATTRIBUTE_CONTROL *sptr_attribute_control;	RADIUS_ATTRIBUTE_ENTRY* p_attribute;	ULONG accounting_status;	UINT index;	RW_CONTAINER_ITERATOR attribute_iterator;		sptr_attribute_control = NULL;	p_attribute = NULL;	attribute_iterator = 0;	sptr_attribute_control = radius_get_attribute_control_table (code);		if (sptr_attribute_control == NULL) 		{		return (true);		}				memset (&attribute_count, 0, sizeof (UINT) * MAXIMUM_RADIUS_ATTRIBUTE_TYPE);	attribute_iterator = p_radius_attribute_list_controller->iterator;		rw_container_goto_front (attribute_iterator);		while (rw_container_is_at_end (attribute_iterator) == false)		{		p_attribute = rw_container_at (attribute_iterator);#ifdef __RADIUS_ATTRIBUTE_VERIFICATION_DEBUG__		if (radius_verify_attribute_value (p_attribute) == false)			{			radius_printf (RADIUS_ALARM_PRINTF, "RADIUS: radius_verify_attribute_value: Value of attribute %d invalid.\n", p_attribute->type);						return (false);			}		radius_printf (RADIUS_ALARM_PRINTF, "RADIUS: radius_verify_attribute_value: Value of attribute %d valid.\n", p_attribute->type);#endif /*__RADIUS_ATTRIBUTE_VERIFICATION_DEBUG__*/		if (p_attribute->type == RADIUS_ACCT_STATUS_TYPE)			{						radius_util_deserialize_ulong (p_attribute->value, &accounting_status);			if ((code == RADIUS_ACCOUNTING_REQUEST) && (accounting_status > RADIUS_ACCOUNTING_OFF))				{				return (true);			/*Will not check tunnel accounting attributes.*/				}			}				attribute_count.count[p_attribute->type]++;				rw_container_next (attribute_iterator);		}			for (index = 0; index < MAXIMUM_RADIUS_ATTRIBUTE_TYPE; ++index)		{		if (radius_check_attribute (sptr_attribute_control, &attribute_count, index) == FAIL)			{			return (false);			}		}						return (true);}	/*****************************************************************************/static ATTRIBUTE_CONTROL *radius_get_attribute_control_table (enum RADIUS_CODE code){	switch (code)		{		case RADIUS_ACCESS_REQUEST:			return (access_request_control); 					case RADIUS_ACCESS_ACCEPT:			return (access_accept_control);						case RADIUS_ACCESS_REJECT:			return (access_reject_control);					case RADIUS_ACCOUNTING_REQUEST:			return (accounting_request_control);					case RADIUS_ACCOUNTING_RESPONSE:			return (accounting_response_control);					case RADIUS_ACCESS_CHALLENGE:			return (access_challenge_control);					case RADIUS_STATUS_SERVER:		case RADIUS_STATUS_CLIENT:		case RADIUS_RESERVED:		default:			return (NULL);		}}/***************************************************************************/static enum TEST radius_check_attribute (ATTRIBUTE_CONTROL *sptr_attribute_control, 										ATTRIBUTE_COUNT *sptr_attribute_count, 										UINT index){	switch (sptr_attribute_control[index].presence)		{		case ILLEGAL:			if (sptr_attribute_count->count[index] != ZERO_ATTRIBUTE_COUNT) 				{				return (FAIL);				}			break;		case ZERO_OR_MORE:			if (radius_verify_modifier (sptr_attribute_control, sptr_attribute_count, index) == FAIL)				{				return (FAIL);				}			break;		case ZERO_OR_ONE:			if (sptr_attribute_count->count[index] > MINIMUM_ATTRIBUTE_COUNT)				{				return (FAIL);				}			break;		case ONE_ONLY:			if (sptr_attribute_count->count[index] != MINIMUM_ATTRIBUTE_COUNT)				{				return (FAIL);				}			break;		case ONE_OR_MORE:			if (sptr_attribute_count->count[index] == ZERO_ATTRIBUTE_COUNT)				{				return (FAIL);				}			break;		default:			/* compiler error if we get here. Table not formed well */			break;		}	return (PASS);}/***************************************************************************/static enum TEST radius_verify_modifier (ATTRIBUTE_CONTROL *sptr_attribute_control, ATTRIBUTE_COUNT *sptr_attribute_count, UINT index){	switch (sptr_attribute_control[index].modifier)		{		case NO_MODIFIER:				break;		case ALTERNATE:			if (sptr_attribute_count->count[index] != ZERO_ATTRIBUTE_COUNT)				{				break;				}			if (sptr_attribute_count->count[sptr_attribute_control[index].other_type] == ZERO_ATTRIBUTE_COUNT)				{				return (FAIL);				}			break;		case BOTH:			if ((sptr_attribute_count->count[index] == ZERO_ATTRIBUTE_COUNT) ||				(sptr_attribute_count->count[sptr_attribute_control[index].other_type] == ZERO_ATTRIBUTE_COUNT))				{				return (FAIL);				}			break;		default:			break;		}	return (PASS);}/*****************************************************************************************/UINT get_radius_attribute_list_length (RADIUS_LIST_CONTROLLER* p_radius_attribute_list_controller){	UINT length;	RW_CONTAINER_ITERATOR attribute_iterator;	RADIUS_ATTRIBUTE_ENTRY *p_attribute;	length = 0;	if (p_radius_attribute_list_controller == NULL) 		{		return (0);		}	attribute_iterator = p_radius_attribute_list_controller->iterator;	rw_container_goto_front (attribute_iterator);		while (rw_container_is_at_end (attribute_iterator) == false)		{		p_attribute = rw_container_at (attribute_iterator);				length += (p_attribute->length_of_attribute_value + RADIUS_SIZE_OF_ATTRIBUTE_HEADER_IN_PACKET);		rw_container_next (attribute_iterator);		}	return (length);}/*****************************************************************************************/enum TEST radius_write_attributes_to_packet (RADIUS_PACKET *sptr_packet, RADIUS_LIST_CONTROLLER* p_radius_attribute_list_controller){	RW_CONTAINER_ITERATOR attribute_iterator;	RADIUS_ATTRIBUTE_ENTRY_IN_PACKET *sptr_attribute_entry_in_packet;	RADIUS_ATTRIBUTE_ENTRY* p_attribute;	if (sptr_packet == NULL) 		{		return (FAIL);		}	sptr_attribute_entry_in_packet = (RADIUS_ATTRIBUTE_ENTRY_IN_PACKET *) &sptr_packet->data;	attribute_iterator = p_radius_attribute_list_controller->iterator;		rw_container_goto_front (attribute_iterator);		while (rw_container_is_at_end (attribute_iterator) == false)		{		p_attribute = rw_container_at (attribute_iterator);				sptr_attribute_entry_in_packet->type = (BYTE_ENUM (RADIUS_ATTRIBUTE_TYPE)) p_attribute->type;		sptr_attribute_entry_in_packet->length = (BYTE) (p_attribute->length_of_attribute_value + 			RADIUS_SIZE_OF_ATTRIBUTE_HEADER_IN_PACKET);		memcpy (&sptr_attribute_entry_in_packet->value[0], &p_attribute->value[0], p_attribute->length_of_attribute_value);		sptr_attribute_entry_in_packet = (RADIUS_ATTRIBUTE_ENTRY_IN_PACKET *) ((BYTE *) sptr_attribute_entry_in_packet + 			sptr_attribute_entry_in_packet->length);		rw_container_next (attribute_iterator);		}	return (PASS);}/*****************************************************************************************/enum TEST radius_read_attributes_from_packet (RADIUS_PACKET *sptr_packet, RADIUS_LIST_CONTROLLER* p_radius_attribute_list_controller){#ifndef __EAP__	enum RADIUS_ATTRIBUTE_TYPE type;	UINT attribute_length;#endif /* __EAP__ */	RADIUS_ATTRIBUTE_ENTRY_IN_PACKET *sptr_attribute_entry_in_packet;	UINT packet_length;	if (sptr_packet == NULL) 		{		return (FAIL);		}	if (p_radius_attribute_list_controller == NULL) 		{		return (FAIL);		}	sptr_attribute_entry_in_packet = (RADIUS_ATTRIBUTE_ENTRY_IN_PACKET *) &sptr_packet->data;	packet_length = (UINT) (swap (sptr_packet->header.length));	if (packet_length < sizeof (RADIUS_PACKET_HEADER)) 		{		return (FAIL);		}	packet_length -= sizeof (RADIUS_PACKET_HEADER);#ifdef __EAP__	if (radius_read_eap_attributes_from_packet (sptr_attribute_entry_in_packet, packet_length, p_radius_attribute_list_controller)		== FAIL)		{		return (FAIL);		}#else	while (packet_length > 0)		{		type = sptr_attribute_entry_in_packet->type;		attribute_length = (UINT) sptr_attribute_entry_in_packet->length;		packet_length -= attribute_length;		if (radius_add_attribute_to_list ((RADIUS_ATTRIBUTE_LIST_HANDLE) p_radius_attribute_list_controller, 			type, attribute_length - RADIUS_SIZE_OF_ATTRIBUTE_HEADER_IN_PACKET, 			&sptr_attribute_entry_in_packet->value[0]) == FAIL)			{			return (FAIL);			}		sptr_attribute_entry_in_packet = (RADIUS_ATTRIBUTE_ENTRY_IN_PACKET *) ((UINT) sptr_attribute_entry_in_packet + attribute_length);		}#endif /* __EAP__ */	return (PASS);}#ifdef __EAP__/*****************************************************************************************//* Read EAP Message attributes from the packet and concatenate them into one			 *//* consecutive data buffer before adding them to the attribute list handle if			 *//* necessary.																			 *//*****************************************************************************************/static enum TEST radius_read_eap_attributes_from_packet (RADIUS_ATTRIBUTE_ENTRY_IN_PACKET *sptr_attribute_entry_in_packet, UINT packet_length,														 RADIUS_LIST_CONTROLLER* p_radius_attribute_list_controller){	enum RADIUS_ATTRIBUTE_TYPE type;	UINT attribute_length;	UINT length_of_attribute_data;	BYTE temp_attribute_data[MAXIMUM_RADIUS_RX_PACKET_SIZE];	bool eap_message_found = false;	int index = 0;	while (packet_length > 0)		{		type = sptr_attribute_entry_in_packet->type;		attribute_length = (UINT) sptr_attribute_entry_in_packet->length;		length_of_attribute_data = attribute_length - RADIUS_SIZE_OF_ATTRIBUTE_HEADER_IN_PACKET;		if (type == RADIUS_EAP_MESSAGE)			{			memcpy (&temp_attribute_data[index], &sptr_attribute_entry_in_packet->value[0], length_of_attribute_data);						index += length_of_attribute_data;			eap_message_found = true;			}		else			{			if (eap_message_found == true)				{				if (radius_add_attribute_to_list ((RADIUS_ATTRIBUTE_LIST_HANDLE) p_radius_attribute_list_controller, 					RADIUS_EAP_MESSAGE, index, 					&temp_attribute_data[0]) == FAIL)					{					return (FAIL);					}								index = 0;				eap_message_found = false;				}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美日韩精品电影| 亚洲国产精品久久人人爱| 亚洲自拍与偷拍| 国产一区二区三区免费观看| 欧美日韩一二三| 精品国产乱码久久久久久免费 | 56国语精品自产拍在线观看| 欧美国产一区二区在线观看| 日本网站在线观看一区二区三区| 成人一区二区三区视频在线观看| 欧美精品777| 亚洲另类色综合网站| 国产精品一区专区| 日韩免费高清av| 亚洲动漫第一页| 色999日韩国产欧美一区二区| 国产日本亚洲高清| 久久国产精品区| 欧美一区二区在线观看| 一区二区成人在线| 色网站国产精品| 亚洲视频中文字幕| 成人sese在线| 国产精品乱码一区二区三区软件| 久久爱另类一区二区小说| 91精品福利在线一区二区三区| 夜夜爽夜夜爽精品视频| 色婷婷久久久久swag精品 | 欧美一级电影网站| 亚洲1区2区3区4区| 91超碰这里只有精品国产| 亚洲一区二区综合| 欧美在线你懂得| 亚洲午夜久久久久久久久久久 | 一区二区三区精品视频| 一本大道久久a久久综合婷婷| 亚洲婷婷综合久久一本伊一区| 成人激情午夜影院| 成人欧美一区二区三区黑人麻豆 | 欧美日韩1234| 五月天亚洲婷婷| 7777精品久久久大香线蕉| 五月天国产精品| 日韩午夜在线观看视频| 国产综合成人久久大片91| 久久久久高清精品| 成人一区二区三区| 亚洲欧洲综合另类在线 | 国产成人综合精品三级| 国产精品美女久久久久aⅴ国产馆| 国产91精品精华液一区二区三区 | 欧美电视剧在线看免费| 国产一区二区在线视频| 国产精品国产自产拍高清av | 99re热这里只有精品视频| 亚洲黄色性网站| 91精品综合久久久久久| 国产精品自在在线| 亚洲男人天堂一区| 欧美婷婷六月丁香综合色| 麻豆精品久久精品色综合| 久久久精品日韩欧美| 色www精品视频在线观看| 美女视频一区在线观看| 亚洲国产精品t66y| 在线亚洲欧美专区二区| 捆绑调教美女网站视频一区| 国产精品私人影院| 欧美另类久久久品| 国产成人av福利| 亚洲午夜激情网页| 国产亚洲自拍一区| 欧美主播一区二区三区美女| 国产综合久久久久影院| 一区二区成人在线视频| 国产欧美一区二区在线观看| 欧美日韩另类一区| 高清av一区二区| 人人超碰91尤物精品国产| 国产精品不卡在线| 欧美精品一区二区不卡| 日本久久电影网| 国产精品一区二区三区四区| 五月综合激情网| 中文字幕视频一区二区三区久| 欧美一级日韩一级| 一本色道久久综合亚洲aⅴ蜜桃| 另类小说综合欧美亚洲| 亚洲男人电影天堂| 国产亚洲一区二区在线观看| 3d成人动漫网站| 91福利社在线观看| 成人av在线资源网站| 国产在线视频精品一区| 琪琪一区二区三区| 亚洲一本大道在线| 亚洲图片你懂的| 国产精品久久久一本精品 | 国产一区二区三区香蕉| 日本最新不卡在线| 五月婷婷另类国产| 亚洲国产精品综合小说图片区| 中文字幕不卡在线播放| 久久精品欧美一区二区三区麻豆| 欧美一卡二卡三卡| 欧美高清视频在线高清观看mv色露露十八| 不卡av在线网| av在线不卡电影| 国产精品18久久久久久久久| 久久成人免费网| 捆绑紧缚一区二区三区视频| 蜜桃久久久久久久| 日本少妇一区二区| 免费日本视频一区| 毛片av一区二区| 久久国产精品露脸对白| 久久99精品国产麻豆不卡| 奇米影视一区二区三区| 喷水一区二区三区| 欧美a级一区二区| 日韩电影在线一区二区三区| 日韩影院在线观看| 蜜桃久久久久久久| 国产一区二区三区在线观看免费| 国产精品自产自拍| 国产成人精品免费看| av激情成人网| 一道本成人在线| 欧美精品一卡二卡| 日韩一区二区三免费高清| 欧美精品一区二区在线播放| 久久综合狠狠综合久久综合88| 欧美极品aⅴ影院| 亚洲精品福利视频网站| 亚洲福利视频一区| 久草热8精品视频在线观看| 极品少妇一区二区| 99久久精品国产麻豆演员表| 欧美日韩在线观看一区二区| 91精品啪在线观看国产60岁| 日韩精品最新网址| 欧美国产禁国产网站cc| 一卡二卡欧美日韩| 美女网站在线免费欧美精品| 丁香婷婷综合五月| 欧美性色综合网| 精品国产乱码久久久久久蜜臀| 国产欧美日韩在线看| 一区二区三区四区精品在线视频| 日韩av网站免费在线| 不卡的av在线播放| 欧美一级精品大片| 成人欧美一区二区三区小说| 日韩影院在线观看| 成人一级片在线观看| 欧美日韩精品一区二区在线播放| 久久久三级国产网站| 亚洲激情一二三区| 国产麻豆精品theporn| 欧美体内she精高潮| 久久人人爽爽爽人久久久| 亚洲自拍偷拍综合| 国产高清精品在线| 日韩一级二级三级| 亚洲情趣在线观看| 国产精品影视网| 666欧美在线视频| 亚洲乱码中文字幕| 风间由美性色一区二区三区| 9191国产精品| 夜夜精品浪潮av一区二区三区| 国产激情精品久久久第一区二区 | aaa国产一区| 欧美大白屁股肥臀xxxxxx| 亚洲精品视频免费看| 紧缚奴在线一区二区三区| 欧美日韩一区不卡| **欧美大码日韩| 国产在线一区观看| 欧美一区二区三区四区视频| 一区二区理论电影在线观看| 不卡视频一二三四| 国产日产欧美精品一区二区三区| 男女男精品视频网| 欧美日韩国产综合视频在线观看 | 国产欧美精品一区| 久久精品国产亚洲高清剧情介绍| 欧美伊人久久大香线蕉综合69| 亚洲视频1区2区| 成人永久免费视频| 国产亚洲欧美一区在线观看| 美女网站视频久久| 欧美xxxx老人做受| 日本欧美久久久久免费播放网| 欧美日韩一区二区三区在线看| 综合久久国产九一剧情麻豆| 99国产精品99久久久久久| 国产精品麻豆久久久| 成人avav在线| 亚洲欧洲日本在线|