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

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

?? netipcp.c

?? 一個(gè)tcp/ip協(xié)議棧,帶有PPP、IP、TCP、UDP等協(xié)議
?? C
?? 第 1 頁(yè) / 共 3 頁(yè)
字號(hào):
						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"));
				orc = CONFREJ;				/* Reject CI */
				break;
			} else if (cilen != CILEN_ADDR) {	/* Check CI length */
				IPCPDEBUG((LOG_INFO, "ipcp_reqci: Reject ADDR bad len"));
				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(u_int32_t), p);
					tl = ntohl(wo->hisaddr);
					PUTLONG(tl, p);
				}
				IPCPDEBUG((LOG_INFO, "ipcp_reqci: Nak ADDR %s", ip_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", ip_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", ip_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 ", 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",
							d+1, ip_ntoa(tl)));
				DECPTR(sizeof(u_int32_t), p);
				tl = ntohl(ao->dnsaddr[d]);
				PUTLONG(tl, p);
				orc = CONFNAK;
			}
			IPCPDEBUG((LOG_INFO, "ipcp_reqci: received DNS%d Request ", 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 ", 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(u_int32_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"));
				orc = CONFREJ;
				break;
			} else if (cilen != CILEN_VJ && cilen != CILEN_COMPRESS) {
				IPCPDEBUG((LOG_INFO, "ipcp_reqci: Rejecting COMPRESSTYPE len=%d", 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", 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", 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", 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",
						ho->vj_protocol, ho->old_vj, ho->maxslotindex, ho->cflag));
			break;
			
		default:
			IPCPDEBUG((LOG_INFO, "ipcp_reqci: Rejecting unknown CI type %d", 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"));
				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"));
		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", CODENAME(rc)));
	return (rc);			/* Return final code */
}


/*
 * ip_check_options - check that any IP-related options are OK,
 * and assign appropriate defaults.
 */
static void ip_check_options(void)
{
	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 && !disable_defaultip) {
		wo->accept_local = 1;	/* don't insist on this default value */
		wo->ouraddr = htonl(localHost);
	}
}


/*
 * ipcp_up - IPCP has come UP.
 *
 * Configure the IP network interface appropriately and bring it up.
 */
static void ipcp_up(fsm *f)
{
	u_int32_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"));
	
	/*
	 * 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) {
		trace(LOG_ERR, "Could not determine remote IP address");
		ipcp_close(f->unit, "Could not determine remote IP address");
		return;
	}
	if (go->ouraddr == 0) {
		trace(LOG_ERR, "Could not determine local IP address");
		ipcp_close(f->unit, "Could not determine local IP address");
		return;
	}
	
	/*
	 * Check that the peer is allowed to use the IP address it wants.
	 */
	if (!auth_ip_addr(f->unit, ho->hisaddr)) {
		trace(LOG_ERR, "Peer is not authorized to use remote address %s",
				ip_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 !(defined(SVR4) && (defined(SNI) || defined(__USLC__)))
	if (!sifaddr(f->unit, go->ouraddr, ho->hisaddr, mask)) {
		IPCPDEBUG((LOG_WARNING, "sifaddr failed"));
		ipcp_close(f->unit, "Interface configuration failed");
		return;
	}
#endif
	
	/* bring the interface up for IP */
	if (!sifup(f->unit)) {
		IPCPDEBUG((LOG_WARNING, "sifup failed"));
		ipcp_close(f->unit, "Interface configuration failed");
		return;
	}
	
#if (defined(SVR4) && (defined(SNI) || defined(__USLC__)))
	if (!sifaddr(f->unit, go->ouraddr, ho->hisaddr, mask)) {
		IPCPDEBUG((LOG_WARNING, "sifaddr failed"));
		ipcp_close(f->unit, "Interface configuration failed");
		return;
	}
#endif
	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;
	
	trace(LOG_NOTICE, "local  IP address %s", ip_ntoa(go->ouraddr));
	trace(LOG_NOTICE, "remote IP address %s", ip_ntoa(ho->hisaddr));
}


/*
 * 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"));
	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)
{
	u_int32_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);
}

#pragma argsused
static int ipcp_printpkt(
	u_char *p,
	int plen,
	void (*printer) __P((void *, char *, ...)),
	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;
}

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
www.av亚洲| 欧美一区三区二区| 日本伊人色综合网| 国产精品久久久久桃色tv| 在线播放一区二区三区| 色综合久久88色综合天天6| 韩国v欧美v日本v亚洲v| 日韩在线一二三区| 亚洲色图第一区| 中文字幕精品一区| 久久中文娱乐网| 欧美一区二区三区免费| 欧美亚洲国产一区二区三区| www.欧美日韩国产在线| 国产精品18久久久久久久久 | 人人超碰91尤物精品国产| 亚洲日本在线天堂| 国产精品盗摄一区二区三区| 欧美精品一区二区不卡| 91精品国产色综合久久ai换脸| 在线观看不卡一区| 色视频成人在线观看免| eeuss鲁片一区二区三区| 有码一区二区三区| 久久久久99精品国产片| 欧美一区二区精美| 在线成人午夜影院| 在线不卡a资源高清| 欧美私人免费视频| 在线观看欧美日本| 91精品1区2区| 精品视频999| 欧美日韩国产高清一区二区三区| 色狠狠一区二区| 91福利社在线观看| 欧美午夜精品一区二区三区| 欧美婷婷六月丁香综合色| 91丝袜美腿高跟国产极品老师 | 日韩午夜av一区| 正在播放亚洲一区| 欧美一区二区福利在线| 日韩视频免费直播| 日韩免费高清视频| 久久久亚洲午夜电影| 国产欧美一区二区精品性色| 久久精品夜夜夜夜久久| 国产欧美一区二区精品仙草咪| 国产精品麻豆欧美日韩ww| 中文字幕一区视频| 亚洲综合精品自拍| 日韩激情在线观看| 精品无人区卡一卡二卡三乱码免费卡| 国产又粗又猛又爽又黄91精品| 国产91综合网| 91搞黄在线观看| 欧美福利视频导航| 精品国产乱子伦一区| 国产视频一区在线播放| 亚洲欧美激情视频在线观看一区二区三区 | 99久久综合精品| 在线精品视频小说1| 3d动漫精品啪啪一区二区竹菊| 日韩欧美激情四射| 国产欧美日韩在线| 亚洲免费伊人电影| 奇米色一区二区| 成人av免费在线观看| 欧美视频一区在线观看| 精品久久久久久无| 日韩一区在线免费观看| 亚洲va国产天堂va久久en| 黄色日韩网站视频| 色欧美日韩亚洲| 欧美成人r级一区二区三区| 国产精品久久久久一区二区三区共 | 欧美成人精品二区三区99精品| 国产日韩欧美精品一区| 一区二区免费看| 国产又黄又大久久| 欧美性猛片xxxx免费看久爱| 精品人伦一区二区色婷婷| 亚洲欧美日韩久久精品| 久久国产综合精品| 在线免费观看视频一区| 久久亚洲精品小早川怜子| 亚洲午夜激情av| 懂色av一区二区三区免费看| 欧美偷拍一区二区| 国产精品欧美一级免费| 老司机一区二区| 在线精品视频免费播放| 国产欧美一区视频| 捆绑紧缚一区二区三区视频 | 久久夜色精品一区| 亚洲午夜影视影院在线观看| 国产不卡免费视频| 欧美人牲a欧美精品| 中文字幕人成不卡一区| 激情综合亚洲精品| 欧美日韩精品一区二区| 亚洲欧美自拍偷拍| 国产精品一品二品| 91精品国产手机| 亚洲高清三级视频| 91麻豆国产福利在线观看| 久久嫩草精品久久久久| 日本中文在线一区| 欧美年轻男男videosbes| 国产精品国产三级国产三级人妇| 韩日av一区二区| 欧美日韩精品是欧美日韩精品| 日韩理论片在线| 成人深夜在线观看| 久久精品在线观看| 精彩视频一区二区三区| 8v天堂国产在线一区二区| 亚洲黄色片在线观看| 95精品视频在线| 国产精品久久久久久久久快鸭| 国产一区二区剧情av在线| 精品日韩一区二区| 精品一区二区三区视频| 日韩视频一区二区三区| 美日韩一区二区三区| 91 com成人网| 欧美aⅴ一区二区三区视频| 欧美剧情电影在线观看完整版免费励志电影| 亚洲欧美日韩国产成人精品影院| av在线不卡网| 亚洲卡通欧美制服中文| 91在线视频免费91| 一区二区三区在线视频观看58 | 免费在线观看视频一区| 欧美精品乱码久久久久久按摩| 亚洲国产日韩a在线播放性色| 欧美综合亚洲图片综合区| 亚洲午夜日本在线观看| 欧美日韩精品三区| 日本vs亚洲vs韩国一区三区二区 | 欧美午夜片在线看| 午夜久久电影网| 日韩欧美一区二区免费| 国内精品在线播放| 日本一区二区三区久久久久久久久不| 粉嫩aⅴ一区二区三区四区| 亚洲欧洲精品一区二区精品久久久| va亚洲va日韩不卡在线观看| 亚洲精品视频免费观看| 欧美日韩和欧美的一区二区| 日韩av在线播放中文字幕| 欧美变态口味重另类| 国产精品一品二品| 亚洲精品一卡二卡| 91麻豆精品国产91久久久资源速度 | 国产精品91xxx| 亚洲欧洲日韩女同| 欧美性做爰猛烈叫床潮| 奇米影视7777精品一区二区| 久久久久久久综合日本| 99久免费精品视频在线观看 | 欧美一级日韩一级| 老司机免费视频一区二区三区| 久久婷婷国产综合精品青草| 成人av在线资源网| 亚洲国产精品久久艾草纯爱 | 亚洲欧美一区二区不卡| 在线观看91av| 国产aⅴ综合色| 亚洲一区国产视频| 26uuu精品一区二区在线观看| av一二三不卡影片| 青青青爽久久午夜综合久久午夜 | 欧美激情中文字幕| 欧美亚洲自拍偷拍| 国产在线看一区| 一区二区成人在线| 久久综合色之久久综合| 色先锋aa成人| 韩国av一区二区三区在线观看| 亚洲欧美aⅴ...| 精品91自产拍在线观看一区| 日本精品视频一区二区| 国产九色精品成人porny| 艳妇臀荡乳欲伦亚洲一区| 精品国产99国产精品| 欧美亚洲精品一区| 国产.精品.日韩.另类.中文.在线.播放| 亚洲高清久久久| 国产精品麻豆99久久久久久| 91精品国产91综合久久蜜臀| 99riav久久精品riav| 国产麻豆精品theporn| 婷婷综合五月天| 玉足女爽爽91| 中日韩av电影| 亚洲精品一区二区三区福利| 欧美日韩国产首页| 91免费版pro下载短视频| 精品一区二区久久久| 午夜精品福利一区二区三区av |