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

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

?? mppcc.c

?? MPPC compress/decompress algorithm
?? C
字號:
/*- * Copyright (c) 2002-2004 Jan Dubiec <jdx@slackware.pl> * Copyright (c) 2007 Alexander Motin <mav@freebsd.org> * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright *    notice unmodified, this list of conditions, and the following *    disclaimer. * 2. Redistributions in binary form must reproduce the above copyright *    notice, this list of conditions and the following disclaimer in the *    documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. *//* * MPPC compression library. * Version 1.0 * * Please note that Hi/Fn (http://www.hifn.com) holds US patents on some  * implementation critical aspects of MPPC so you should check if those  * patents are valid in your country in order to avoid legal problems. */#include <sys/param.h>#include <sys/systm.h>#include <net/mppc.h>#define MPPE_HIST_LEN          8192#define HASH(x)		(((40543*(((((x)[0]<<4)^(x)[1])<<4)^(x)[2]))>>4) & 0x1fff)struct MPPC_comp_state {    uint8_t	hist[2*MPPE_HIST_LEN];    uint16_t	histptr;    uint16_t	hash[MPPE_HIST_LEN];};/* inserts 1 to 8 bits into the output buffer */static void __inline putbits8(uint8_t *buf, uint32_t val, const uint32_t n, uint32_t *i, uint32_t *l){    buf += *i;    if (*l >= n) {	*l = (*l) - n;	val <<= *l;	*buf = *buf | (val & 0xff);	if (*l == 0) {	    *l = 8;	    (*i)++;	    *(++buf) = 0;	}    } else {	(*i)++;	*l = 8 - n + (*l);	val <<= *l;	*buf = *buf | ((val >> 8) & 0xff);	*(++buf) = val & 0xff;    }}/* inserts 9 to 16 bits into the output buffer */static void __inline putbits16(uint8_t *buf, uint32_t val, const uint32_t n, uint32_t *i, uint32_t *l){    buf += *i;    if (*l >= n - 8) {	(*i)++;	*l = 8 - n + (*l);	val <<= *l;	*buf = *buf | ((val >> 8) & 0xff);	*(++buf) = val & 0xff;	if (*l == 0) {	    *l = 8;	    (*i)++;	    *(++buf) = 0;	}    } else {	(*i)++; (*i)++;	*l = 16 - n + (*l);	val <<= *l;	*buf = *buf | ((val >> 16) & 0xff);	*(++buf) = (val >> 8) & 0xff;	*(++buf) = val & 0xff;    }}/* inserts 17 to 24 bits into the output buffer */static void __inline putbits24(uint8_t *buf, uint32_t val, const uint32_t n, uint32_t *i, uint32_t *l){    buf += *i;    if (*l >= n - 16) {	(*i)++; (*i)++;	*l = 16 - n + (*l);	val <<= *l;	*buf = *buf | ((val >> 16) & 0xff);	*(++buf) = (val >> 8) & 0xff;	*(++buf) = val & 0xff;	if (*l == 0) {	    *l = 8;	    (*i)++;	    *(++buf) = 0;	}    } else {	(*i)++; (*i)++; (*i)++;	*l = 24 - n + (*l);	val <<= *l;	*buf = *buf | ((val >> 24) & 0xff);	*(++buf) = (val >> 16) & 0xff;	*(++buf) = (val >> 8) & 0xff;	*(++buf) = val & 0xff;    }}size_t MPPC_SizeOfCompressionHistory(void){    return sizeof(struct MPPC_comp_state);}void MPPC_InitCompressionHistory(char *history){    struct MPPC_comp_state      *state = (struct MPPC_comp_state*)history;    bzero(history, sizeof(struct MPPC_comp_state));    state->histptr = MPPE_HIST_LEN;}int MPPC_Compress(u_char **src, u_char **dst, u_long *srcCnt, u_long *dstCnt, char *history, int flags, int undef){    struct MPPC_comp_state	*state = (struct MPPC_comp_state*)history;    uint32_t olen, off, len, idx, i, l;    uint8_t *hist, *sbuf, *p, *q, *r, *s;        int	rtn = MPPC_OK;    /*  	At this point, to avoid possible buffer overflow caused by packet	expansion during/after compression, we should make sure we have	space for the worst case.	Maximum MPPC packet expansion is 12.5%. This is the worst case when	all octets in the input buffer are >= 0x80 and we cannot find any	repeated tokens.    */    if (*dstCnt < (*srcCnt * 9 / 8 + 2)) {	rtn &= ~MPPC_OK;	return rtn;    }    /* We can't compress more then MPPE_HIST_LEN bytes in a call */    if (*srcCnt > MPPE_HIST_LEN) {	rtn &= ~MPPC_OK;	return rtn;    }    hist = state->hist + MPPE_HIST_LEN;    /* check if there is enough room at the end of the history */    if (state->histptr + *srcCnt >= 2*MPPE_HIST_LEN) {	rtn |= MPPC_RESTART_HISTORY;	state->histptr = MPPE_HIST_LEN;	memcpy(state->hist, hist, MPPE_HIST_LEN);    }    /* add packet to the history */    sbuf = state->hist + state->histptr;    memcpy(sbuf, *src, *srcCnt);    state->histptr += *srcCnt;    /* compress data */    r = sbuf + *srcCnt;    **dst = olen = i = 0;    l = 8;    while (i < *srcCnt - 2) {	s = q = sbuf + i;	/* Prognose matching position using hash function */	idx = HASH(s);	p = hist + state->hash[idx];	state->hash[idx] = (uint16_t) (s - hist);	if (p > s)	/* It was before MPPC_RESTART_HISTORY */	    p -= MPPE_HIST_LEN;	/* try previous history buffer */	off = s - p;	/* Check our prognosis */	if (off > MPPE_HIST_LEN - 1 || off < 1 || *p++ != *s++ || *p++ != *s++ ||	    *p++ != *s++) {	    /* no match found; encode literal byte */	    if ((*src)[i] < 0x80) {		/* literal byte < 0x80 */		putbits8(*dst, (uint32_t) (*src)[i], 8, &olen, &l);	    } else {				/* literal byte >= 0x80 */		putbits16(*dst, (uint32_t) (0x100|((*src)[i]&0x7f)), 9, &olen, &l);	    }	    ++i;	    continue;	}	/* Find length of the matching fragment */#if defined(__amd64__) || defined(__i386__)	/* Optimization for CPUs without strict data aligning requirements */	while ((*((uint32_t*)p) == *((uint32_t*)s)) && (s < (r - 3))) {	    p+=4;	    s+=4;	}#endif	while((*p++ == *s++) && (s <= r));	len = s - q - 1;	i += len;	/* at least 3 character match found; code data */	/* encode offset */	if (off < 64) {			/* 10-bit offset; 0 <= offset < 64 */	    putbits16(*dst, 0x3c0|off, 10, &olen, &l);	} else if (off < 320) {		/* 12-bit offset; 64 <= offset < 320 */	    putbits16(*dst, 0xe00|(off-64), 12, &olen, &l);	} else if (off < 8192) {	/* 16-bit offset; 320 <= offset < 8192 */	    putbits16(*dst, 0xc000|(off-320), 16, &olen, &l);	} else {	    /* This shouldn't happen. */	    rtn &= ~MPPC_OK;	    return rtn;	}	/* encode length of match */	if (len < 4) {			/* length = 3 */	    putbits8(*dst, 0, 1, &olen, &l);	} else if (len < 8) {		/* 4 <= length < 8 */	    putbits8(*dst, 0x08|(len&0x03), 4, &olen, &l);	} else if (len < 16) {		/* 8 <= length < 16 */	    putbits8(*dst, 0x30|(len&0x07), 6, &olen, &l);	} else if (len < 32) {		/* 16 <= length < 32 */	    putbits8(*dst, 0xe0|(len&0x0f), 8, &olen, &l);	} else if (len < 64) {		/* 32 <= length < 64 */	    putbits16(*dst, 0x3c0|(len&0x1f), 10, &olen, &l);	} else if (len < 128) {		/* 64 <= length < 128 */	    putbits16(*dst, 0xf80|(len&0x3f), 12, &olen, &l);	} else if (len < 256) {		/* 128 <= length < 256 */	    putbits16(*dst, 0x3f00|(len&0x7f), 14, &olen, &l);	} else if (len < 512) {		/* 256 <= length < 512 */	    putbits16(*dst, 0xfe00|(len&0xff), 16, &olen, &l);	} else if (len < 1024) {	/* 512 <= length < 1024 */	    putbits24(*dst, 0x3fc00|(len&0x1ff), 18, &olen, &l);	} else if (len < 2048) {	/* 1024 <= length < 2048 */	    putbits24(*dst, 0xff800|(len&0x3ff), 20, &olen, &l);	} else if (len < 4096) {	/* 2048 <= length < 4096 */	    putbits24(*dst, 0x3ff000|(len&0x7ff), 22, &olen, &l);	} else if (len < 8192) {	/* 4096 <= length < 8192 */	    putbits24(*dst, 0xffe000|(len&0xfff), 24, &olen, &l);	} else {	    /* This shouldn't happen. */	    rtn &= ~MPPC_OK;	    return rtn;	}    }    /* Add remaining octets to the output */    while(*srcCnt - i > 0) {	if ((*src)[i] < 0x80) {	/* literal byte < 0x80 */	    putbits8(*dst, (uint32_t) (*src)[i++], 8, &olen, &l);	} else {		/* literal byte >= 0x80 */	    putbits16(*dst, (uint32_t) (0x100|((*src)[i++]&0x7f)), 9, &olen, &l);	}    }    /* Reset unused bits of the last output octet */    if ((l != 0) && (l != 8)) {	putbits8(*dst, 0, l, &olen, &l);    }    /* If result is bigger then original, set flag and flush history */    if ((*srcCnt < olen) || ((flags & MPPC_SAVE_HISTORY) == 0)) {	if (*srcCnt < olen)	    rtn |= MPPC_EXPANDED;	bzero(history, sizeof(struct MPPC_comp_state));	state->histptr = MPPE_HIST_LEN;    }    *src += *srcCnt;    *srcCnt = 0;    *dst += olen;    *dstCnt -= olen;    return rtn;}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
91亚洲资源网| 色国产综合视频| 亚洲伊人伊色伊影伊综合网| 日韩欧美在线网站| 色哟哟在线观看一区二区三区| 麻豆91精品视频| 一区二区在线观看免费 | 一本大道久久a久久综合| 久国产精品韩国三级视频| 一区二区欧美精品| 中文字幕精品在线不卡| 欧美tickling网站挠脚心| 在线观看91视频| 91一区一区三区| 成人精品免费看| 国产精品996| 日本在线观看不卡视频| 亚洲综合一二区| 日韩一区在线播放| 国产精品免费久久久久| 久久久久久久久久久久电影 | 国产精品久久一卡二卡| 2020国产成人综合网| 欧美精品tushy高清| 91成人免费在线视频| 成人黄色av电影| 国产91富婆露脸刺激对白 | 色诱视频网站一区| 99久久免费视频.com| 国产成人午夜精品5599| 国产在线精品免费| 久久精品av麻豆的观看方式| 日韩制服丝袜av| 日韩成人一区二区三区在线观看| 亚洲h动漫在线| 午夜伦理一区二区| 亚洲一区二区三区美女| 一区二区三区小说| 亚洲一区二区av电影| 一区二区三区鲁丝不卡| 亚洲一区二区三区四区在线| 亚洲一区免费观看| 亚洲一区二区视频| 亚洲gay无套男同| 日本成人在线网站| 免费黄网站欧美| 精品午夜久久福利影院| 国产在线播放一区| 国产精品资源在线看| 国产成人欧美日韩在线电影| 国产精品一线二线三线精华| 麻豆成人91精品二区三区| 日本在线观看不卡视频| 蜜乳av一区二区三区| 精品一区二区久久| 成人动漫视频在线| 91麻豆福利精品推荐| 欧美吻胸吃奶大尺度电影 | 欧美中文字幕亚洲一区二区va在线| 在线观看三级视频欧美| 欧美精品乱码久久久久久| 日韩西西人体444www| 久久久国际精品| 亚洲婷婷国产精品电影人久久| 亚洲精品一卡二卡| 日韩经典中文字幕一区| 国产成人免费视频一区| 在线中文字幕一区二区| 欧美一区二区三区日韩| 国产午夜亚洲精品午夜鲁丝片| 《视频一区视频二区| 天堂在线亚洲视频| 国产一区欧美一区| 色综合天天做天天爱| 欧美一区二区视频在线观看2022 | 日韩福利电影在线观看| 久久电影网站中文字幕| 成人精品小蝌蚪| 正在播放亚洲一区| 国产欧美在线观看一区| 亚洲一区二区综合| 国产一区二区视频在线播放| 色综合久久中文字幕| 精品人伦一区二区色婷婷| 最新国产の精品合集bt伙计| 日韩国产欧美在线观看| 成人精品视频.| 欧美一卡在线观看| 亚洲精品日韩综合观看成人91| 老司机午夜精品| 色久综合一二码| 久久久精品国产免大香伊| 午夜精品久久久久久久久| 国产a久久麻豆| 欧美一区二区黄色| 一区二区三区四区不卡在线| 国产精品一级黄| 4hu四虎永久在线影院成人| 中文字幕一区二区三区精华液| 美日韩一区二区| 在线免费观看日韩欧美| 欧美激情综合五月色丁香小说| 视频一区在线播放| 色一区在线观看| 亚洲国产精品激情在线观看| 日本aⅴ亚洲精品中文乱码| 91免费国产视频网站| 国产日韩欧美亚洲| 精久久久久久久久久久| 欧美熟乱第一页| 亚洲人成网站影音先锋播放| 国内不卡的二区三区中文字幕| 欧美日韩黄色一区二区| 一区二区三区在线影院| 成人av在线网| 中文字幕成人网| 国产激情精品久久久第一区二区 | 久久久亚洲国产美女国产盗摄| 性做久久久久久免费观看 | av中文一区二区三区| 国产亚洲一区二区三区| 久久精品久久综合| 欧美福利视频导航| 亚洲成人av福利| 欧美视频一区二区三区| 一区二区三区精品在线| 在线精品观看国产| 亚洲精品日日夜夜| 色网站国产精品| 一区二区在线观看视频| 一本久久a久久免费精品不卡| 中文字幕在线不卡国产视频| 成人中文字幕在线| 中文字幕不卡在线观看| av一区二区三区在线| 中文字幕成人在线观看| 成人精品gif动图一区| 中文字幕亚洲在| 91免费版在线| 亚洲成人激情综合网| 欧美日韩一区高清| 日韩成人一区二区| 欧美成人精品二区三区99精品| 久久99久久99小草精品免视看| 亚洲精品一区二区三区蜜桃下载 | 国产成人无遮挡在线视频| 久久久美女艺术照精彩视频福利播放| 激情综合色播五月| 国产三级欧美三级| 99精品国产99久久久久久白柏| 18涩涩午夜精品.www| 欧美无砖专区一中文字| 日本视频一区二区| 久久你懂得1024| 成人高清av在线| 亚洲永久精品大片| 欧美一级夜夜爽| 国产一区二区三区在线观看免费视频 | 九九精品视频在线看| 久久精品人人做人人综合| 白白色亚洲国产精品| 亚洲综合免费观看高清在线观看| 欧美日韩国产综合久久 | 欧美性大战久久久久久久蜜臀| 亚洲成人av一区二区| 精品国产成人系列| 91网站最新地址| 天天综合天天做天天综合| www久久久久| 色八戒一区二区三区| 蜜桃视频第一区免费观看| 欧美国产日韩a欧美在线观看| 在线观看亚洲专区| 精品制服美女丁香| 亚洲精选在线视频| 欧美精品一区视频| 色久综合一二码| 狠狠色狠狠色综合| 亚洲影院在线观看| 久久久精品国产免大香伊| 欧美羞羞免费网站| 国产成人免费视频一区| 亚洲bt欧美bt精品| 中文字幕免费不卡在线| 欧美精品123区| 成人国产亚洲欧美成人综合网| 日韩一区精品视频| 综合自拍亚洲综合图不卡区| 日韩美女视频在线| 日本韩国一区二区三区视频| 久久99精品一区二区三区三区| 综合久久久久久| 精品久久人人做人人爽| 欧美伊人久久大香线蕉综合69 | 亚洲chinese男男1069| 国产精品网站一区| 日韩美女视频在线| 欧美日韩一区国产| 99精品在线免费| 国产激情偷乱视频一区二区三区|