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

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

?? ipcp.c

?? MCS-51的一個Free小型操作系統(tǒng),在KeilC中下編譯工作
?? C
?? 第 1 頁 / 共 3 頁
字號:
				if (!reject_if_disagree) {					DECPTR(sizeof(u32_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\n", inet_ntoa(ciaddr2)));			if (ciaddr2 != wo->ouraddr) {				if (ciaddr2 == 0 || !wo->accept_local) {					orc = CONFNAK;					if (!reject_if_disagree) {						DECPTR(sizeof(u32_t), p);						tl = ntohl(wo->ouraddr);						PUTLONG(tl, p);					}				} else {					go->ouraddr = ciaddr2;	/* accept peer's idea */				}			}						ho->neg_addr = 1;			ho->old_addrs = 1;			ho->hisaddr = ciaddr1;			ho->ouraddr = ciaddr2;			break;#endif				case CI_ADDR:			if (!ao->neg_addr) {				IPCPDEBUG((LOG_INFO, "ipcp_reqci: Reject ADDR not allowed\n"));				orc = CONFREJ;				/* Reject CI */				break;			} else if (cilen != CILEN_ADDR) {	/* Check CI length */				IPCPDEBUG((LOG_INFO, "ipcp_reqci: Reject ADDR bad len\n"));				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);			if (ciaddr1 != wo->hisaddr					&& (ciaddr1 == 0 || !wo->accept_remote)) {				orc = CONFNAK;				if (!reject_if_disagree) {					DECPTR(sizeof(u32_t), p);					tl = ntohl(wo->hisaddr);					PUTLONG(tl, p);				}				IPCPDEBUG((LOG_INFO, "ipcp_reqci: Nak ADDR %s\n", inet_ntoa(ciaddr1)));			} else if (ciaddr1 == 0 && wo->hisaddr == 0) {				/*				 * Don't ACK an address of 0.0.0.0 - reject it instead.				 */				IPCPDEBUG((LOG_INFO, "ipcp_reqci: Reject ADDR %s\n", inet_ntoa(ciaddr1)));				orc = CONFREJ;				wo->req_addr = 0;	/* don't NAK with 0.0.0.0 later */				break;			}						ho->neg_addr = 1;			ho->hisaddr = ciaddr1;			IPCPDEBUG((LOG_INFO, "ipcp_reqci: ADDR %s\n", inet_ntoa(ciaddr1)));			break;				case CI_MS_DNS1:		case CI_MS_DNS2:			/* Microsoft primary or secondary DNS request */			d = citype == CI_MS_DNS2;						/* If we do not have a DNS address then we cannot send it */			if (ao->dnsaddr[d] == 0 ||					cilen != CILEN_ADDR) {	/* Check CI length */				IPCPDEBUG((LOG_INFO, "ipcp_reqci: Rejecting DNS%d Request\n", d+1));				orc = CONFREJ;				/* Reject CI */				break;			}			GETLONG(tl, p);			if (htonl(tl) != ao->dnsaddr[d]) {				IPCPDEBUG((LOG_INFO, "ipcp_reqci: Naking DNS%d Request %d\n",							d+1, inet_ntoa(tl)));				DECPTR(sizeof(u32_t), p);				tl = ntohl(ao->dnsaddr[d]);				PUTLONG(tl, p);				orc = CONFNAK;			}			IPCPDEBUG((LOG_INFO, "ipcp_reqci: received DNS%d Request\n", d+1));			break;				case CI_MS_WINS1:		case CI_MS_WINS2:			/* Microsoft primary or secondary WINS request */			d = citype == CI_MS_WINS2;			IPCPDEBUG((LOG_INFO, "ipcp_reqci: received WINS%d Request\n", d+1));						/* If we do not have a DNS address then we cannot send it */			if (ao->winsaddr[d] == 0 ||				cilen != CILEN_ADDR) {	/* Check CI length */				orc = CONFREJ;			/* Reject CI */				break;			}			GETLONG(tl, p);			if (htonl(tl) != ao->winsaddr[d]) {				DECPTR(sizeof(u32_t), p);				tl = ntohl(ao->winsaddr[d]);				PUTLONG(tl, p);				orc = CONFNAK;			}			break;				case CI_COMPRESSTYPE:			if (!ao->neg_vj) {				IPCPDEBUG((LOG_INFO, "ipcp_reqci: Rejecting COMPRESSTYPE not allowed\n"));				orc = CONFREJ;				break;			} else if (cilen != CILEN_VJ && cilen != CILEN_COMPRESS) {				IPCPDEBUG((LOG_INFO, "ipcp_reqci: Rejecting COMPRESSTYPE len=%d\n", cilen));				orc = CONFREJ;				break;			}			GETSHORT(cishort, p);						if (!(cishort == IPCP_VJ_COMP ||					(cishort == IPCP_VJ_COMP_OLD && cilen == CILEN_COMPRESS))) {				IPCPDEBUG((LOG_INFO, "ipcp_reqci: Rejecting COMPRESSTYPE %d\n", cishort));				orc = CONFREJ;				break;			}						ho->neg_vj = 1;			ho->vj_protocol = cishort;			if (cilen == CILEN_VJ) {				GETCHAR(maxslotindex, p);				if (maxslotindex > ao->maxslotindex) { 					IPCPDEBUG((LOG_INFO, "ipcp_reqci: Naking VJ max slot %d\n", maxslotindex));					orc = CONFNAK;					if (!reject_if_disagree){						DECPTR(1, p);						PUTCHAR(ao->maxslotindex, p);					}				}				GETCHAR(cflag, p);				if (cflag && !ao->cflag) {					IPCPDEBUG((LOG_INFO, "ipcp_reqci: Naking VJ cflag %d\n", cflag));					orc = CONFNAK;					if (!reject_if_disagree){						DECPTR(1, p);						PUTCHAR(wo->cflag, p);					}				}				ho->maxslotindex = maxslotindex;				ho->cflag = cflag;			} else {				ho->old_vj = 1;				ho->maxslotindex = MAX_SLOTS - 1;				ho->cflag = 1;			}			IPCPDEBUG((LOG_INFO, 						"ipcp_reqci: received COMPRESSTYPE p=%d old=%d maxslot=%d cflag=%d\n",						ho->vj_protocol, ho->old_vj, ho->maxslotindex, ho->cflag));			break;					default:			IPCPDEBUG((LOG_INFO, "ipcp_reqci: Rejecting unknown CI type %d\n", citype));			orc = CONFREJ;			break;		}		endswitch:		if (orc == CONFACK &&		/* Good CI */				rc != CONFACK)		/*  but prior CI wasnt? */			continue;				/* Don't send this one */				if (orc == CONFNAK) {		/* Nak this CI? */			if (reject_if_disagree) {	/* Getting fed up with sending NAKs? */				IPCPDEBUG((LOG_INFO, "ipcp_reqci: Rejecting too many naks\n"));				orc = CONFREJ;		/* Get tough if so */			} else {				if (rc == CONFREJ)	/* Rejecting prior CI? */					continue;		/* Don't send this one */				if (rc == CONFACK) {	/* Ack'd all prior CIs? */					rc = CONFNAK;	/* Not anymore... */					ucp = inp;		/* Backup */				}			}		}				if (orc == CONFREJ &&		/* Reject this CI */				rc != CONFREJ) {	/*  but no prior ones? */			rc = CONFREJ;			ucp = inp;				/* Backup */		}				/* Need to move CI? */		if (ucp != cip)			BCOPY(cip, ucp, cilen);	/* Move it */				/* Update output pointer */		INCPTR(cilen, ucp);	}		/*	 * If we aren't rejecting this packet, and we want to negotiate	 * their address, and they didn't send their address, then we	 * send a NAK with a CI_ADDR option appended.  We assume the	 * input buffer is long enough that we can append the extra	 * option safely.	 */	if (rc != CONFREJ && !ho->neg_addr &&			wo->req_addr && !reject_if_disagree) {		IPCPDEBUG((LOG_INFO, "ipcp_reqci: Requesting peer address\n"));		if (rc == CONFACK) {			rc = CONFNAK;			ucp = inp;				/* reset pointer */			wo->req_addr = 0;		/* don't ask again */		}		PUTCHAR(CI_ADDR, ucp);		PUTCHAR(CILEN_ADDR, ucp);		tl = ntohl(wo->hisaddr);		PUTLONG(tl, ucp);	}		*len = (int)(ucp - inp);		/* Compute output length */	IPCPDEBUG((LOG_INFO, "ipcp_reqci: returning Configure-%s\n", CODENAME(rc)));	return (rc);			/* Return final code */}#if 0/* * ip_check_options - check that any IP-related options are OK, * and assign appropriate defaults. */static void ip_check_options(u_long localAddr){	ipcp_options *wo = &ipcp_wantoptions[0];	/*	 * Load our default IP address but allow the remote host to give us	 * a new address.	 */	if (wo->ouraddr == 0 && !ppp_settings.disable_defaultip) {		wo->accept_local = 1;	/* don't insist on this default value */		wo->ouraddr = htonl(localAddr);	}}#endif/* * ipcp_up - IPCP has come UP. * * Configure the IP network interface appropriately and bring it up. */static void ipcp_up(fsm *f){	u32_t mask;	ipcp_options *ho = &ipcp_hisoptions[f->unit];	ipcp_options *go = &ipcp_gotoptions[f->unit];	ipcp_options *wo = &ipcp_wantoptions[f->unit];		np_up(f->unit, PPP_IP);	IPCPDEBUG((LOG_INFO, "ipcp: up\n"));		/*	 * We must have a non-zero IP address for both ends of the link.	 */	if (!ho->neg_addr)		ho->hisaddr = wo->hisaddr;		if (ho->hisaddr == 0) {		IPCPDEBUG((LOG_ERR, "Could not determine remote IP address\n"));		ipcp_close(f->unit, "Could not determine remote IP address");		return;	}	if (go->ouraddr == 0) {		IPCPDEBUG((LOG_ERR, "Could not determine local IP address\n"));		ipcp_close(f->unit, "Could not determine local IP address");		return;	}		if (ppp_settings.usepeerdns && (go->dnsaddr[0] || go->dnsaddr[1])) {		/*pppGotDNSAddrs(go->dnsaddr[0], go->dnsaddr[1]);*/	}	/*	 * Check that the peer is allowed to use the IP address it wants.	 */	if (!auth_ip_addr(f->unit, ho->hisaddr)) {		IPCPDEBUG((LOG_ERR, "Peer is not authorized to use remote address %s\n",				inet_ntoa(ho->hisaddr)));		ipcp_close(f->unit, "Unauthorized remote IP address");		return;	}		/* set tcp compression */	sifvjcomp(f->unit, ho->neg_vj, ho->cflag, ho->maxslotindex);		/*	 * Set IP addresses and (if specified) netmask.	 */	mask = GetMask(go->ouraddr);		if (!sifaddr(f->unit, go->ouraddr, ho->hisaddr, mask, go->dnsaddr[0], go->dnsaddr[1])) {		IPCPDEBUG((LOG_WARNING, "sifaddr failed\n"));		ipcp_close(f->unit, "Interface configuration failed");		return;	}		/* bring the interface up for IP */	if (!sifup(f->unit)) {		IPCPDEBUG((LOG_WARNING, "sifup failed\n"));		ipcp_close(f->unit, "Interface configuration failed");		return;	}		sifnpmode(f->unit, PPP_IP, NPMODE_PASS);		/* assign a default route through the interface if required */	if (ipcp_wantoptions[f->unit].default_route) 		if (sifdefaultroute(f->unit, go->ouraddr, ho->hisaddr))			default_route_set[f->unit] = 1;		IPCPDEBUG((LOG_NOTICE, "local  IP address %s\n", inet_ntoa(go->ouraddr)));	IPCPDEBUG((LOG_NOTICE, "remote IP address %s\n", inet_ntoa(ho->hisaddr)));	if (go->dnsaddr[0]) {		IPCPDEBUG((LOG_NOTICE, "primary   DNS address %s\n", inet_ntoa(go->dnsaddr[0])));	}	if (go->dnsaddr[1]) {		IPCPDEBUG((LOG_NOTICE, "secondary DNS address %s\n", inet_ntoa(go->dnsaddr[1])));	}}/* * ipcp_down - IPCP has gone DOWN. * * Take the IP network interface down, clear its addresses * and delete routes through it. */static void ipcp_down(fsm *f){	IPCPDEBUG((LOG_INFO, "ipcp: down\n"));	np_down(f->unit, PPP_IP);	sifvjcomp(f->unit, 0, 0, 0);		sifdown(f->unit);	ipcp_clear_addrs(f->unit);}/* * ipcp_clear_addrs() - clear the interface addresses, routes, etc. */static void ipcp_clear_addrs(int unit){	u32_t ouraddr, hisaddr;		ouraddr = ipcp_gotoptions[unit].ouraddr;	hisaddr = ipcp_hisoptions[unit].hisaddr;	if (default_route_set[unit]) {		cifdefaultroute(unit, ouraddr, hisaddr);		default_route_set[unit] = 0;	}	cifaddr(unit, ouraddr, hisaddr);}/* * ipcp_finished - possibly shut down the lower layers. */static void ipcp_finished(fsm *f){	np_finished(f->unit, PPP_IP);}#if 0static int ipcp_printpkt(	u_char *p,	int plen,	void (*printer) (void *, char *, ...),	void *arg){	(void)p;	(void)plen;	(void)printer;	(void)arg;	return 0;}/* * ip_active_pkt - see if this IP packet is worth bringing the link up for. * We don't bring the link up for IP fragments or for TCP FIN packets * with no data. */#define IP_HDRLEN	20	/* bytes */#define IP_OFFMASK	0x1fff#define IPPROTO_TCP	6#define TCP_HDRLEN	20#define TH_FIN		0x01/* * We use these macros because the IP header may be at an odd address, * and some compilers might use word loads to get th_off or ip_hl. */#define net_short(x)	(((x)[0] << 8) + (x)[1])#define get_iphl(x)	(((unsigned char *)(x))[0] & 0xF)#define get_ipoff(x)	net_short((unsigned char *)(x) + 6)#define get_ipproto(x)	(((unsigned char *)(x))[9])#define get_tcpoff(x)	(((unsigned char *)(x))[12] >> 4)#define get_tcpflags(x)	(((unsigned char *)(x))[13])static int ip_active_pkt(u_char *pkt, int len){	u_char *tcp;	int hlen;		len -= PPP_HDRLEN;	pkt += PPP_HDRLEN;	if (len < IP_HDRLEN)		return 0;	if ((get_ipoff(pkt) & IP_OFFMASK) != 0)		return 0;	if (get_ipproto(pkt) != IPPROTO_TCP)		return 1;	hlen = get_iphl(pkt) * 4;	if (len < hlen + TCP_HDRLEN)		return 0;	tcp = pkt + hlen;	if ((get_tcpflags(tcp) & TH_FIN) != 0 && len == hlen + get_tcpoff(tcp) * 4)		return 0;	return 1;}#endif#endif /* PPP_SUPPORT */

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
一本到三区不卡视频| 国产精品免费丝袜| 欧美伦理影视网| 欧美性猛交xxxx黑人交| 色综合中文字幕国产| 国产69精品久久777的优势| 国产黑丝在线一区二区三区| 国产激情一区二区三区桃花岛亚洲| 久久国产福利国产秒拍| 精品一二线国产| 国产美女av一区二区三区| 国产九色sp调教91| 丰满白嫩尤物一区二区| 成人动漫在线一区| 91免费小视频| 欧美日韩mp4| 日韩欧美国产一区二区三区| 欧美成人aa大片| 国产亚洲精品超碰| 亚洲视频你懂的| 亚洲一区二区三区精品在线| 日本伊人午夜精品| 国产乱色国产精品免费视频| 波多野结衣欧美| 在线观看日韩电影| 欧美一区二区三区四区视频 | 日韩欧美国产麻豆| 精品播放一区二区| 中文字幕一区二区在线观看| 亚洲精品国产精品乱码不99| 五月婷婷另类国产| 国产麻豆91精品| www.日韩在线| 欧美日本一区二区三区| 久久久久久久综合| 亚洲婷婷在线视频| 日韩黄色在线观看| 国产福利一区二区三区在线视频| 91一区一区三区| 在线播放/欧美激情| 国产亲近乱来精品视频| 一区二区三区精品视频在线| 免费的成人av| 91毛片在线观看| 欧美一区二区三区在线电影| 国产嫩草影院久久久久| 亚洲国产精品嫩草影院| 国产精品123区| 精品视频一区二区不卡| 国产午夜精品一区二区三区视频 | 亚洲综合久久av| 美女国产一区二区三区| a在线播放不卡| 日韩欧美在线123| 亚洲视频免费在线观看| 久久国产成人午夜av影院| 色综合欧美在线| 精品剧情在线观看| 亚洲成人av电影| 不卡一区中文字幕| 欧美成人精品高清在线播放 | 日韩av电影免费观看高清完整版 | 成人综合日日夜夜| 正在播放一区二区| 自拍偷拍亚洲欧美日韩| 激情小说亚洲一区| 欧美裸体bbwbbwbbw| 亚洲日本在线天堂| 国产高清不卡一区二区| 4438成人网| 一区二区三区中文在线| 成人午夜电影网站| 欧美电影免费观看完整版| 亚洲尤物在线视频观看| 成人免费视频免费观看| 日韩精品专区在线影院重磅| 亚洲网友自拍偷拍| 91女人视频在线观看| 国产精品网站在线| 国模一区二区三区白浆| 777奇米成人网| 一个色妞综合视频在线观看| 成人免费毛片片v| 久久免费电影网| 美国三级日本三级久久99| 欧美日本一区二区| 亚洲福利视频导航| 色av一区二区| 1024成人网| 成人深夜在线观看| 久久久99精品免费观看不卡| 久久精品国产免费看久久精品| 欧美日韩国产色站一区二区三区| 亚洲免费毛片网站| 不卡的看片网站| 国产精品日日摸夜夜摸av| 国产精品亚洲成人| 久久亚洲一区二区三区四区| 久久爱www久久做| 日韩一区二区在线播放| 日本视频免费一区| 日韩一区二区中文字幕| 伦理电影国产精品| 欧美一级欧美三级| 久久99国产精品麻豆| 2023国产精华国产精品| 国内精品国产成人| 久久久久久免费| 粉嫩蜜臀av国产精品网站| 欧美极品少妇xxxxⅹ高跟鞋| 国产精品综合一区二区三区| 国产婷婷精品av在线| 丁香婷婷综合网| 《视频一区视频二区| 91视频91自| 亚洲一二三四区不卡| 91精品国产综合久久婷婷香蕉| 日本va欧美va欧美va精品| 精品欧美乱码久久久久久1区2区| 精东粉嫩av免费一区二区三区 | 韩国精品主播一区二区在线观看 | 亚洲一区二区三区在线看| 欧美伊人久久久久久午夜久久久久| 亚洲午夜一区二区三区| 欧美一级黄色大片| 国产乱码精品1区2区3区| 国产精品系列在线| 在线精品视频一区二区| 免费在线观看成人| 国产欧美一区二区三区在线看蜜臀 | 日产国产高清一区二区三区| 日韩一区二区电影| 国产精品77777| 综合久久久久久| 欧美视频一区二区| 激情小说欧美图片| 亚洲三级小视频| 欧美喷水一区二区| 国产精品99久久久久| 亚洲欧洲精品一区二区精品久久久| 91国产丝袜在线播放| 久久电影网站中文字幕| 国产精品色婷婷| 欧美日韩国产综合一区二区| 国产一区二区三区四| 亚洲精品国产a| 欧美哺乳videos| 午夜日韩在线电影| 久久综合九色综合欧美就去吻 | 欧美一区二区女人| 国产风韵犹存在线视精品| 亚洲国产一区在线观看| 久久五月婷婷丁香社区| 色菇凉天天综合网| 久久99精品久久只有精品| ...xxx性欧美| 欧美xxxx老人做受| 在线精品视频免费播放| 国产福利一区在线| 天天影视色香欲综合网老头| 中文字幕乱码一区二区免费| 欧美日韩高清一区二区三区| 福利视频网站一区二区三区| 丝瓜av网站精品一区二区| 国产精品污网站| 日韩欧美国产wwwww| 91麻豆swag| 国产剧情一区二区| 亚洲777理论| 亚洲色图在线看| 久久久亚洲精品一区二区三区 | 欧美精品久久久久久久多人混战 | 亚洲天堂网中文字| 久久久久久麻豆| 欧美一二三四在线| 91国在线观看| 91在线视频播放| 国产成人午夜精品5599| 日韩精品久久理论片| 一区二区三区蜜桃| 一区免费观看视频| 国产午夜久久久久| 精品国产露脸精彩对白 | 亚洲欧美日韩久久| 久久精品夜夜夜夜久久| 欧美成人官网二区| 欧美人xxxx| 欧美三级三级三级爽爽爽| 色偷偷一区二区三区| 成人免费福利片| 国产成人激情av| 国产一区二区三区免费播放| 日韩av中文字幕一区二区| 亚洲国产成人91porn| 亚洲精品免费在线观看| 亚洲欧美经典视频| ...av二区三区久久精品| 国产精品久久久久婷婷二区次| 久久久精品影视| 久久综合资源网|