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

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

?? vj.c

?? ppp協議的lwip源代碼
?? C
?? 第 1 頁 / 共 2 頁
字號:
	switch(changes) {
	
	case 0:
		/*
		 * Nothing changed. If this packet contains data and the
		 * last one didn't, this is probably a data packet following
		 * an ack (normal on an interactive connection) and we send
		 * it compressed.  Otherwise it's probably a retransmit,
		 * retransmitted ack or window probe.  Send it uncompressed
		 * in case the other side missed the compressed version.
		 */
		if (ip->ip_len != cs->cs_ip.ip_len &&
			ntohs(cs->cs_ip.ip_len) == hlen)
		break;
	
	/* (fall through) */
	
	case SPECIAL_I:
	case SPECIAL_D:
		/*
		 * actual changes match one of our special case encodings --
		 * send packet uncompressed.
		 */
		goto uncompressed;
	
	case NEW_S|NEW_A:
		if (deltaS == deltaA && deltaS == ntohs(cs->cs_ip.ip_len) - hlen) {
			/* special case for echoed terminal traffic */
			changes = SPECIAL_I;
			cp = new_seq;
		}
		break;
	
	case NEW_S:
		if (deltaS == ntohs(cs->cs_ip.ip_len) - hlen) {
			/* special case for data xfer */
			changes = SPECIAL_D;
			cp = new_seq;
		}
		break;
	}
	
	deltaS = (u_short)(ntohs(ip->ip_id) - ntohs(cs->cs_ip.ip_id));
	if (deltaS != 1) {
		ENCODEZ(deltaS);
		changes |= NEW_I;
	}
	if (th->th_flags & TCP_PSH)
	changes |= TCP_PUSH_BIT;
	/*
	 * Grab the cksum before we overwrite it below.  Then update our
	 * state with this packet's header.
	 */
	deltaA = ntohs(th->th_sum);
	BCOPY(ip, &cs->cs_ip, hlen);
	
	/*
	 * We want to use the original packet as our compressed packet.
	 * (cp - new_seq) is the number of bytes we need for compressed
	 * sequence numbers.  In addition we need one byte for the change
	 * mask, one for the connection id and two for the tcp checksum.
	 * So, (cp - new_seq) + 4 bytes of header are needed.  hlen is how
	 * many bytes of the original packet to toss so subtract the two to
	 * get the new packet size.
	 */
	deltaS = (u_short)(cp - new_seq);
	if (!comp->compressSlot || comp->last_xmit != cs->cs_id) {
		comp->last_xmit = cs->cs_id;
		hlen -= deltaS + 4;
		pbuf_header(pb, -hlen);
		cp = (u_char *)pb->payload;
		*cp++ = changes | NEW_C;
		*cp++ = cs->cs_id;
	} else {
		hlen -= deltaS + 3;
		pbuf_header(pb, -hlen);
		cp = (u_char *)pb->payload;
		*cp++ = changes;
	}
	*cp++ = deltaA >> 8;
	*cp++ = deltaA;
	BCOPY(new_seq, cp, deltaS);
	INCR(vjs_compressed);
	return (TYPE_COMPRESSED_TCP);

	/*
	 * Update connection state cs & send uncompressed packet (that is,
	 * a regular ip/tcp packet but with the 'conversation id' we hope
	 * to use on future compressed packets in the protocol field).
	 */
uncompressed:
	BCOPY(ip, &cs->cs_ip, hlen);
	ip->ip_p = cs->cs_id;
	comp->last_xmit = cs->cs_id;
	return (TYPE_UNCOMPRESSED_TCP);
}

/*
 * Called when we may have missed a packet.
 */
void vj_uncompress_err(struct vjcompress *comp)
{
    comp->flags |= VJF_TOSS;
	INCR(vjs_errorin);
}

/*
 * "Uncompress" a packet of type TYPE_UNCOMPRESSED_TCP.
 * Return 0 on success, -1 on failure.
 */
int vj_uncompress_uncomp(
	struct pbuf *nb,
	struct vjcompress *comp
)
{
	register u_int hlen;
	register struct cstate *cs;
	register struct ip *ip;
	
	ip = (struct ip *)nb->payload;
	hlen = getip_hl(*ip) << 2;
	if (ip->ip_p >= MAX_SLOTS
			|| hlen + sizeof(struct tcphdr) > nb->len
			|| (hlen += getth_off(*((struct tcphdr *)&((char *)ip)[hlen])) << 2)
			    > nb->len
			|| hlen > MAX_HDR) {
		PPPDEBUG((LOG_INFO, "vj_uncompress_uncomp: bad cid=%d, hlen=%d buflen=%d\n", 
					ip->ip_p, hlen, nb->len));
		comp->flags |= VJF_TOSS;
		INCR(vjs_errorin);
		return -1;
	}
	cs = &comp->rstate[comp->last_recv = ip->ip_p];
	comp->flags &=~ VJF_TOSS;
	ip->ip_p = IPPROTO_TCP;
	BCOPY(ip, &cs->cs_ip, hlen);
	cs->cs_hlen = hlen;
	INCR(vjs_uncompressedin);
	return 0;
}

/*
 * Uncompress a packet of type TYPE_COMPRESSED_TCP.
 * The packet is composed of a buffer chain and the first buffer
 * must contain an accurate chain length.
 * The first buffer must include the entire compressed TCP/IP header. 
 * This procedure replaces the compressed header with the uncompressed
 * header and returns the length of the VJ header.
 */
int vj_uncompress_tcp(
	struct pbuf **nb,
	struct vjcompress *comp
)
{
	u_char *cp;
	struct tcphdr *th;
	struct cstate *cs;
	u_short *bp;
	struct pbuf *n0 = *nb;
	u32_t tmp;
	u_int vjlen, hlen, changes;
	
	INCR(vjs_compressedin);
	cp = (u_char *)n0->payload;
	changes = *cp++;
	if (changes & NEW_C) {
		/* 
		 * Make sure the state index is in range, then grab the state.
		 * If we have a good state index, clear the 'discard' flag. 
		 */
		if (*cp >= MAX_SLOTS) {
			PPPDEBUG((LOG_INFO, "vj_uncompress_tcp: bad cid=%d\n", *cp));
			goto bad;
		}
		
		comp->flags &=~ VJF_TOSS;
		comp->last_recv = *cp++;
	} else {
		/* 
		 * this packet has an implicit state index.  If we've
		 * had a line error since the last time we got an
		 * explicit state index, we have to toss the packet. 
		 */
		if (comp->flags & VJF_TOSS) {
			PPPDEBUG((LOG_INFO, "vj_uncompress_tcp: tossing\n"));
			INCR(vjs_tossed);
			return (-1);
		}
	}
	cs = &comp->rstate[comp->last_recv];
	hlen = getip_hl(cs->cs_ip) << 2;
	th = (struct tcphdr *)&((u_char *)&cs->cs_ip)[hlen];
	th->th_sum = htons((*cp << 8) | cp[1]);
	cp += 2;
	if (changes & TCP_PUSH_BIT)
		th->th_flags |= TCP_PSH;
	else
		th->th_flags &=~ TCP_PSH;
	
	switch (changes & SPECIALS_MASK) {
	case SPECIAL_I:
		{
			register u32_t i = ntohs(cs->cs_ip.ip_len) - cs->cs_hlen;
			/* some compilers can't nest inline assembler.. */
			tmp = ntohl(th->th_ack) + i;
			th->th_ack = htonl(tmp);
			tmp = ntohl(th->th_seq) + i;
			th->th_seq = htonl(tmp);
		}
		break;
	
	case SPECIAL_D:
		/* some compilers can't nest inline assembler.. */
		tmp = ntohl(th->th_seq) + ntohs(cs->cs_ip.ip_len) - cs->cs_hlen;
		th->th_seq = htonl(tmp);
		break;
	
	default:
		if (changes & NEW_U) {
			th->th_flags |= TCP_URG;
			DECODEU(th->th_urp);
		} else
			th->th_flags &=~ TCP_URG;
		if (changes & NEW_W)
			DECODES(th->th_win);
		if (changes & NEW_A)
			DECODEL(th->th_ack);
		if (changes & NEW_S)
			DECODEL(th->th_seq);
		break;
	}
	if (changes & NEW_I) {
		DECODES(cs->cs_ip.ip_id);
	} else {
		cs->cs_ip.ip_id = ntohs(cs->cs_ip.ip_id) + 1;
		cs->cs_ip.ip_id = htons(cs->cs_ip.ip_id);
	}
	
	/*
	 * At this point, cp points to the first byte of data in the
	 * packet.  Fill in the IP total length and update the IP
	 * header checksum.
	 */
	vjlen = (u_short)(cp - (u_char*)n0->payload);
	if (n0->len < vjlen) {
		/* 
		 * We must have dropped some characters (crc should detect
		 * this but the old slip framing won't) 
		 */
		PPPDEBUG((LOG_INFO, "vj_uncompress_tcp: head buffer %d too short %d\n", 
				  n0->len, vjlen));
		goto bad;
	}
	
#if BYTE_ORDER == LITTLE_ENDIAN
	tmp = n0->tot_len - vjlen + cs->cs_hlen;
	cs->cs_ip.ip_len = htons(tmp);
#else
	cs->cs_ip.ip_len = htons(n0->tot_len - vjlen + cs->cs_hlen);
#endif
	
	/* recompute the ip header checksum */
	bp = (u_short *) &cs->cs_ip;
	cs->cs_ip.ip_sum = 0;
	for (tmp = 0; hlen > 0; hlen -= 2)
		tmp += *bp++;
	tmp = (tmp & 0xffff) + (tmp >> 16);
	tmp = (tmp & 0xffff) + (tmp >> 16);
	cs->cs_ip.ip_sum = (u_short)(~tmp);
	
	/* Remove the compressed header and prepend the uncompressed header. */
	pbuf_header(n0, -vjlen);

	if(pbuf_header(n0, cs->cs_hlen)) {
		struct pbuf *np;

		LWIP_ASSERT("vj_uncompress_tcp: cs->cs_hlen <= PBUF_POOL_BUFSIZE", cs->cs_hlen <= PBUF_POOL_BUFSIZE);
		np = pbuf_alloc(PBUF_RAW, cs->cs_hlen, PBUF_POOL);
		if(!np) {
			PPPDEBUG((LOG_WARNING, "vj_uncompress_tcp: prepend failed\n"));
			*nb = NULL;
			goto bad;
		}
		pbuf_chain(np, n0);
		n0 = np;
	}
	memcpy(n0->payload, &cs->cs_ip, cs->cs_hlen);

	*nb = n0;

	return vjlen;
	
bad:
	comp->flags |= VJF_TOSS;
	INCR(vjs_errorin);
	return (-1);
}

#endif


////////////////////////////////////////////////////////////////////////////////

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美肥大bbwbbw高潮| 国产剧情一区二区| 亚洲天堂免费在线观看视频| 精品国产一区二区三区av性色| 欧美一区二区在线观看| 欧美日韩国产综合一区二区三区| 91日韩精品一区| 97精品久久久久中文字幕| 99re热视频这里只精品 | 欧美在线制服丝袜| 在线视频综合导航| 色天使久久综合网天天| 欧美在线一区二区| 欧美乱妇20p| 欧美成人乱码一区二区三区| 精品国产第一区二区三区观看体验| 精品国产乱码久久久久久免费 | 中文字幕亚洲一区二区va在线| 亚洲国产高清不卡| 亚洲欧美偷拍卡通变态| 亚洲一区二区3| 美洲天堂一区二卡三卡四卡视频 | av综合在线播放| 在线观看亚洲专区| 日韩欧美国产电影| 亚洲婷婷在线视频| 日韩精品一级中文字幕精品视频免费观看 | 日韩一级高清毛片| 久久综合九色综合97婷婷女人| 国产精品欧美综合在线| 亚洲激情成人在线| 精品一区二区三区在线观看国产| 国产一区二区视频在线播放| 欧美在线免费视屏| 91精品国产色综合久久ai换脸| 久久亚洲一区二区三区四区| 亚洲图片另类小说| 久久国产尿小便嘘嘘尿| 99热精品国产| 亚洲精品在线免费播放| 亚洲精品国产a| 国产乱子轮精品视频| 在线观看日产精品| 日本一区二区三区免费乱视频| 亚洲国产综合在线| hitomi一区二区三区精品| 欧美一区二区视频在线观看| 亚洲欧洲av另类| 精品一区二区在线观看| 欧美性生活大片视频| 中文字幕乱码久久午夜不卡| 蜜臀av亚洲一区中文字幕| 色婷婷av一区二区三区大白胸| 久久九九99视频| 偷拍亚洲欧洲综合| 色综合中文字幕国产 | 一区二区三区毛片| 成人综合在线网站| 日韩欧美国产午夜精品| 亚洲成在线观看| 91猫先生在线| 欧美国产精品劲爆| 国产一区二区精品久久91| 欧美肥大bbwbbw高潮| 亚洲国产中文字幕在线视频综合| 9l国产精品久久久久麻豆| 久久久久久一二三区| 免费在线欧美视频| 欧美一区在线视频| 视频精品一区二区| 欧美日韩不卡在线| 亚洲国产精品久久久男人的天堂 | 日韩精品国产欧美| 69堂成人精品免费视频| 亚洲动漫第一页| 欧美综合在线视频| 亚洲小少妇裸体bbw| 欧美亚日韩国产aⅴ精品中极品| 日韩伦理电影网| 暴力调教一区二区三区| 日韩一区在线播放| 色综合久久88色综合天天免费| 综合在线观看色| 欧洲生活片亚洲生活在线观看| 1024精品合集| 欧美性欧美巨大黑白大战| 一个色在线综合| 欧美三级电影网| 日韩激情中文字幕| 欧美大片日本大片免费观看| 精品一区二区三区影院在线午夜| 欧美videos中文字幕| 国产一区二区三区在线观看免费视频| 精品国产乱码久久久久久浪潮| 国产一区二区三区免费播放 | 99国产精品视频免费观看| 1024成人网| 欧美日韩二区三区| 国产一区二区三区美女| 中文字幕一区二区三区精华液 | 精品少妇一区二区| 国产精品自拍av| 亚洲欧美色综合| 日韩欧美在线123| 国产成人免费视频网站高清观看视频| 中文字幕av不卡| 欧美日本高清视频在线观看| 国产麻豆精品久久一二三| 亚洲视频免费看| 欧美一级日韩不卡播放免费| 国产成人精品www牛牛影视| 亚洲欧美日韩久久精品| 日韩亚洲欧美在线观看| 成人黄色免费短视频| 午夜精品影院在线观看| 久久九九影视网| 欧美日韩和欧美的一区二区| 国产老肥熟一区二区三区| 亚洲综合久久久久| 久久久久久久久久久黄色| 欧美色欧美亚洲另类二区| 国产一区二区在线免费观看| 亚洲午夜国产一区99re久久| 国产女人aaa级久久久级| 欧美日韩色综合| 99久久久久久| 国产在线视频一区二区三区| 亚洲国产综合在线| 国产精品欧美极品| 亚洲精品一区二区精华| 欧美日韩aaa| 欧美亚洲综合另类| 99久久久久久99| 懂色av一区二区三区免费看| 日韩国产欧美在线观看| 伊人色综合久久天天| 国产精品色婷婷| 国产性做久久久久久| 日韩精品一区二区在线观看| 欧美日韩免费在线视频| 日本国产一区二区| 91香蕉视频在线| 成人黄色在线看| 国产一区视频在线看| 国产又黄又大久久| 日本91福利区| 麻豆久久一区二区| 裸体一区二区三区| 日日摸夜夜添夜夜添国产精品| 亚洲成在人线免费| 亚洲成人www| 亚洲18色成人| 青青国产91久久久久久| 日韩高清在线观看| 日本视频一区二区| 日韩成人一区二区| 老汉av免费一区二区三区| 免费成人在线观看视频| 美日韩一级片在线观看| 久久99精品久久久久久| 激情综合色播五月| 国产激情一区二区三区| 国产一区二区不卡| 国产a精品视频| aaa国产一区| 在线观看日韩一区| 欧美日韩精品高清| 日韩视频在线你懂得| 亚洲精品一区二区三区蜜桃下载 | 成人免费在线播放视频| 亚洲日本va午夜在线影院| 亚洲综合一区二区三区| 亚洲国产成人91porn| 蜜桃视频免费观看一区| 国产最新精品免费| 99热精品一区二区| 欧美日韩五月天| 久久综合色鬼综合色| 亚洲欧洲日产国码二区| 五月天视频一区| 国产一区视频网站| 欧美在线视频日韩| 26uuu精品一区二区| 成人欧美一区二区三区小说| 偷拍亚洲欧洲综合| 丰满少妇在线播放bd日韩电影| 色婷婷精品大在线视频| 日韩欧美色电影| 综合电影一区二区三区| 日本麻豆一区二区三区视频| 国产精品一线二线三线| 欧美在线免费观看亚洲| 久久网站最新地址| 亚洲综合图片区| 国产91精品欧美| 538prom精品视频线放| 中文字幕五月欧美| 激情偷乱视频一区二区三区| 在线看一区二区| 亚洲国产精品精华液2区45|