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

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

?? chap.c

?? “華為模塊(GTM900)+ ARM(LPC2104) + LWIP1.1”以PPP 方式實(shí)現(xiàn)GPRS 無線數(shù)據(jù)傳輸
?? C
?? 第 1 頁 / 共 2 頁
字號:
/*** WARNING - THIS HAS NEVER BEEN FINISHED ***//****************************************************************************** chap.c - Network Challenge Handshake Authentication Protocol program file.** Copyright (c) 2003 by Marc Boucher, Services Informatiques (MBSI) inc.* portions Copyright (c) 1997 by Global Election Systems Inc.** The authors hereby grant permission to use, copy, modify, distribute,* and license this software and its documentation for any purpose, provided* that existing copyright notices are retained in all copies and that this* notice and the following disclaimer are included verbatim in any * distributions. No written agreement, license, or royalty fee is required* for any of the authorized uses.** THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS *AS IS* AND ANY EXPRESS OR* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.******************************************************************************** REVISION HISTORY** 03-01-01 Marc Boucher <marc@mbsi.ca>*   Ported to lwIP.* 97-12-04 Guy Lancaster <lancasterg@acm.org>, Global Election Systems Inc.*	Original based on BSD chap.c.*****************************************************************************//* * chap.c - Challenge Handshake Authentication Protocol. * * Copyright (c) 1993 The Australian National University. * All rights reserved. * * Redistribution and use in source and binary forms are permitted * provided that the above copyright notice and this paragraph are * duplicated in all such forms and that any documentation, * advertising materials, and other materials related to such * distribution and use acknowledge that the software was developed * by the Australian National University.  The name of the University * may not be used to endorse or promote products derived from this * software without specific prior written permission. * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. * * Copyright (c) 1991 Gregory M. Christy. * All rights reserved. * * Redistribution and use in source and binary forms are permitted * provided that the above copyright notice and this paragraph are * duplicated in all such forms and that any documentation, * advertising materials, and other materials related to such * distribution and use acknowledge that the software was developed * by Gregory M. Christy.  The name of the author may not be used to * endorse or promote products derived from this software without * specific prior written permission. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. */#include "ppp.h"#if PPP_SUPPORT > 0#include "magic.h"#if CHAP_SUPPORT > 0#include "randm.h"#include "auth.h"#include "md5.h"#include "chap.h"#include "chpms.h"#include "pppdebug.h"#include "timer.h"/*************************//*** LOCAL DEFINITIONS ***//*************************//************************//*** LOCAL DATA TYPES ***//************************//***********************************//*** LOCAL FUNCTION DECLARATIONS ***//***********************************//* * Protocol entry points. */static void ChapInit (int);static void ChapLowerUp (int);static void ChapLowerDown (int);static void ChapInput (int, u_char *, int);static void ChapProtocolReject (int);static int  ChapPrintPkt (u_char *, int,			      void (*) (void *, char *, ...), void *);static void ChapChallengeTimeout (void *);static void ChapResponseTimeout (void *);static void ChapReceiveChallenge (chap_state *, u_char *, int, int);static void ChapRechallenge (void *);static void ChapReceiveResponse (chap_state *, u_char *, int, int);static void ChapReceiveSuccess(chap_state *cstate, u_char *inp, u_char id, int len);static void ChapReceiveFailure(chap_state *cstate, u_char *inp, u_char id, int len);static void ChapSendStatus (chap_state *, int);static void ChapSendChallenge (chap_state *);static void ChapSendResponse (chap_state *);static void ChapGenChallenge (chap_state *);/******************************//*** PUBLIC DATA STRUCTURES ***//******************************/chap_state chap[NUM_PPP];		/* CHAP state; one for each unit */struct protent chap_protent = {    PPP_CHAP,    ChapInit,    ChapInput,    ChapProtocolReject,    ChapLowerUp,    ChapLowerDown,    NULL,    NULL,#if 0    ChapPrintPkt,    NULL,#endif    1,    "CHAP",#if 0    NULL,    NULL,    NULL#endif};/*****************************//*** LOCAL DATA STRUCTURES ***//*****************************/static char *ChapCodenames[] = {	"Challenge", "Response", "Success", "Failure"};/***********************************//*** PUBLIC FUNCTION DEFINITIONS ***//***********************************//* * ChapAuthWithPeer - Authenticate us with our peer (start client). * */void ChapAuthWithPeer(int unit, char *our_name, int digest){	chap_state *cstate = &chap[unit];		cstate->resp_name = our_name;	cstate->resp_type = digest;		if (cstate->clientstate == CHAPCS_INITIAL ||			cstate->clientstate == CHAPCS_PENDING) {		/* lower layer isn't up - wait until later */		cstate->clientstate = CHAPCS_PENDING;		return;	}		/*	 * We get here as a result of LCP coming up.	 * So even if CHAP was open before, we will 	 * have to re-authenticate ourselves.	 */	cstate->clientstate = CHAPCS_LISTEN;}/* * ChapAuthPeer - Authenticate our peer (start server). */void ChapAuthPeer(int unit, char *our_name, int digest){	chap_state *cstate = &chap[unit];		cstate->chal_name = our_name;	cstate->chal_type = digest;		if (cstate->serverstate == CHAPSS_INITIAL ||			cstate->serverstate == CHAPSS_PENDING) {		/* lower layer isn't up - wait until later */		cstate->serverstate = CHAPSS_PENDING;		return;	}		ChapGenChallenge(cstate);	ChapSendChallenge(cstate);		/* crank it up dude! */	cstate->serverstate = CHAPSS_INITIAL_CHAL;}/**********************************//*** LOCAL FUNCTION DEFINITIONS ***//**********************************//* * ChapInit - Initialize a CHAP unit. */static void ChapInit(int unit){	chap_state *cstate = &chap[unit];		BZERO(cstate, sizeof(*cstate));	cstate->unit = unit;	cstate->clientstate = CHAPCS_INITIAL;	cstate->serverstate = CHAPSS_INITIAL;	cstate->timeouttime = CHAP_DEFTIMEOUT;	cstate->max_transmits = CHAP_DEFTRANSMITS;	/* random number generator is initialized in magic_init */}/* * ChapChallengeTimeout - Timeout expired on sending challenge. */static void ChapChallengeTimeout(void *arg){	chap_state *cstate = (chap_state *) arg;		/* if we aren't sending challenges, don't worry.  then again we */	/* probably shouldn't be here either */	if (cstate->serverstate != CHAPSS_INITIAL_CHAL &&			cstate->serverstate != CHAPSS_RECHALLENGE)		return;		if (cstate->chal_transmits >= cstate->max_transmits) {		/* give up on peer */		CHAPDEBUG((LOG_ERR, "Peer failed to respond to CHAP challenge\n"));		cstate->serverstate = CHAPSS_BADAUTH;		auth_peer_fail(cstate->unit, PPP_CHAP);		return;	}		ChapSendChallenge(cstate);		/* Re-send challenge */}/* * ChapResponseTimeout - Timeout expired on sending response. */static void ChapResponseTimeout(void *arg){	chap_state *cstate = (chap_state *) arg;		/* if we aren't sending a response, don't worry. */	if (cstate->clientstate != CHAPCS_RESPONSE)		return;		ChapSendResponse(cstate);		/* re-send response */}/* * ChapRechallenge - Time to challenge the peer again. */static void ChapRechallenge(void *arg){	chap_state *cstate = (chap_state *) arg;		/* if we aren't sending a response, don't worry. */	if (cstate->serverstate != CHAPSS_OPEN)		return;		ChapGenChallenge(cstate);	ChapSendChallenge(cstate);	cstate->serverstate = CHAPSS_RECHALLENGE;}/* * ChapLowerUp - The lower layer is up. * * Start up if we have pending requests. */static void ChapLowerUp(int unit){	chap_state *cstate = &chap[unit];		if (cstate->clientstate == CHAPCS_INITIAL)		cstate->clientstate = CHAPCS_CLOSED;	else if (cstate->clientstate == CHAPCS_PENDING)		cstate->clientstate = CHAPCS_LISTEN;		if (cstate->serverstate == CHAPSS_INITIAL)		cstate->serverstate = CHAPSS_CLOSED;	else if (cstate->serverstate == CHAPSS_PENDING) {		ChapGenChallenge(cstate);		ChapSendChallenge(cstate);		cstate->serverstate = CHAPSS_INITIAL_CHAL;	}}/* * ChapLowerDown - The lower layer is down. * * Cancel all timeouts. */static void ChapLowerDown(int unit){	chap_state *cstate = &chap[unit];		/* Timeout(s) pending?  Cancel if so. */	if (cstate->serverstate == CHAPSS_INITIAL_CHAL ||			cstate->serverstate == CHAPSS_RECHALLENGE)		UNTIMEOUT(ChapChallengeTimeout, cstate);	else if (cstate->serverstate == CHAPSS_OPEN			&& cstate->chal_interval != 0)		UNTIMEOUT(ChapRechallenge, cstate);	if (cstate->clientstate == CHAPCS_RESPONSE)		UNTIMEOUT(ChapResponseTimeout, cstate);		cstate->clientstate = CHAPCS_INITIAL;	cstate->serverstate = CHAPSS_INITIAL;}/* * ChapProtocolReject - Peer doesn't grok CHAP. */static void ChapProtocolReject(int unit){	chap_state *cstate = &chap[unit];		if (cstate->serverstate != CHAPSS_INITIAL &&			cstate->serverstate != CHAPSS_CLOSED)		auth_peer_fail(unit, PPP_CHAP);	if (cstate->clientstate != CHAPCS_INITIAL &&			cstate->clientstate != CHAPCS_CLOSED)		auth_withpeer_fail(unit, PPP_CHAP);	ChapLowerDown(unit);		/* shutdown chap */}/* * ChapInput - Input CHAP packet. */static void ChapInput(int unit, u_char *inpacket, int packet_len){	chap_state *cstate = &chap[unit];	u_char *inp;	u_char code, id;	int len;		/*	 * Parse header (code, id and length).	 * If packet too short, drop it.	 */	inp = inpacket;	if (packet_len < CHAP_HEADERLEN) {		CHAPDEBUG((LOG_INFO, "ChapInput: rcvd short header.\n"));		return;	}	GETCHAR(code, inp);	GETCHAR(id, inp);	GETSHORT(len, inp);	if (len < CHAP_HEADERLEN) {		CHAPDEBUG((LOG_INFO, "ChapInput: rcvd illegal length.\n"));		return;	}	if (len > packet_len) {		CHAPDEBUG((LOG_INFO, "ChapInput: rcvd short packet.\n"));		return;	}	len -= CHAP_HEADERLEN;		/*	 * Action depends on code (as in fact it usually does :-).	 */	switch (code) {	case CHAP_CHALLENGE:		ChapReceiveChallenge(cstate, inp, id, len);		break;		case CHAP_RESPONSE:		ChapReceiveResponse(cstate, inp, id, len);		break;		case CHAP_FAILURE:		ChapReceiveFailure(cstate, inp, id, len);		break;		case CHAP_SUCCESS:		ChapReceiveSuccess(cstate, inp, id, len);		break;		default:				/* Need code reject? */		CHAPDEBUG((LOG_WARNING, "Unknown CHAP code (%d) received.\n", code));		break;	}}/* * ChapReceiveChallenge - Receive Challenge and send Response. */static void ChapReceiveChallenge(chap_state *cstate, u_char *inp, int id, int len){	int rchallenge_len;	u_char *rchallenge;	int secret_len;	char secret[MAXSECRETLEN];	char rhostname[256];	MD5_CTX mdContext;	u_char hash[MD5_SIGNATURE_SIZE];		CHAPDEBUG((LOG_INFO, "ChapReceiveChallenge: Rcvd id %d.\n", id));	if (cstate->clientstate == CHAPCS_CLOSED ||		cstate->clientstate == CHAPCS_PENDING) {		CHAPDEBUG((LOG_INFO, "ChapReceiveChallenge: in state %d\n",			   cstate->clientstate));		return;	}		if (len < 2) {		CHAPDEBUG((LOG_INFO, "ChapReceiveChallenge: rcvd short packet.\n"));

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
不卡一区二区在线| 欧美肥胖老妇做爰| 国产精品亚洲一区二区三区妖精| 青青草原综合久久大伊人精品优势| 亚洲精选在线视频| 亚洲男人的天堂在线aⅴ视频| **网站欧美大片在线观看| 亚洲国产成人在线| 国产精品福利一区二区三区| 国产精品成人午夜| 亚洲欧美乱综合| 玉米视频成人免费看| 欧美国产日韩在线观看| 欧美激情综合五月色丁香小说| 国产偷v国产偷v亚洲高清| 国产嫩草影院久久久久| 国产精品久久久久aaaa| 亚洲黄色免费网站| 午夜久久久久久| 老司机一区二区| 国产成人鲁色资源国产91色综| 国产成人鲁色资源国产91色综| 成人黄色av电影| 色婷婷精品久久二区二区蜜臂av| 色综合激情五月| 欧美剧情片在线观看| 日韩免费观看高清完整版| 久久老女人爱爱| 国产精品免费av| 伊人性伊人情综合网| 日本亚洲一区二区| 国产二区国产一区在线观看| www.欧美精品一二区| 欧美图片一区二区三区| 日韩欧美精品在线| 国产精品亲子伦对白| 亚洲影视在线观看| 久久99久国产精品黄毛片色诱| 国产福利精品一区| 欧美在线视频全部完| 日韩视频在线一区二区| 国产精品免费久久久久| 午夜精品aaa| 国产东北露脸精品视频| 欧美揉bbbbb揉bbbbb| 久久久五月婷婷| 亚洲影视在线观看| 国产精品99久久久久久久女警| 日本道免费精品一区二区三区| 日韩免费成人网| 日韩美女视频一区| 免费观看在线综合| 91亚洲精品久久久蜜桃网站| 欧美一级爆毛片| 亚洲欧洲成人av每日更新| 免费久久99精品国产| k8久久久一区二区三区| 日韩一区二区在线看| 日韩一区在线免费观看| 麻豆成人久久精品二区三区小说| 91视视频在线观看入口直接观看www| 欧美肥妇bbw| 亚洲欧美日韩人成在线播放| 美女网站色91| 欧美视频中文一区二区三区在线观看| 久久综合狠狠综合| 亚洲午夜av在线| 粉嫩av一区二区三区在线播放| 欧美精品日日鲁夜夜添| 亚洲丝袜制服诱惑| 国产麻豆精品95视频| 欧美一区二区性放荡片| 亚洲免费在线视频一区 二区| 国产一区二区三区黄视频| 欧美精品一二三四| 一区二区三区影院| 国产盗摄一区二区| 精品久久久久久最新网址| 香蕉加勒比综合久久| 色偷偷成人一区二区三区91| 日本一区二区成人在线| 九色综合国产一区二区三区| 欧美欧美欧美欧美| 亚洲一区二区三区四区在线免费观看 | 色综合天天综合网天天狠天天 | 精品三级av在线| 亚洲不卡一区二区三区| 色综合天天综合色综合av| 色综合久久综合| 成人免费视频播放| 精品日韩一区二区三区免费视频| 一区二区三区小说| 色婷婷香蕉在线一区二区| 亚洲欧洲av一区二区三区久久| 国产精品一二一区| 26uuu国产日韩综合| 九色综合国产一区二区三区| 欧美剧情片在线观看| 亚洲一区二区偷拍精品| 欧美综合亚洲图片综合区| 一区二区三区在线视频观看 | 欧美一级片在线看| 日韩在线一二三区| 欧美日韩免费在线视频| 午夜欧美电影在线观看| 欧美日韩国产综合一区二区 | 国产精品1区2区3区在线观看| 日韩欧美国产系列| 精品亚洲国内自在自线福利| 精品国产乱码久久久久久久久 | 国产精品99久| 久久精品视频网| 丁香一区二区三区| 国产精品麻豆网站| 91影院在线免费观看| 亚洲综合色网站| 欧美片在线播放| 久久成人久久鬼色| 久久久国产精品午夜一区ai换脸| 国产精品综合在线视频| 国产区在线观看成人精品 | 91麻豆精品国产无毒不卡在线观看| 五月天婷婷综合| 91精品国产免费| 国内精品国产成人| 国产精品视频一二| 91视频国产观看| 亚洲妇熟xx妇色黄| 日韩欧美一级二级三级久久久| 国产一区二区三区四| 欧美国产一区视频在线观看| 色婷婷激情综合| 日本麻豆一区二区三区视频| 久久久久久久久久美女| 94-欧美-setu| 精品国产一区二区国模嫣然| 国产女同性恋一区二区| 成人av中文字幕| 亚洲一区二区欧美激情| 4438x亚洲最大成人网| 国产一区二区伦理| 亚洲日穴在线视频| 7777精品伊人久久久大香线蕉完整版| 精品一区二区在线免费观看| 欧美国产成人在线| 欧美精品一卡二卡| 高清不卡在线观看av| 亚洲第一综合色| 久久综合九色综合欧美就去吻| 色综合天天天天做夜夜夜夜做| 日本不卡高清视频| 国产精品美女久久福利网站| 欧美日本一区二区三区四区| 国产乱人伦精品一区二区在线观看 | 欧美日本一区二区在线观看| 激情偷乱视频一区二区三区| 国产精品国产三级国产aⅴ中文 | 悠悠色在线精品| 久久综合色8888| 欧美日韩一区二区不卡| 国产精品资源在线| 亚洲一区欧美一区| 久久久av毛片精品| 欧美性xxxxxx少妇| 国产成人免费视频网站高清观看视频| 国产美女在线精品| 欧美白人最猛性xxxxx69交| av不卡在线观看| 久久成人av少妇免费| 亚洲综合色噜噜狠狠| 国产精品久久免费看| 日韩你懂的在线播放| 欧美日韩综合一区| eeuss鲁一区二区三区| 狠狠色丁香久久婷婷综合_中| 亚洲黄色小视频| 国产精品色婷婷| 欧美精品一区二区三区蜜臀| 欧美美女喷水视频| 91欧美激情一区二区三区成人| 国产一区二区三区综合| 青青草成人在线观看| 一区二区高清在线| 国产精品久久久一区麻豆最新章节| 欧美tk—视频vk| 欧美精品18+| 中文字幕精品一区| 26uuu成人网一区二区三区| 69堂亚洲精品首页| 欧美在线观看你懂的| 91视频免费播放| 99精品久久只有精品| 国产成人综合在线观看| 激情综合五月天| 日av在线不卡| 日韩精品国产精品| 污片在线观看一区二区| 亚洲成人av中文| 亚洲国产欧美在线| 亚洲国产一区二区视频|