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

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

?? vj.c

?? MCS-51的一個Free小型操作系統(tǒng),在KeilC中下編譯工作
?? C
?? 第 1 頁 / 共 2 頁
/* * Routines to compress and uncompess tcp packets (for transmission * over low speed serial lines. * * Copyright (c) 1989 Regents of the University of California. * All rights reserved. * * Redistribution and use in source and binary forms are permitted * provided that the above copyright notice and this paragraph are * duplicated in all such forms and that any documentation, * advertising materials, and other materials related to such * distribution and use acknowledge that the software was developed * by the University of California, Berkeley.  The name of the * University may not be used to endorse or promote products derived * from this software without specific prior written permission. * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. * *	Van Jacobson (van@helios.ee.lbl.gov), Dec 31, 1989: *	- Initial distribution. * * Modified June 1993 by Paul Mackerras, paulus@cs.anu.edu.au, * so that the entire packet being decompressed doesn't have * to be in contiguous memory (just the compressed header). * * Modified March 1998 by Guy Lancaster, glanca@gesn.com, * for a 16 bit processor. */#include <string.h>#include "ppp.h"#include "vj.h"#include "pppdebug.h"#if VJ_SUPPORT > 0#if LINK_STATS#define INCR(counter) ++comp->stats.counter#else#define INCR(counter)#endif#if defined(NO_CHAR_BITFIELDS)#define getip_hl(base)	((base).ip_hl_v&0xf)#define getth_off(base)	(((base).th_x2_off&0xf0)>>4)#else#define getip_hl(base)	((base).ip_hl)#define getth_off(base)	((base).th_off)#endifvoid vj_compress_init(struct vjcompress *comp){	register u_int i;	register struct cstate *tstate = comp->tstate;	#if MAX_SLOTS == 0	memset((char *)comp, 0, sizeof(*comp));#endif	comp->maxSlotIndex = MAX_SLOTS - 1;	comp->compressSlot = 0;		/* Disable slot ID compression by default. */	for (i = MAX_SLOTS - 1; i > 0; --i) {		tstate[i].cs_id = i;		tstate[i].cs_next = &tstate[i - 1];	}	tstate[0].cs_next = &tstate[MAX_SLOTS - 1];	tstate[0].cs_id = 0;	comp->last_cs = &tstate[0];	comp->last_recv = 255;	comp->last_xmit = 255;	comp->flags = VJF_TOSS;}/* ENCODE encodes a number that is known to be non-zero.  ENCODEZ * checks for zero (since zero has to be encoded in the long, 3 byte * form). */#define ENCODE(n) { \	if ((u_short)(n) >= 256) { \		*cp++ = 0; \		cp[1] = (n); \		cp[0] = (n) >> 8; \		cp += 2; \	} else { \		*cp++ = (n); \	} \}#define ENCODEZ(n) { \	if ((u_short)(n) >= 256 || (u_short)(n) == 0) { \		*cp++ = 0; \		cp[1] = (n); \		cp[0] = (n) >> 8; \		cp += 2; \	} else { \		*cp++ = (n); \	} \}#define DECODEL(f) { \	if (*cp == 0) {\		u32_t tmp = ntohl(f) + ((cp[1] << 8) | cp[2]); \		(f) = htonl(tmp); \		cp += 3; \	} else { \		u32_t tmp = ntohl(f) + (u32_t)*cp++; \		(f) = htonl(tmp); \	} \}#define DECODES(f) { \	if (*cp == 0) {\		u_short tmp = ntohs(f) + (((u_short)cp[1] << 8) | cp[2]); \		(f) = htons(tmp); \		cp += 3; \	} else { \		u_short tmp = ntohs(f) + (u_short)*cp++; \		(f) = htons(tmp); \	} \}#define DECODEU(f) { \	if (*cp == 0) {\		(f) = htons(((u_short)cp[1] << 8) | cp[2]); \		cp += 3; \	} else { \		(f) = htons((u_short)*cp++); \	} \}/* * vj_compress_tcp - Attempt to do Van Jacobsen header compression on a * packet.  This assumes that nb and comp are not null and that the first * buffer of the chain contains a valid IP header. * Return the VJ type code indicating whether or not the packet was * compressed. */u_int vj_compress_tcp(	struct vjcompress *comp,	struct pbuf *pb){	register struct ip *ip = (struct ip *)pb->payload;	register struct cstate *cs = comp->last_cs->cs_next;	register u_short hlen = getip_hl(*ip);	register struct tcphdr *oth;	register struct tcphdr *th;	register u_short deltaS, deltaA;	register u_long deltaL;	register u_int changes = 0;	u_char new_seq[16];	register u_char *cp = new_seq;	/*		 * Check that the packet is IP proto TCP.	 */	if (ip->ip_p != IPPROTO_TCP)		return (TYPE_IP);			/*	 * Bail if this is an IP fragment or if the TCP packet isn't	 * `compressible' (i.e., ACK isn't set or some other control bit is	 * set).  	 */	if ((ip->ip_off & htons(0x3fff)) || pb->tot_len < 40)		return (TYPE_IP);	th = (struct tcphdr *)&((long *)ip)[hlen];	if ((th->th_flags & (TCP_SYN|TCP_FIN|TCP_RST|TCP_ACK)) != TCP_ACK)		return (TYPE_IP);			/*	 * Packet is compressible -- we're going to send either a	 * COMPRESSED_TCP or UNCOMPRESSED_TCP packet.  Either way we need	 * to locate (or create) the connection state.  Special case the	 * most recently used connection since it's most likely to be used	 * again & we don't have to do any reordering if it's used.	 */	INCR(vjs_packets);	if (ip->ip_src.s_addr != cs->cs_ip.ip_src.s_addr 			|| ip->ip_dst.s_addr != cs->cs_ip.ip_dst.s_addr 			|| *(long *)th != ((long *)&cs->cs_ip)[getip_hl(cs->cs_ip)]) {		/*		 * Wasn't the first -- search for it.		 *		 * States are kept in a circularly linked list with		 * last_cs pointing to the end of the list.  The		 * list is kept in lru order by moving a state to the		 * head of the list whenever it is referenced.  Since		 * the list is short and, empirically, the connection		 * we want is almost always near the front, we locate		 * states via linear search.  If we don't find a state		 * for the datagram, the oldest state is (re-)used.		 */		register struct cstate *lcs;		register struct cstate *lastcs = comp->last_cs;				do {			lcs = cs; cs = cs->cs_next;			INCR(vjs_searches);			if (ip->ip_src.s_addr == cs->cs_ip.ip_src.s_addr					&& ip->ip_dst.s_addr == cs->cs_ip.ip_dst.s_addr					&& *(long *)th == ((long *)&cs->cs_ip)[getip_hl(cs->cs_ip)])				goto found;		} while (cs != lastcs);				/*		 * Didn't find it -- re-use oldest cstate.  Send an		 * uncompressed packet that tells the other side what		 * connection number we're using for this conversation.		 * Note that since the state list is circular, the oldest		 * state points to the newest and we only need to set		 * last_cs to update the lru linkage.		 */		INCR(vjs_misses);		comp->last_cs = lcs;		hlen += getth_off(*th);		hlen <<= 2;		/* Check that the IP/TCP headers are contained in the first buffer. */		if (hlen > pb->len)			return (TYPE_IP);		goto uncompressed;				found:		/*		 * Found it -- move to the front on the connection list.		 */		if (cs == lastcs)			comp->last_cs = lcs;		else {			lcs->cs_next = cs->cs_next;			cs->cs_next = lastcs->cs_next;			lastcs->cs_next = cs;		}	}		oth = (struct tcphdr *)&((long *)&cs->cs_ip)[hlen];	deltaS = hlen;	hlen += getth_off(*th);	hlen <<= 2;	/* Check that the IP/TCP headers are contained in the first buffer. */	if (hlen > pb->len) {		PPPDEBUG((LOG_INFO, "vj_compress_tcp: header len %d spans buffers\n", 					hlen));		return (TYPE_IP);	}		/*	 * Make sure that only what we expect to change changed. The first	 * line of the `if' checks the IP protocol version, header length &	 * type of service.  The 2nd line checks the "Don't fragment" bit.	 * The 3rd line checks the time-to-live and protocol (the protocol	 * check is unnecessary but costless).  The 4th line checks the TCP	 * header length.  The 5th line checks IP options, if any.  The 6th	 * line checks TCP options, if any.  If any of these things are	 * different between the previous & current datagram, we send the	 * current datagram `uncompressed'.	 */	if (((u_short *)ip)[0] != ((u_short *)&cs->cs_ip)[0] 			|| ((u_short *)ip)[3] != ((u_short *)&cs->cs_ip)[3] 			|| ((u_short *)ip)[4] != ((u_short *)&cs->cs_ip)[4] 			|| getth_off(*th) != getth_off(*oth) 			|| (deltaS > 5 && BCMP(ip + 1, &cs->cs_ip + 1, (deltaS - 5) << 2)) 			|| (getth_off(*th) > 5 && BCMP(th + 1, oth + 1, (getth_off(*th) - 5) << 2)))		goto uncompressed;		/*	 * Figure out which of the changing fields changed.  The	 * receiver expects changes in the order: urgent, window,	 * ack, seq (the order minimizes the number of temporaries	 * needed in this section of code).	 */	if (th->th_flags & TCP_URG) {		deltaS = ntohs(th->th_urp);		ENCODEZ(deltaS);		changes |= NEW_U;	} else if (th->th_urp != oth->th_urp)		/* argh! URG not set but urp changed -- a sensible		 * implementation should never do this but RFC793		 * doesn't prohibit the change so we have to deal		 * with it. */		goto uncompressed;		if ((deltaS = (u_short)(ntohs(th->th_win) - ntohs(oth->th_win))) != 0) {		ENCODE(deltaS);		changes |= NEW_W;	}		if ((deltaL = ntohl(th->th_ack) - ntohl(oth->th_ack)) != 0) {		if (deltaL > 0xffff)			goto uncompressed;		deltaA = (u_short)deltaL;		ENCODE(deltaA);		changes |= NEW_A;	}		if ((deltaL = ntohl(th->th_seq) - ntohl(oth->th_seq)) != 0) {		if (deltaL > 0xffff)			goto uncompressed;		deltaS = (u_short)deltaL;		ENCODE(deltaS);		changes |= NEW_S;	}		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)

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品毛片大码女人| 久久夜色精品国产欧美乱极品| 丝袜脚交一区二区| 欧美激情一区二区三区| 777a∨成人精品桃花网| 懂色av一区二区三区免费看| 日韩电影在线观看一区| 亚洲欧美另类小说| 国产精品理论在线观看| 精品国产99国产精品| 欧美精品乱码久久久久久按摩 | 亚洲综合偷拍欧美一区色| 亚洲一区在线观看免费观看电影高清 | 日本欧美大码aⅴ在线播放| 2023国产一二三区日本精品2022| 91亚洲精华国产精华精华液| 国产91精品一区二区麻豆网站| 青娱乐精品在线视频| 婷婷开心激情综合| 亚洲成av人片一区二区三区| 亚洲综合久久久久| 亚洲va欧美va人人爽| 国产女人aaa级久久久级| 色婷婷香蕉在线一区二区| 国产成人a级片| 国产乱人伦偷精品视频免下载 | 久久国产成人午夜av影院| 日本成人超碰在线观看| 激情久久五月天| 国产成人精品亚洲午夜麻豆| av在线综合网| 欧美色网站导航| 欧美一级片在线观看| 久久久五月婷婷| 中文字幕亚洲成人| 亚洲综合免费观看高清完整版| 亚洲午夜电影在线观看| 男女性色大片免费观看一区二区| 国产乱色国产精品免费视频| 风间由美一区二区三区在线观看 | 日韩午夜电影av| 国产视频在线观看一区二区三区 | 色噜噜狠狠色综合中国| 91精品国产综合久久久蜜臀粉嫩| 国产夜色精品一区二区av| 国产精品丝袜一区| 亚洲高清免费观看| 国产成人在线观看| 欧美美女直播网站| 国产精品乱人伦一区二区| 视频一区中文字幕国产| 成人a区在线观看| 日韩你懂的电影在线观看| 1024国产精品| 国产成人免费高清| 欧美一区永久视频免费观看| 中文字幕 久热精品 视频在线 | 久久九九久久九九| 免费日本视频一区| 欧美日本在线播放| 一区二区三区美女| 色av成人天堂桃色av| 国产精品另类一区| www.日本不卡| 国产精品视频麻豆| 风间由美一区二区av101| 欧美va日韩va| 日韩国产欧美在线视频| 伊人性伊人情综合网| 国产一区二区三区精品欧美日韩一区二区三区 | 男男视频亚洲欧美| 欧美一区三区二区| 日本亚洲欧美天堂免费| 欧美日韩视频在线一区二区| 亚洲欧美日韩系列| 欧美制服丝袜第一页| 亚洲婷婷综合久久一本伊一区| 国产成人精品一区二| 中文在线免费一区三区高中清不卡| 国产在线观看一区二区| 精品少妇一区二区三区视频免付费| 免费的成人av| 国产欧美视频在线观看| 99这里都是精品| 日韩电影在线免费看| 欧美日韩成人在线一区| 亚洲一二三区不卡| 高清在线成人网| 国产日本欧洲亚洲| 美日韩一区二区三区| 在线影院国内精品| 亚洲免费在线看| 在线观看免费亚洲| 日韩av一区二区三区四区| 欧美一区二区成人6969| 蜜桃精品视频在线观看| 久久久久久亚洲综合影院红桃| 国产91精品久久久久久久网曝门| 国产精品欧美极品| 制服.丝袜.亚洲.另类.中文| 大陆成人av片| 麻豆成人在线观看| 欧美国产一区二区在线观看 | 天天综合天天做天天综合| 日韩午夜在线播放| 日本黄色一区二区| 成人听书哪个软件好| 亚洲第一搞黄网站| 久久婷婷成人综合色| 欧美在线999| 成人午夜视频在线| 日韩av一级片| 一区二区三区不卡视频| 日韩理论片一区二区| 久久午夜电影网| 欧美另类一区二区三区| 成人av在线一区二区三区| 视频在线观看91| 亚洲一区二区偷拍精品| 国产精品久久久久三级| 国产夜色精品一区二区av| 26uuu亚洲婷婷狠狠天堂| 在线成人免费观看| 欧美日韩激情在线| 一本色道久久综合狠狠躁的推荐| 国产精品自拍毛片| 韩国在线一区二区| 韩国毛片一区二区三区| 国内精品免费**视频| 日韩精品欧美成人高清一区二区| 日韩码欧中文字| 日韩美女精品在线| 亚洲精品免费在线播放| 亚洲欧美电影一区二区| 中文字幕亚洲不卡| 午夜国产精品影院在线观看| 一区二区三区欧美日| 亚洲午夜在线观看视频在线| 18成人在线视频| 午夜欧美视频在线观看| 免费观看一级欧美片| 国产精品一区二区三区乱码| 91在线小视频| 欧美电影精品一区二区| 精品国产免费人成电影在线观看四季 | 亚洲亚洲人成综合网络| 国产一区999| 一本大道久久a久久精二百| 在线观看亚洲a| 精品欧美一区二区在线观看| 国产女人18毛片水真多成人如厕 | 国产真实乱对白精彩久久| 国产白丝网站精品污在线入口| 大尺度一区二区| 欧美日韩国产小视频在线观看| 欧美大肚乱孕交hd孕妇| 亚洲人成人一区二区在线观看| 天天射综合影视| 99国产精品久久久| 日韩一区二区精品| 一区二区三区日韩欧美| 蜜臀av性久久久久av蜜臀妖精| 成人黄色大片在线观看| 日韩小视频在线观看专区| 一区二区三区自拍| 99久久99精品久久久久久 | 欧美日韩在线不卡| 亚洲色图在线播放| 高清久久久久久| 日韩色在线观看| 日韩1区2区3区| 欧美日韩综合不卡| 一区二区三区在线免费观看| 国产99久久久国产精品| 亚洲欧美日韩国产成人精品影院| 成人久久视频在线观看| 欧美成人官网二区| 青青青爽久久午夜综合久久午夜| 欧美在线视频日韩| 亚洲女人****多毛耸耸8| 国产91精品一区二区麻豆网站| 国产欧美日韩在线观看| 成人视屏免费看| 国产欧美一区二区精品久导航| 国产传媒日韩欧美成人| 久久久久99精品一区| 成人综合婷婷国产精品久久免费| 国产精品嫩草久久久久| 99久久精品99国产精品| 亚洲欧洲日韩av| 一本久久综合亚洲鲁鲁五月天 | 成人免费毛片a| 亚洲精品免费一二三区| 欧美精品久久99久久在免费线 | 国产精品自拍一区| 国产精品福利一区| 欧美在线一二三四区| 蜜桃一区二区三区四区| 久久这里只有精品首页| 成人午夜激情在线|