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

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

?? netipcp.c

?? UCOS-ii對于網絡的支持代碼
?? C
?? 第 1 頁 / 共 3 頁
字號:
				citype != opt)  \
			goto bad; \
		GETSHORT(cishort, p); \
		if (cishort != val) \
			goto bad; \
		if (!old) { \
			GETCHAR(cimaxslotindex, p); \
			if (cimaxslotindex != maxslotindex) \
				goto bad; \
			GETCHAR(cicflag, p); \
			if (cicflag != cflag) \
				goto bad; \
		} \
	}
	
#define ACKCIADDR(opt, neg, old, val1, val2) \
	if (neg) { \
		int addrlen = (old? CILEN_ADDRS: CILEN_ADDR); \
		u_int32_t l; \
		if ((len -= addrlen) < 0) \
			goto bad; \
		GETCHAR(citype, p); \
		GETCHAR(cilen, p); \
		if (cilen != addrlen || \
				citype != opt) \
			goto bad; \
		GETLONG(l, p); \
		cilong = htonl(l); \
		if (val1 != cilong) \
			goto bad; \
		if (old) { \
			GETLONG(l, p); \
			cilong = htonl(l); \
			if (val2 != cilong) \
				goto bad; \
		} \
	}
	
	ACKCIADDR((go->old_addrs? CI_ADDRS: CI_ADDR), go->neg_addr,
			  go->old_addrs, go->ouraddr, go->hisaddr);
	
	ACKCIVJ(CI_COMPRESSTYPE, go->neg_vj, go->vj_protocol, go->old_vj,
			go->maxslotindex, go->cflag);
	
	/*
	 * If there are any remaining CIs, then this packet is bad.
	 */
	if (len != 0)
		goto bad;
	return (1);
	
bad:
	IPCPDEBUG((LOG_INFO, "ipcp_ackci: received bad Ack!"));
	return (0);
}

/*
 * ipcp_nakci - Peer has sent a NAK for some of our CIs.
 * This should not modify any state if the Nak is bad
 * or if IPCP is in the OPENED state.
 *
 * Returns:
 *	0 - Nak was bad.
 *	1 - Nak was good.
 */
static int ipcp_nakci(fsm *f, u_char *p, int len)
{
	ipcp_options *go = &ipcp_gotoptions[f->unit];
	u_char cimaxslotindex, cicflag;
	u_char citype, cilen, *next;
	u_short cishort;
	u_int32_t ciaddr1, ciaddr2, l;
	ipcp_options no;		/* options we've seen Naks for */
	ipcp_options try;		/* options to request next time */
	
	BZERO(&no, sizeof(no));
	try = *go;
	
	/*
	 * Any Nak'd CIs must be in exactly the same order that we sent.
	 * Check packet length and CI length at each step.
	 * If we find any deviations, then this packet is bad.
	 */
#define NAKCIADDR(opt, neg, old, code) \
	if (go->neg && \
			len >= (cilen = (old? CILEN_ADDRS: CILEN_ADDR)) && \
			p[1] == cilen && \
			p[0] == opt) { \
		len -= cilen; \
		INCPTR(2, p); \
		GETLONG(l, p); \
		ciaddr1 = htonl(l); \
		if (old) { \
			GETLONG(l, p); \
			ciaddr2 = htonl(l); \
			no.old_addrs = 1; \
		} else \
			ciaddr2 = 0; \
		no.neg = 1; \
		code \
	}
	
#define NAKCIVJ(opt, neg, code) \
	if (go->neg && \
			((cilen = p[1]) == CILEN_COMPRESS || cilen == CILEN_VJ) && \
			len >= cilen && \
			p[0] == opt) { \
		len -= cilen; \
		INCPTR(2, p); \
		GETSHORT(cishort, p); \
		no.neg = 1; \
		code \
	}
	
	/*
	 * Accept the peer's idea of {our,his} address, if different
	 * from our idea, only if the accept_{local,remote} flag is set.
	 */
	NAKCIADDR((go->old_addrs? CI_ADDRS: CI_ADDR), neg_addr, go->old_addrs,
	  if (go->accept_local && ciaddr1) { /* Do we know our address? */
		  try.ouraddr = ciaddr1;
		  IPCPDEBUG((LOG_INFO, "local IP address %s",
			     ip_ntoa(ciaddr1)));
	  }
	  if (go->accept_remote && ciaddr2) { /* Does he know his? */
		  try.hisaddr = ciaddr2;
		  IPCPDEBUG((LOG_INFO, "remote IP address %s",
			     ip_ntoa(ciaddr2)));
	  }
	);
	
	/*
	 * Accept the peer's value of maxslotindex provided that it
	 * is less than what we asked for.  Turn off slot-ID compression
	 * if the peer wants.  Send old-style compress-type option if
	 * the peer wants.
	 */
	NAKCIVJ(CI_COMPRESSTYPE, neg_vj,
		if (cilen == CILEN_VJ) {
			GETCHAR(cimaxslotindex, p);
			GETCHAR(cicflag, p);
			if (cishort == IPCP_VJ_COMP) {
				try.old_vj = 0;
				if (cimaxslotindex < go->maxslotindex)
					try.maxslotindex = cimaxslotindex;
				if (!cicflag)
					try.cflag = 0;
			} else {
				try.neg_vj = 0;
			}
		} else {
			if (cishort == IPCP_VJ_COMP || cishort == IPCP_VJ_COMP_OLD) {
				try.old_vj = 1;
				try.vj_protocol = cishort;
			} else {
				try.neg_vj = 0;
			}
		}
	);
	
	/*
	* There may be remaining CIs, if the peer is requesting negotiation
	* on an option that we didn't include in our request packet.
	* If they want to negotiate about IP addresses, we comply.
	* If they want us to ask for compression, we refuse.
	*/
	while (len > CILEN_VOID) {
		GETCHAR(citype, p);
		GETCHAR(cilen, p);
		if( (len -= cilen) < 0 )
			goto bad;
		next = p + cilen - 2;
		
		switch (citype) {
		case CI_COMPRESSTYPE:
			if (go->neg_vj || no.neg_vj ||
					(cilen != CILEN_VJ && cilen != CILEN_COMPRESS))
				goto bad;
			no.neg_vj = 1;
			break;
		case CI_ADDRS:
			if ((go->neg_addr && go->old_addrs) || no.old_addrs
					|| cilen != CILEN_ADDRS)
				goto bad;
			try.neg_addr = 1;
			try.old_addrs = 1;
			GETLONG(l, p);
			ciaddr1 = htonl(l);
			if (ciaddr1 && go->accept_local)
				try.ouraddr = ciaddr1;
			GETLONG(l, p);
			ciaddr2 = htonl(l);
			if (ciaddr2 && go->accept_remote)
				try.hisaddr = ciaddr2;
			no.old_addrs = 1;
			break;
		case CI_ADDR:
			if (go->neg_addr || no.neg_addr || cilen != CILEN_ADDR)
				goto bad;
			try.old_addrs = 0;
			GETLONG(l, p);
			ciaddr1 = htonl(l);
			if (ciaddr1 && go->accept_local)
				try.ouraddr = ciaddr1;
			if (try.ouraddr != 0)
				try.neg_addr = 1;
			no.neg_addr = 1;
			break;
		}
		p = next;
	}
	
	/* If there is still anything left, this packet is bad. */
	if (len != 0)
		goto bad;
	
	/*
	 * OK, the Nak is good.  Now we can update state.
	 */
	if (f->state != OPENED)
		*go = try;
	
	return 1;
	
bad:
	IPCPDEBUG((LOG_INFO, "ipcp_nakci: received bad Nak!"));
	return 0;
}


/*
 * ipcp_rejci - Reject some of our CIs.
 */
static int ipcp_rejci(fsm *f, u_char *p, int len)
{
	ipcp_options *go = &ipcp_gotoptions[f->unit];
	u_char cimaxslotindex, ciflag, cilen;
	u_short cishort;
	u_int32_t cilong;
	ipcp_options try;		/* options to request next time */
	
	try = *go;
	/*
	 * Any Rejected CIs must be in exactly the same order that we sent.
	 * Check packet length and CI length at each step.
	 * If we find any deviations, then this packet is bad.
	 */
#define REJCIADDR(opt, neg, old, val1, val2) \
	if (go->neg && \
			len >= (cilen = old? CILEN_ADDRS: CILEN_ADDR) && \
			p[1] == cilen && \
			p[0] == opt) { \
		u_int32_t l; \
		len -= cilen; \
		INCPTR(2, p); \
		GETLONG(l, p); \
		cilong = htonl(l); \
		/* Check rejected value. */ \
		if (cilong != val1) \
			goto bad; \
		if (old) { \
			GETLONG(l, p); \
			cilong = htonl(l); \
			/* Check rejected value. */ \
			if (cilong != val2) \
				goto bad; \
		} \
		try.neg = 0; \
	}
	
#define REJCIVJ(opt, neg, val, old, maxslot, cflag) \
	if (go->neg && \
			p[1] == (old? CILEN_COMPRESS : CILEN_VJ) && \
			len >= p[1] && \
			p[0] == opt) { \
		len -= p[1]; \
		INCPTR(2, p); \
		GETSHORT(cishort, p); \
		/* Check rejected value. */  \
		if (cishort != val) \
			goto bad; \
		if (!old) { \
			GETCHAR(cimaxslotindex, p); \
			if (cimaxslotindex != maxslot) \
				goto bad; \
			GETCHAR(ciflag, p); \
			if (ciflag != cflag) \
				goto bad; \
		} \
		try.neg = 0; \
	}
	
	REJCIADDR((go->old_addrs? CI_ADDRS: CI_ADDR), neg_addr,
			  go->old_addrs, go->ouraddr, go->hisaddr);
	
	REJCIVJ(CI_COMPRESSTYPE, neg_vj, go->vj_protocol, go->old_vj,
			go->maxslotindex, go->cflag);
	
	/*
	 * If there are any remaining CIs, then this packet is bad.
	 */
	if (len != 0)
		goto bad;
	/*
	 * Now we can update state.
	 */
	if (f->state != OPENED)
		*go = try;
	return 1;
	
bad:
	IPCPDEBUG((LOG_INFO, "ipcp_rejci: received bad Reject!"));
	return 0;
}


/*
 * ipcp_reqci - Check the peer's requested CIs and send appropriate response.
 *
 * Returns: CONFACK, CONFNAK or CONFREJ and input packet modified
 * appropriately.  If reject_if_disagree is non-zero, doesn't return
 * CONFNAK; returns CONFREJ if it can't return CONFACK.
 */
static int ipcp_reqci(
	fsm *f,
	u_char *inp,		/* Requested CIs */
	int *len,			/* Length of requested CIs */
	int reject_if_disagree
)
{
	ipcp_options *wo = &ipcp_wantoptions[f->unit];
	ipcp_options *ho = &ipcp_hisoptions[f->unit];
	ipcp_options *ao = &ipcp_allowoptions[f->unit];
#ifdef OLD_CI_ADDRS
	ipcp_options *go = &ipcp_gotoptions[f->unit];
#endif
	u_char *cip, *next;				/* Pointer to current and next CIs */
	u_short cilen, citype;			/* Parsed len, type */
	u_short cishort;				/* Parsed short value */
	u_int32_t tl, ciaddr1;			/* Parsed address values */
#ifdef OLD_CI_ADDRS
	u_int32_t ciaddr2;				/* Parsed address values */
#endif
	int rc = CONFACK;				/* Final packet return code */
	int orc;						/* Individual option return code */
	u_char *p;						/* Pointer to next char to parse */
	u_char *ucp = inp;				/* Pointer to current output char */
	int l = *len;					/* Length left */
	u_char maxslotindex, cflag;
	int d;
	
	cis_received[f->unit] = 1;
	
	/*
	 * Reset all his options.
	 */
	BZERO(ho, sizeof(*ho));
	
	/*
	 * Process all his options.
	 */
	next = inp;
	while (l) {
		orc = CONFACK;				/* Assume success */
		cip = p = next;				/* Remember begining of CI */
		if (l < 2 ||				/* Not enough data for CI header or */
				p[1] < 2 ||			/*  CI length too small or */
				p[1] > l) {			/*  CI length too big? */
			IPCPDEBUG((LOG_INFO, "ipcp_reqci: bad CI length!"));
			orc = CONFREJ;			/* Reject bad CI */
			cilen = l;				/* Reject till end of packet */
			l = 0;					/* Don't loop again */
			goto endswitch;
		}
		GETCHAR(citype, p);			/* Parse CI type */
		GETCHAR(cilen, p);			/* Parse CI length */
		l -= cilen;					/* Adjust remaining length */
		next += cilen;				/* Step to next CI */

		switch (citype) {			/* Check CI type */
#ifdef OLD_CI_ADDRS /* Need to save space... */
		case CI_ADDRS:
			IPCPDEBUG((LOG_INFO, "ipcp_reqci: received ADDRS "));
			if (!ao->neg_addr ||
					cilen != CILEN_ADDRS) {	/* Check CI length */
				orc = CONFREJ;		/* Reject CI */
				break;
			}
			
			/*
			 * If he has no address, or if we both have his address but
			 * disagree about it, then NAK it with our idea.
			 * In particular, if we don't know his address, but he does,
			 * then accept it.
			 */
			GETLONG(tl, p);		/* Parse source address (his) */
			ciaddr1 = htonl(tl);
			IPCPDEBUG((LOG_INFO, "his addr %s", ip_ntoa(ciaddr1)));
			if (ciaddr1 != wo->hisaddr
					&& (ciaddr1 == 0 || !wo->accept_remote)) {
				orc = CONFNAK;
				if (!reject_if_disagree) {
					DECPTR(sizeof(u_int32_t), p);
					tl = ntohl(wo->hisaddr);
					PUTLONG(tl, p);
				}
			} else if (ciaddr1 == 0 && wo->hisaddr == 0) {
				/*
				 * If neither we nor he knows his address, reject the option.
				 */
				orc = CONFREJ;
				wo->req_addr = 0;	/* don't NAK with 0.0.0.0 later */
				break;
			}
			
			/*
			 * If he doesn't know our address, or if we both have our address
			 * but disagree about it, then NAK it with our idea.
			 */
			GETLONG(tl, p);		/* Parse desination address (ours) */
			ciaddr2 = htonl(tl);
			IPCPDEBUG((LOG_INFO, "our addr %s", ip_ntoa(ciaddr2)));
			if (ciaddr2 != wo->ouraddr) {
				if (ciaddr2 == 0 || !wo->accept_local) {
					orc = CONFNAK;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
午夜精品久久久久久久蜜桃app| 免费观看一级特黄欧美大片| 九九九精品视频| 日韩一区二区在线播放| 视频一区视频二区中文字幕| 欧美精品一区二区三区在线| 九九热在线视频观看这里只有精品| 亚洲成人综合视频| 久久久99精品免费观看不卡| 国产精品1区2区| 亚洲在线免费播放| 精品国产乱子伦一区| 日韩欧美专区在线| 久久综合色播五月| 91九色02白丝porn| 麻豆专区一区二区三区四区五区| 亚洲国产经典视频| 欧美一区午夜视频在线观看 | 成人一区二区三区中文字幕| 亚洲色图视频网| 欧美成人a视频| 91福利社在线观看| 欧美一区二区三区在线视频| 欧美一二三四区在线| 久久久久久久久久久久久夜| 欧美挠脚心视频网站| 成人av资源在线| 开心九九激情九九欧美日韩精美视频电影 | 欧美色图一区二区三区| 亚洲免费伊人电影| 久久久精品一品道一区| 国产精品麻豆久久久| 日韩免费福利电影在线观看| 欧美手机在线视频| 精品福利二区三区| 最近中文字幕一区二区三区| 日韩国产一二三区| 无吗不卡中文字幕| 国产成人精品三级| 国产成人a级片| 在线观看不卡视频| 97久久精品人人澡人人爽| 国产剧情一区二区| 欧美色综合网站| 中文字幕欧美激情| 日日夜夜一区二区| 成人精品鲁一区一区二区| 欧美日韩免费观看一区二区三区 | 亚洲国产成人av好男人在线观看| 亚洲欧美欧美一区二区三区| 美女视频黄频大全不卡视频在线播放| 丰满岳乱妇一区二区三区 | 中文字幕精品三区| 午夜国产精品一区| 色综合一个色综合| 色诱亚洲精品久久久久久| 91麻豆免费看| 欧美又粗又大又爽| 中文字幕的久久| 久久精品理论片| 欧美日韩精品一区二区三区 | 亚洲成人在线免费| 成人一区二区三区视频| 日韩精品专区在线影院重磅| 亚洲一区二区三区免费视频| 91亚洲男人天堂| 欧美极品少妇xxxxⅹ高跟鞋| 久久99精品久久久久久| 91麻豆精品国产91久久久久久久久 | 菠萝蜜视频在线观看一区| 欧美不卡一二三| 老司机免费视频一区二区| 欧美肥妇bbw| 久久免费电影网| 久久99这里只有精品| 51精品久久久久久久蜜臀| 国产精品1024| 91麻豆精品国产自产在线观看一区 | 欧美一区二区免费| 亚洲五月六月丁香激情| 在线亚洲免费视频| 亚洲午夜在线电影| 欧美亚男人的天堂| 午夜精品久久久久久久久| 欧美人与禽zozo性伦| 无码av免费一区二区三区试看 | 亚洲国产精品t66y| 久久精品国产一区二区| 99久久免费国产| 中文字幕 久热精品 视频在线| 国产麻豆欧美日韩一区| 美国三级日本三级久久99| 69堂成人精品免费视频| 日本伊人色综合网| 精品成人免费观看| 大尺度一区二区| 亚洲精品欧美专区| 国内精品免费在线观看| 91久久精品日日躁夜夜躁欧美| 一区二区三区色| 国产不卡视频在线观看| 一色屋精品亚洲香蕉网站| 韩日欧美一区二区三区| 国产女主播一区| 国内外成人在线视频| 国产精品天干天干在线综合| 色久优优欧美色久优优| 天天综合天天做天天综合| 精品99999| 一本大道av一区二区在线播放| 欧美日韩国产综合一区二区三区 | 日韩毛片精品高清免费| 在线这里只有精品| 免费在线观看视频一区| 国产精品久久网站| 亚洲gay无套男同| 精品99一区二区| 欧美日韩一级片网站| 国产成人免费av在线| 日日摸夜夜添夜夜添国产精品| 久久综合九色综合欧美亚洲| 91国产视频在线观看| 国产专区综合网| 亚洲成人av一区二区三区| 久久精品日产第一区二区三区高清版| 91色porny蝌蚪| 国产精品一二三四| 国产成人免费视频网站高清观看视频| 国产裸体歌舞团一区二区| 亚洲天堂av老司机| 日韩欧美亚洲国产精品字幕久久久| 成人av在线网| 国产在线看一区| 日韩av一区二| 亚洲一区二区三区激情| 国产精品国产自产拍高清av| 欧美va亚洲va国产综合| 制服丝袜中文字幕亚洲| 一本到三区不卡视频| 成人免费av网站| 国产精品自拍av| 久久99国产精品久久99果冻传媒| 五月激情综合婷婷| 伊人开心综合网| 综合激情成人伊人| 国产精品久久久久久福利一牛影视 | 日本一区二区视频在线| 欧美成人aa大片| 成人app网站| 亚洲18色成人| 亚洲图片欧美激情| 国产精品久久久久久久久久免费看| 日韩一区二区三区在线| 欧美日韩mp4| 欧美三级日韩三级国产三级| 色综合久久久久久久久| 色综合久久88色综合天天6| 成人激情小说网站| 成人午夜精品在线| 成人午夜视频福利| 99精品在线免费| 成人av电影在线播放| 91丝袜呻吟高潮美腿白嫩在线观看| 国产成人精品一区二| 成人免费电影视频| 色综合久久久久久久| 欧美视频自拍偷拍| 日韩一区二区三免费高清| 日韩欧美的一区| 久久久99精品免费观看不卡| 欧美国产视频在线| 亚洲另类春色校园小说| 欧美一级片在线观看| 欧美一级免费大片| 日韩欧美一区二区免费| 久久日一线二线三线suv| 久久精品男人的天堂| 国产精品第一页第二页第三页| 樱花草国产18久久久久| 日韩影院免费视频| 精品一区二区三区影院在线午夜| 国产精品影视在线观看| 国产jizzjizz一区二区| 一本一本久久a久久精品综合麻豆| 欧美中文字幕久久| 亚洲色大成网站www久久九九| 一区二区免费视频| 美腿丝袜亚洲色图| eeuss国产一区二区三区| 亚洲精品乱码久久久久久日本蜜臀| 一区二区三区免费| 久久精品99久久久| 色哟哟一区二区| 精品福利av导航| 亚洲国产日韩综合久久精品| 国产伦精品一区二区三区免费迷 | 91视频国产观看| 欧美一区二区国产| 亚洲摸摸操操av| 国产一本一道久久香蕉|