亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
91精品久久久久久久99蜜桃| 成人国产精品免费网站| 欧美三级中文字幕在线观看| 亚洲视频一区在线| 在线观看三级视频欧美| 亚洲国产欧美在线人成| 91精品中文字幕一区二区三区| 美女一区二区三区在线观看| 久久理论电影网| 99精品欧美一区| 午夜精品一区二区三区免费视频 | 国产一区二区三区免费看| 久久久激情视频| 99riav久久精品riav| 亚洲尤物视频在线| 欧美va在线播放| 成人a区在线观看| 亚洲va欧美va人人爽午夜| 日韩一区二区三免费高清| 国产一区二区三区免费观看| 综合久久久久久久| 91精选在线观看| 成人av免费在线观看| 日韩在线a电影| 国产日韩欧美高清| 欧美精品一二三四| 国产精品123| 亚洲超碰97人人做人人爱| 精品动漫一区二区三区在线观看| 9l国产精品久久久久麻豆| 婷婷国产在线综合| 中文字幕国产精品一区二区| 欧美日韩一区二区三区在线看 | 久久久一区二区三区捆绑**| 在线免费观看日韩欧美| 精品一区二区三区在线播放| 亚洲激情在线激情| 国产日韩欧美一区二区三区综合| 欧美日韩极品在线观看一区| 成人h版在线观看| 韩国成人精品a∨在线观看| 亚洲伦理在线精品| 国产亚洲成年网址在线观看| 欧美影视一区在线| 粉嫩一区二区三区性色av| 手机精品视频在线观看| 国产精品高潮久久久久无| 欧美一级视频精品观看| 色综合久久88色综合天天6 | 亚洲人成网站精品片在线观看| 欧美一区二区三区男人的天堂| 91麻豆视频网站| 高清beeg欧美| 韩国中文字幕2020精品| 午夜伦理一区二区| 亚洲在线免费播放| 国产精品网站在线观看| 久久久久久**毛片大全| 在线不卡a资源高清| 日韩欧美一卡二卡| 欧美日韩mp4| 欧美在线不卡视频| av电影天堂一区二区在线| 黄色小说综合网站| 激情欧美日韩一区二区| 免费在线看一区| 日韩高清国产一区在线| 天堂蜜桃一区二区三区| 亚洲精品乱码久久久久久 | 欧美精品一区二| 欧美一区二区在线免费播放| 欧美揉bbbbb揉bbbbb| 欧美日韩午夜精品| 91精品国模一区二区三区| 色呦呦一区二区三区| 色婷婷av一区二区三区大白胸| av欧美精品.com| 成人app网站| 日本精品免费观看高清观看| 色久综合一二码| 欧美日韩视频在线第一区| 欧美三级日韩三级| 欧美久久婷婷综合色| 在线不卡免费av| 精品成人免费观看| 国产精品天天看| 亚洲色图视频免费播放| 伊人婷婷欧美激情| 午夜成人免费电影| 精品一区二区三区的国产在线播放| 久久精品国产99国产精品| 国产精品自产自拍| av网站免费线看精品| 色综合欧美在线| 在线电影国产精品| 久久精品一区二区| 亚洲蜜桃精久久久久久久| 亚洲小说春色综合另类电影| 天堂va蜜桃一区二区三区 | 国产精品婷婷午夜在线观看| 亚洲欧美日韩国产中文在线| 亚洲成人av免费| 激情综合网av| 99久久精品免费| 欧美精品在线一区二区三区| 日韩一级视频免费观看在线| 国产网红主播福利一区二区| 一区二区理论电影在线观看| 青青草97国产精品免费观看无弹窗版| 久久精品国产精品亚洲红杏| 不卡av在线免费观看| 欧美精三区欧美精三区| 国产亚洲欧洲997久久综合 | 蜜桃一区二区三区在线| 国产91丝袜在线18| 欧美日韩视频专区在线播放| 国产婷婷精品av在线| 婷婷国产v国产偷v亚洲高清| 国产成人精品免费在线| 欧美高清一级片在线| 国产喂奶挤奶一区二区三区| 午夜影院在线观看欧美| 国产成人午夜电影网| 欧美挠脚心视频网站| 国产精品久久久久7777按摩| 午夜久久电影网| 99久久精品免费看| 日韩欧美高清一区| 一区二区三区产品免费精品久久75| 精品在线播放午夜| 色网站国产精品| 欧美国产日韩精品免费观看| 天天综合天天综合色| 不卡在线视频中文字幕| 日韩欧美国产精品一区| 亚洲午夜影视影院在线观看| 成人深夜福利app| 精品美女在线观看| 午夜精品一区二区三区三上悠亚| 成人夜色视频网站在线观看| 日韩一二三区视频| 亚洲国产成人porn| 97久久人人超碰| 久久精品水蜜桃av综合天堂| 人人超碰91尤物精品国产| 色88888久久久久久影院野外| 蜜桃久久久久久久| 欧美日本一区二区三区| 亚洲日穴在线视频| 成人午夜av电影| 国产午夜亚洲精品午夜鲁丝片| 麻豆成人综合网| 69精品人人人人| 亚洲不卡一区二区三区| 欧亚一区二区三区| 一区二区三区四区在线播放| 99视频超级精品| 国产精品久久久久久久第一福利| 国产精品亚洲综合一区在线观看| 日韩一区和二区| 蜜臀av性久久久久蜜臀aⅴ四虎| 欧美日韩三级在线| 亚洲成人av在线电影| 欧美日韩一区二区在线观看| 婷婷久久综合九色综合绿巨人| 欧美日韩一级视频| 日韩在线一二三区| 日韩视频在线永久播放| 免费久久99精品国产| 日韩一区二区免费在线观看| 麻豆精品精品国产自在97香蕉| 日韩女优视频免费观看| 精品在线观看免费| 久久午夜电影网| 成人妖精视频yjsp地址| 成人免费视频在线观看| 一本色道**综合亚洲精品蜜桃冫| 中文字幕日韩av资源站| 色偷偷久久一区二区三区| 一区二区三区国产精华| 制服视频三区第一页精品| 欧美bbbbb| 国产日韩欧美高清在线| 91在线高清观看| 国产精品欧美精品| 亚洲欧美偷拍三级| 黑人精品欧美一区二区蜜桃| 亚洲欧美日韩一区二区三区在线观看| 成人av在线影院| 一区二区欧美国产| 日韩亚洲欧美中文三级| 国产精品综合久久| 亚洲欧美日韩国产综合在线 | 精品一区二区在线免费观看| 久久久美女艺术照精彩视频福利播放| 成人小视频免费在线观看| 亚洲视频一区二区免费在线观看| 欧美日韩精品一区二区三区| 激情久久五月天| 最新日韩在线视频|