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

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

?? ppplcp.c

?? 這是新華龍(www.xhl.xom.xn)開發的
?? C
?? 第 1 頁 / 共 2 頁
字號:
		}
		break;

	case LCP_ACCM:
		side_p->work.accm = pull32(bpp);
		toss -= 4;
#ifdef PPP_DEBUG_OPTIONS
if (PPPtrace & PPP_DEBUG_OPTIONS)
	trace_log(PPPiface, "    checking ACCM: 0x%08lx", side_p->work.accm);
#endif
		/* Remote host may ask to escape more control  */
		/* characters than we require, but must escape */
		/* at least the control chars that we require. */
		if ( (!request || (side_p->want.negotiate & LCP_N_ACCM))
		  && side_p->work.accm !=
		       (side_p->work.accm | side_p->want.accm) ) {
			side_p->work.accm |= side_p->want.accm;
			option_result = CONFIG_NAK;
		}
		break;

	case LCP_AUTHENT:
		side_p->work.authentication = pull16(bpp);
		toss -= 2;
#ifdef PPP_DEBUG_OPTIONS
if (PPPtrace & PPP_DEBUG_OPTIONS)
	trace_log(PPPiface, "    checking Auth Protocol: 0x%04x",
		side_p->work.authentication);
#endif
		/* Check if new value is appropriate */
		switch ( side_p->work.authentication ) {
		case PPP_PAP_PROTOCOL:
			/* Yes */
			break;
		default:
			side_p->work.authentication = PPP_PAP_PROTOCOL;
			option_result = CONFIG_NAK;
			break;
		};
		break;

	case LCP_MAGIC:
		side_p->work.magic_number = pull32(bpp);
		toss -= 4;
#ifdef PPP_DEBUG_OPTIONS
if (PPPtrace & PPP_DEBUG_OPTIONS)
	trace_log(PPPiface, "    checking Magic Number: 0x%08lx",
		side_p->work.magic_number);
#endif

		/* Ensure that magic numbers are different */
		if (side_p->work.magic_number == 0L
		 || lcp_p->remote.work.magic_number == lcp_p->local.work.magic_number) {
			side_p->work.magic_number += rdclock();
			option_result = CONFIG_NAK;
		}
		break;

	case LCP_PFC:
#ifdef PPP_DEBUG_OPTIONS
if (PPPtrace & PPP_DEBUG_OPTIONS)
	trace_log(PPPiface, "    checking Protocol compression");
#endif
		break;

	case LCP_ACFC:
#ifdef PPP_DEBUG_OPTIONS
if (PPPtrace & PPP_DEBUG_OPTIONS)
	trace_log(PPPiface, "    checking Addr/Ctl compression");
#endif
		break;

	case LCP_ENCRYPT:		/* not implemented */
	case LCP_QUALITY:		/* not implemented */
	default:
		option_result = CONFIG_REJ;
		break;
	};

	if (option_p->type > LCP_OPTION_LIMIT
	 || !(side_p->will_negotiate & (1 << option_p->type))) {
		option_result = CONFIG_REJ;
	}

	if ( toss < 0 )
		return -1;

	if ( !request  &&  toss > 0 ) {
		/* toss extra bytes in option */
		while( toss-- > 0 ) {
			if ( pullchar(bpp) == -1 )
				return -1;
		}
	}

	return (option_result);
}


/************************************************************************/
/* Check Link Control options requested by the remote host */
static int
lcp_request(fsm_p, config, data)
struct fsm_s *fsm_p;
struct config_hdr *config;
struct mbuf **data;
{
	struct lcp_s *lcp_p = fsm_p->pdv;
	int32 signed_length = config->len;
	struct mbuf *reply_bp = NULL;	/* reply packet */
	int reply_result = CONFIG_ACK;		/* reply to request */
	uint16 desired;				/* desired to negotiate */
	struct option_hdr option;		/* option header storage */
	int option_result;			/* option reply */

	PPP_DEBUG_ROUTINES("lcp_request()");
	lcp_p->remote.work.negotiate = FALSE;	/* clear flags */

	/* Process options requested by remote host */
	while (signed_length > 0  &&  ntohopt(&option, data) != -1) {
		if ((signed_length -= option.len) < 0) {
			PPP_DEBUG_CHECKS("LCP REQ: bad header length");
			free_p(data);
			free_p(&reply_bp);
			return -1;
		}

		if ( ( option_result = lcp_check( data, lcp_p,
				&(lcp_p->remote), &option, TRUE ) ) == -1 ) {
			PPP_DEBUG_CHECKS("LCP REQ: ran out of data");
			free_p(data);
			free_p(&reply_bp);
			return -1;
		}

#ifdef PPP_DEBUG_OPTIONS
if (PPPtrace & PPP_DEBUG_OPTIONS) {
	trace_log(PPPiface, "LCP REQ: result %s, option %d, length %d",
		fsmCodes[option_result],
		option.type,
		option.len);
}
#endif
		if ( option_result < reply_result ) {
			continue;
		} else if ( option_result > reply_result ) {
			/* Discard current list of replies */
			free_p(&reply_bp);
			reply_bp = NULL;
			reply_result = option_result;
		}

		/* remember that we processed option */
		if ( option_result != CONFIG_REJ
		  && option.type <= LCP_OPTION_LIMIT ) {
			lcp_p->remote.work.negotiate |= (1 << option.type);
		}

		/* Add option response to the return list */
		lcp_option( &reply_bp, &(lcp_p->remote.work),
			option.type, option.len, data );
	}

	/* Now check for any missing options which are desired */
	if ( fsm_p->retry_nak > 0
	 &&  (desired = lcp_p->remote.want.negotiate
		       & ~lcp_p->remote.work.negotiate) != 0 ) {
		switch ( reply_result ) {
		case CONFIG_ACK:
			free_p(&reply_bp);
			reply_bp = NULL;
			reply_result = CONFIG_NAK;
			/* fallthru */
		case CONFIG_NAK:
			lcp_makeoptions( &reply_bp, &(lcp_p->remote.want),
				desired );
			fsm_p->retry_nak--;
			break;
		case CONFIG_REJ:
			/* do nothing */
			break;
		};
	} else if ( reply_result == CONFIG_NAK ) {
		/* if too many NAKs, reject instead */
		if ( fsm_p->retry_nak > 0 )
			fsm_p->retry_nak--;
		else
			reply_result = CONFIG_REJ;
	}

	/* Send ACK/NAK/REJ to remote host */
	fsm_send(fsm_p, reply_result, config->id, &reply_bp);
	free_p(data);
	return (reply_result != CONFIG_ACK);
}


/************************************************************************/
/* Process configuration ACK sent by remote host */
static int
lcp_ack(
struct fsm_s *fsm_p,
struct config_hdr *config,
struct mbuf **data
){
	struct mbuf *req_bp;
	int error = FALSE;

	PPP_DEBUG_ROUTINES("lcp_ack()");

	/* ID field must match last request we sent */
	if (config->id != fsm_p->lastid) {
		PPP_DEBUG_CHECKS("LCP ACK: wrong ID");
		free_p(data);
		return -1;
	}

	/* Get a copy of last request we sent */
	req_bp = lcp_makereq(fsm_p);

	/* Overall buffer length should match */
	if (config->len != len_p(req_bp)) {
		PPP_DEBUG_CHECKS("LCP ACK: buffer length mismatch");
		error = TRUE;
	} else {
		register int req_char;
		register int ack_char;

		/* Each byte should match */
		while ((req_char = pullchar(&req_bp)) != -1) {
			if ((ack_char = pullchar(data)) == -1
			 || ack_char != req_char ) {
				PPP_DEBUG_CHECKS("LCP ACK: data mismatch");
				/*trace_log(PPPiface, "req=%02X, ack=%02X", req_char, ack_char);*/
				error = TRUE;
				break;
			}
		}
	}
	free_p(&req_bp);
	free_p(data);

	if (error) {
		return -1;
	}

	PPP_DEBUG_CHECKS("LCP ACK: valid");
	return 0;
}


/************************************************************************/
/* Process configuration NAK sent by remote host */
static int
lcp_nak(
struct fsm_s *fsm_p,
struct config_hdr *config,
struct mbuf **data
){
	struct lcp_s *lcp_p = fsm_p->pdv;
	struct lcp_side_s *local_p = &(lcp_p->local);
	int32 signed_length = config->len;
	struct option_hdr option;
	int last_option = 0;
	int result;

	PPP_DEBUG_ROUTINES("lcp_nak()");

	/* ID field must match last request we sent */
	if (config->id != fsm_p->lastid) {
		PPP_DEBUG_CHECKS("LCP NAK: wrong ID");
		free_p(data);
		return -1;
	}

	/* First, process in order.  Then, process extra "important" options */
	while (signed_length > 0  &&  ntohopt(&option, data) != -1) {
		if ((signed_length -= option.len) < 0) {
			PPP_DEBUG_CHECKS("LCP NAK: bad header length");
			free_p(data);
			return -1;
		}
		if ( option.type > LCP_OPTION_LIMIT ) {
			PPP_DEBUG_CHECKS("LCP NAK: option out of range");
		} else if ( option.type < last_option
		  || !(local_p->work.negotiate & (1 << option.type)) ) {
			if (local_p->work.negotiate & (1 << option.type)) {
				PPP_DEBUG_CHECKS("LCP NAK: option out of order");
				free_p(data);
				return -1;		/* was requested */
			}
			local_p->work.negotiate |= (1 << option.type);
			last_option = LCP_OPTION_LIMIT + 1;
		} else {
			last_option = option.type;
		}
		if ( ( result = lcp_check( data, lcp_p,
				local_p, &option, FALSE ) ) == -1 ) {
			PPP_DEBUG_CHECKS("LCP NAK: ran out of data");
			free_p(data);
			return -1;
		}
		/* update the negotiation status */
		if ( result == CONFIG_REJ
		  && option.type <= LCP_OPTION_LIMIT ) {
			local_p->work.negotiate &= ~(1 << option.type);
		}
	}
	PPP_DEBUG_CHECKS("LCP NAK: valid");
	free_p(data);
	return 0;
}


/************************************************************************/
/* Process configuration reject sent by remote host */
static int
lcp_reject(
struct fsm_s *fsm_p,
struct config_hdr *config,
struct mbuf **data
){
	struct lcp_s *lcp_p = fsm_p->pdv;
	struct lcp_side_s *local_p = &(lcp_p->local);
	int32 signed_length = config->len;
	struct option_hdr option;
	int last_option = 0;

	PPP_DEBUG_ROUTINES("lcp_reject()");

	/* ID field must match last request we sent */
	if (config->id != fsm_p->lastid) {
		PPP_DEBUG_CHECKS("LCP REJ: wrong ID");
		free_p(data);
		return -1;
	}

	/* Process in order, checking for errors */
	while (signed_length > 0  &&  ntohopt(&option, data) != -1) {
		register int k;

		if ((signed_length -= option.len) < 0) {
			PPP_DEBUG_CHECKS("LCP REJ: bad header length");
			free_p(data);
			return -1;
		}
		if ( option.type > LCP_OPTION_LIMIT ) {
			PPP_DEBUG_CHECKS("LCP REJ: option out of range");
		} else if ( option.type < last_option
		 || !(local_p->work.negotiate & (1 << option.type))) {
			PPP_DEBUG_CHECKS("LCP REJ: option out of order");
			free_p(data);
			return -1;
		}
		for ( k = option.len - OPTION_HDR_LEN; k-- > 0; ) {
			if ( pullchar(data) == -1 ) {
				PPP_DEBUG_CHECKS("LCP REJ: ran out of data");
				free_p(data);
				return -1;
			}
		}
		last_option = option.type;

		if ( option.type <= LCP_OPTION_LIMIT ) {
			local_p->work.negotiate &= ~(1 << option.type);
		}
	}
	PPP_DEBUG_CHECKS("LCP REJ: valid");
	free_p(data);
	return 0;
}


/************************************************************************/
/*			I N I T I A L I Z A T I O N			*/
/************************************************************************/

/* Check for PPP Network-Layer Protocol Phase */
void
ppp_ready(ppp_p)
struct ppp_s *ppp_p;
{
	if ( !(ppp_p->flags & (PPP_AP_LOCAL | PPP_AP_REMOTE)) ) {
		/* no pending authentication */
		ppp_p->phase = pppREADY;

		ppp_p->upsince = secclock();
		fsm_start( &(ppp_p->fsm[IPcp]) );
	}
}


/****************************************************************************/
/* Reset configuration options before request */
static void
lcp_reset(fsm_p)
struct fsm_s *fsm_p;
{
	struct lcp_s *lcp_p = 	fsm_p->pdv;

	PPP_DEBUG_ROUTINES("lcp_reset()");

	if ( lcp_p->local.want.negotiate & LCP_N_MAGIC ) {
		lcp_p->local.want.magic_number += rdclock();
	}

	ASSIGN( lcp_p->local.work, lcp_p->local.want );
	lcp_p->local.will_negotiate |= lcp_p->local.want.negotiate;

	lcp_p->remote.work.negotiate = FALSE;
	lcp_p->remote.will_negotiate |= lcp_p->remote.want.negotiate;
}


/************************************************************************/
/* Prepare to begin configuration exchange */
static void
lcp_starting(fsm_p)
struct fsm_s *fsm_p;
{
	PPP_DEBUG_ROUTINES("lcp_starting()");

	fsm_p->ppp_p->phase = pppLCP;
}


/************************************************************************/
/* After termination */
static void
lcp_stopping(fsm_p)
struct fsm_s *fsm_p;
{
	struct iface *ifp = fsm_p->ppp_p->iface;

	PPP_DEBUG_ROUTINES("lcp_stopping()");

	/* Tell the dialer to shut down */
	if ( ifp->supv != NULL )
		alert( ifp->supv, EABORT );

	/* Now, tell the device to go down.
	 * In turn, it should tell our IO status
	 * when it has gone down.
	 */
	ifp->ioctl(ifp,PARAM_DOWN,TRUE,0L);
}


/************************************************************************/
/* Close higher levels in preparation for link shutdown */
static void
lcp_closing(fsm_p)
struct fsm_s *fsm_p;
{
	struct ppp_s *ppp_p = fsm_p->ppp_p;

	ppp_p->phase = pppTERMINATE;

	fsm_down( &(ppp_p->fsm[IPcp]) );
	pap_down( &(ppp_p->fsm[Pap]) );
}


#ifdef TURBOC_SWITCH_BUG
#pragma option -G-
#endif

/************************************************************************/
/* configuration negotiation complete */
static void
lcp_opening(fsm_p)
struct fsm_s *fsm_p;
{
	struct lcp_s *lcp_p = 	fsm_p->pdv;
	struct iface *ifp = 	fsm_p->ppp_p->iface;

	if (ifp->mtu != lcp_p->remote.work.mru) {
		/* Set new Max Transmission Unit for outgoing packets */
		ifp->mtu = lcp_p->remote.work.mru;
		if (PPPtrace > 1)
			trace_log(PPPiface,"    Set new MTU for outgoing packets: %d",
				ifp->mtu);
	}

	/* check for authentication */
	fsm_p->ppp_p->phase = pppAP;
	fsm_p->ppp_p->flags &= ~(PPP_AP_LOCAL | PPP_AP_REMOTE);
	free(fsm_p->ppp_p->peername);
	fsm_p->ppp_p->peername = NULL;

	if (lcp_p->local.work.negotiate & LCP_N_AUTHENT) {
		switch (lcp_p->local.work.authentication) {
		case PPP_PAP_PROTOCOL:
			pap_local(fsm_p->ppp_p);
			break;
		};
	}
	if (lcp_p->remote.work.negotiate & LCP_N_AUTHENT) {
		switch (lcp_p->remote.work.authentication) {
		case PPP_PAP_PROTOCOL:
			pap_remote(fsm_p->ppp_p);
			break;
		};
	}

	/* re-check for authentication */
	ppp_ready(fsm_p->ppp_p);
}

#ifdef TURBOC_SWITCH_BUG
#pragma option -G
#endif


/************************************************************************/
static void
lcp_free(fsm_p)
struct fsm_s *fsm_p;
{
	/* nothing to do */
}


/* Initialize configuration structure */
void
lcp_init(ppp_p)
struct ppp_s *ppp_p;
{
	struct fsm_s *fsm_p = &(ppp_p->fsm[Lcp]);
	struct lcp_s *lcp_p;

	PPPtrace = ppp_p->trace;
	PPPiface = ppp_p->iface;

	PPP_DEBUG_ROUTINES("lcp_init()");

	fsm_p->ppp_p = ppp_p;
	fsm_p->pdc = &lcp_constants;
	fsm_p->pdv =
	lcp_p = callocw(1,sizeof(struct lcp_s));

	/* Set option parameters to first request defaults */
	ASSIGN( lcp_p->local.want, lcp_default );
	lcp_p->local.will_negotiate = lcp_negotiate;

	ASSIGN( lcp_p->remote.want, lcp_default );
	ASSIGN( lcp_p->remote.work, lcp_default );
	lcp_p->remote.will_negotiate = lcp_negotiate;

	fsm_init(fsm_p);
}


?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
免费成人小视频| 91玉足脚交白嫩脚丫在线播放| 国产一区二区伦理| 欧美中文字幕不卡| 久久免费视频一区| 亚洲国产精品嫩草影院| 精品中文字幕一区二区| 在线精品亚洲一区二区不卡| 久久综合狠狠综合久久激情| 午夜精品久久久久影视| 不卡av免费在线观看| 日韩欧美一卡二卡| 亚洲三级免费观看| 国产成人综合网| 91麻豆精品国产91久久久使用方法| 国产精品初高中害羞小美女文| 免费一级片91| 欧美日韩亚洲综合一区| 亚洲少妇最新在线视频| 粉嫩高潮美女一区二区三区| 久久这里只精品最新地址| 日韩电影一区二区三区四区| 在线免费观看日韩欧美| 中文字幕字幕中文在线中不卡视频| 国产一区二区三区综合| 日韩三级免费观看| 免费成人在线观看视频| 欧美日本不卡视频| 性做久久久久久| 欧美三区在线视频| 亚洲成人av福利| 欧美揉bbbbb揉bbbbb| 亚洲午夜国产一区99re久久| 91九色最新地址| 亚洲一区二区三区中文字幕在线| 色综合视频在线观看| 亚洲天堂成人在线观看| av电影天堂一区二区在线观看| 国产欧美精品国产国产专区| 国产成人av福利| 国产精品美女久久久久aⅴ国产馆| 国产成人av影院| 久久精品亚洲精品国产欧美kt∨| 国产精品乡下勾搭老头1| 26uuu国产电影一区二区| 精品一二三四在线| 国产日韩欧美精品在线| 国产成人av一区| 亚洲欧洲av色图| 在线观看日韩精品| 亚洲国产日韩综合久久精品| 777精品伊人久久久久大香线蕉| 午夜精品福利一区二区三区av| 欧美日韩电影一区| 久久国产精品72免费观看| 久久久精品国产免大香伊| 国产福利不卡视频| 亚洲天堂网中文字| 欧美日韩小视频| 久久精品72免费观看| 国产欧美日韩亚州综合 | 国产精品久久久久久福利一牛影视| av成人老司机| 亚洲成人av一区二区三区| 精品国产乱码91久久久久久网站| 国产·精品毛片| 亚洲国产视频一区| 精品国产一区二区精华| caoporm超碰国产精品| 亚洲精品欧美二区三区中文字幕| 777亚洲妇女| 粉嫩嫩av羞羞动漫久久久| 一区二区成人在线观看| 欧美成人精品1314www| 99久久免费国产| 蜜桃在线一区二区三区| 亚洲欧洲在线观看av| 制服丝袜亚洲精品中文字幕| 国产丶欧美丶日本不卡视频| 亚洲福利视频三区| 国产精品视频在线看| 在线观看亚洲一区| 国产成人在线色| 午夜精品一区二区三区电影天堂 | 国产精品不卡一区| 日韩欧美在线1卡| 在线区一区二视频| 成人av在线观| 精品夜夜嗨av一区二区三区| 亚洲午夜精品17c| 国产精品国产三级国产普通话三级| 7777精品伊人久久久大香线蕉的| 99久久久国产精品免费蜜臀| 国产精品自在欧美一区| 日韩激情在线观看| 亚洲在线成人精品| 中文在线一区二区| www激情久久| 日韩欧美三级在线| 欧美日韩日日摸| 色又黄又爽网站www久久| 国产精品一区二区在线观看不卡| 男女性色大片免费观看一区二区| 亚洲韩国一区二区三区| 亚洲私人黄色宅男| 国产精品色哟哟网站| 精品人伦一区二区色婷婷| 欧美日韩久久久一区| 色中色一区二区| 99国产精品视频免费观看| 国产成人久久精品77777最新版本| 青青草国产成人av片免费| 亚洲制服丝袜av| 亚洲精品日韩一| 亚洲欧洲精品成人久久奇米网| 国产三级精品在线| 国产亚洲精品aa| 久久精品日韩一区二区三区| 欧美va日韩va| 久久人人超碰精品| 久久久精品国产免大香伊 | 国内精品免费**视频| 精品影视av免费| 国产另类ts人妖一区二区| 久久99九九99精品| 国产剧情一区二区三区| 国产精品一区三区| 国产高清精品在线| 91在线观看污| 色综合久久天天综合网| 欧美性色黄大片手机版| 51午夜精品国产| 欧美一级理论性理论a| 日韩一级视频免费观看在线| 日韩精品一区二区三区老鸭窝 | 91浏览器打开| 欧美亚洲日本一区| 日韩欧美亚洲国产另类 | 国产自产高清不卡| 国产 欧美在线| 91免费看视频| 欧美久久久影院| wwwwxxxxx欧美| 亚洲色图在线视频| 三级成人在线视频| 国产乱码精品一区二区三区av| av在线一区二区三区| 欧美色图一区二区三区| 欧美一区二区三区视频免费播放 | 欧美在线观看18| 精品免费视频一区二区| 亚洲国产精品99久久久久久久久| 亚洲精品国产一区二区精华液| 午夜精品成人在线| 处破女av一区二区| 91.麻豆视频| 中文字幕欧美国产| 午夜免费欧美电影| 成人黄色综合网站| 日韩午夜激情电影| 日韩伦理av电影| 精一区二区三区| 在线精品国精品国产尤物884a| 久久综合中文字幕| 偷拍一区二区三区四区| 国产成人99久久亚洲综合精品| 欧美日韩五月天| 国产精品毛片久久久久久 | 综合久久久久久| 久久99久久精品| 欧美三级中文字| 国产精品女同互慰在线看| 日韩成人精品在线观看| av高清不卡在线| 久久嫩草精品久久久精品一| 亚洲午夜电影在线观看| 成人激情av网| 久久众筹精品私拍模特| 日本在线不卡一区| 日本久久电影网| 欧美国产成人精品| 久久精品噜噜噜成人88aⅴ| 欧美综合一区二区三区| 中文字幕的久久| 国产一区二区中文字幕| 欧美一卡二卡三卡四卡| 亚洲已满18点击进入久久| av电影在线观看完整版一区二区| 久久久噜噜噜久久人人看| 五月天亚洲婷婷| 欧洲视频一区二区| 亚洲三级理论片| 成人自拍视频在线观看| 久久精品夜夜夜夜久久| 国产乱人伦精品一区二区在线观看| 91精品国产免费久久综合| 偷拍亚洲欧洲综合| 91麻豆精品91久久久久久清纯| 一区二区三区四区在线播放| 色综合亚洲欧洲|