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

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

?? ppp.c

?? MCS-51的一個Free小型操作系統,在KeilC中下編譯工作
?? C
?? 第 1 頁 / 共 4 頁
字號:
        pc->errCode = 0;        pc->inState = PDIDLE;        pc->inHead = NULL;        pc->inTail = NULL;        pc->inEscaped = 0;        pc->lastXMit = 0;#if VJ_SUPPORT > 0        pc->vjEnabled = 0;        vj_compress_init(&pc->vjComp);#endif        /*          * Default the in and out accm so that escape and flag characters         * are always escaped.          */        memset(pc->inACCM, 0, sizeof(ext_accm));        pc->inACCM[15] = 0x60;        memset(pc->outACCM, 0, sizeof(ext_accm));        pc->outACCM[15] = 0x60;	pc->linkStatusCB = linkStatusCB;	pc->linkStatusCtx = linkStatusCtx;	sys_thread_new(pppMain, (void*)pd, PPP_THREAD_PRIO);	if(!linkStatusCB) {		while(pd >= 0 && !pc->if_up) {			sys_msleep(500);			if (lcp_phase[pd] == PHASE_DEAD) {				pppClose(pd);				if (pc->errCode)					pd = pc->errCode;				else					pd = PPPERR_CONNECT;			}		}	}    }    return pd;}/* Close a PPP connection and release the descriptor.  * Any outstanding packets in the queues are dropped. * Return 0 on success, an error code on failure. */int pppClose(int pd){    PPPControl *pc = &pppControl[pd];    int st = 0;    /* Disconnect */    pc->kill_link = !0;    pppMainWakeup(pd);        if(!pc->linkStatusCB) {	    while(st >= 0 && lcp_phase[pd] != PHASE_DEAD) {		    sys_msleep(500);		    break;	    }    }    return st;}/* This function is called when carrier is lost on the PPP channel. */void pppSigHUP(int pd){    PPPControl *pc = &pppControl[pd];    pc->sig_hup = 1;    pppMainWakeup(pd);}static void nPut(PPPControl *pc, struct pbuf *nb){	struct pbuf *b;	int c;	for(b = nb; b != NULL; b = b->next) {	    if((c = sio_write(pc->fd, b->payload, b->len)) != b->len) {		PPPDEBUG((LOG_WARNING,			    "PPP nPut: incomplete sio_write(%d,, %u) = %d\n", pc->fd, b->len, c));#if LINK_STATS		lwip_stats.link.err++;#endif /* LINK_STATS */		pc->lastXMit = 0; /* prepend PPP_FLAG to next packet */		break;	    }	}	pbuf_free(nb);#if LINK_STATS	lwip_stats.link.xmit++;#endif /* LINK_STATS */}/*  * pppAppend - append given character to end of given pbuf.  If outACCM * is not NULL and the character needs to be escaped, do so. * If pbuf is full, append another. * Return the current pbuf. */static struct pbuf *pppAppend(u_char c, struct pbuf *nb, ext_accm *outACCM){    struct pbuf *tb = nb;        /* Make sure there is room for the character and an escape code.     * Sure we don't quite fill the buffer if the character doesn't     * get escaped but is one character worth complicating this? */    /* Note: We assume no packet header. */    if (nb && (PBUF_POOL_BUFSIZE - nb->len) < 2) {	tb = pbuf_alloc(PBUF_RAW, 0, PBUF_POOL);	if (tb) {	    nb->next = tb;        }#if LINK_STATS	else {	    lwip_stats.link.memerr++;	}#endif /* LINK_STATS */	nb = tb;    }    if (nb) {	if (outACCM && ESCAPE_P(*outACCM, c)) {            *((u_char*)nb->payload + nb->len++) = PPP_ESCAPE;            *((u_char*)nb->payload + nb->len++) = c ^ PPP_TRANS;        }        else            *((u_char*)nb->payload + nb->len++) = c;    }            return tb;}/* Send a packet on the given connection. */static err_t pppifOutput(struct netif *netif, struct pbuf *pb, struct ip_addr *ipaddr){    int pd = (int)netif->state;    u_short protocol = PPP_IP;    PPPControl *pc = &pppControl[pd];    u_int fcsOut = PPP_INITFCS;    struct pbuf *headMB = NULL, *tailMB = NULL, *p;    u_char c;    (void)ipaddr;    /* Validate parameters. */    /* We let any protocol value go through - it can't hurt us     * and the peer will just drop it if it's not accepting it. */	if (pd < 0 || pd >= NUM_PPP || !pc->openFlag || !pb) {        PPPDEBUG((LOG_WARNING, "pppifOutput[%d]: bad parms prot=%d pb=%p\n",                    pd, protocol, pb));#if LINK_STATS		lwip_stats.link.opterr++;		lwip_stats.link.drop++;#endif		return ERR_ARG;	}    /* Check that the link is up. */	if (lcp_phase[pd] == PHASE_DEAD) {        PPPDEBUG((LOG_ERR, "pppifOutput[%d]: link not up\n", pd));#if LINK_STATS		lwip_stats.link.rterr++;		lwip_stats.link.drop++;#endif		return ERR_RTE;	}    /* Grab an output buffer. */	headMB = pbuf_alloc(PBUF_RAW, 0, PBUF_POOL);    if (headMB == NULL) {        PPPDEBUG((LOG_WARNING, "pppifOutput[%d]: first alloc fail\n", pd));#if LINK_STATS		lwip_stats.link.memerr++;		lwip_stats.link.drop++;#endif /* LINK_STATS */        return ERR_MEM;    }        #if VJ_SUPPORT > 0    /*      * Attempt Van Jacobson header compression if VJ is configured and     * this is an IP packet.      */    if (protocol == PPP_IP && pc->vjEnabled) {        switch (vj_compress_tcp(&pc->vjComp, pb)) {        case TYPE_IP:            /* No change...            protocol = PPP_IP_PROTOCOL;             */            break;        case TYPE_COMPRESSED_TCP:            protocol = PPP_VJC_COMP;            break;        case TYPE_UNCOMPRESSED_TCP:            protocol = PPP_VJC_UNCOMP;            break;        default:            PPPDEBUG((LOG_WARNING, "pppifOutput[%d]: bad IP packet\n", pd));#if LINK_STATS			lwip_stats.link.proterr++;			lwip_stats.link.drop++;#endif        	pbuf_free(headMB);            return ERR_VAL;        }    }#endif            tailMB = headMB;            /* Build the PPP header. */    if ((sys_jiffies() - pc->lastXMit) >= PPP_MAXIDLEFLAG)        tailMB = pppAppend(PPP_FLAG, tailMB, NULL);    pc->lastXMit = sys_jiffies();    if (!pc->accomp) {        fcsOut = PPP_FCS(fcsOut, PPP_ALLSTATIONS);        tailMB = pppAppend(PPP_ALLSTATIONS, tailMB, &pc->outACCM);        fcsOut = PPP_FCS(fcsOut, PPP_UI);        tailMB = pppAppend(PPP_UI, tailMB, &pc->outACCM);    }    if (!pc->pcomp || protocol > 0xFF) {        c = (protocol >> 8) & 0xFF;        fcsOut = PPP_FCS(fcsOut, c);        tailMB = pppAppend(c, tailMB, &pc->outACCM);    }    c = protocol & 0xFF;    fcsOut = PPP_FCS(fcsOut, c);    tailMB = pppAppend(c, tailMB, &pc->outACCM);        /* Load packet. */	for(p = pb; p; p = p->next) {    	int n;    	u_char *sPtr;        sPtr = (u_char*)p->payload;        n = p->len;        while (n-- > 0) {            c = *sPtr++;                        /* Update FCS before checking for special characters. */            fcsOut = PPP_FCS(fcsOut, c);                        /* Copy to output buffer escaping special characters. */            tailMB = pppAppend(c, tailMB, &pc->outACCM);        }    }    /* Add FCS and trailing flag. */    c = ~fcsOut & 0xFF;    tailMB = pppAppend(c, tailMB, &pc->outACCM);    c = (~fcsOut >> 8) & 0xFF;    tailMB = pppAppend(c, tailMB, &pc->outACCM);    tailMB = pppAppend(PPP_FLAG, tailMB, NULL);            /* If we failed to complete the packet, throw it away. */    if (!tailMB) {        PPPDEBUG((LOG_WARNING,                    "pppifOutput[%d]: Alloc err - dropping proto=%d\n",                     pd, protocol));        pbuf_free(headMB);#if LINK_STATS		lwip_stats.link.memerr++;		lwip_stats.link.drop++;#endif        return ERR_MEM;    }	/* Send it. */    PPPDEBUG((LOG_INFO, "pppifOutput[%d]: proto=0x%04X\n", pd, protocol));    nPut(pc, headMB);    return ERR_OK;}/* Get and set parameters for the given connection. * Return 0 on success, an error code on failure. */int  pppIOCtl(int pd, int cmd, void *arg){    PPPControl *pc = &pppControl[pd];    int st = 0;    if (pd < 0 || pd >= NUM_PPP)        st = PPPERR_PARAM;    else {        switch(cmd) {        case PPPCTLG_UPSTATUS:      /* Get the PPP up status. */            if (arg)                 *(int *)arg = (int)(pc->if_up);            else                st = PPPERR_PARAM;            break;        case PPPCTLS_ERRCODE:       /* Set the PPP error code. */            if (arg)                 pc->errCode = *(int *)arg;            else                st = PPPERR_PARAM;            break;        case PPPCTLG_ERRCODE:       /* Get the PPP error code. */            if (arg)                 *(int *)arg = (int)(pc->errCode);            else                st = PPPERR_PARAM;            break;        case PPPCTLG_FD:            if (arg)                 *(sio_fd_t *)arg = pc->fd;            else                st = PPPERR_PARAM;            break;        default:            st = PPPERR_PARAM;            break;        }    }        return st;}/* * Return the Maximum Transmission Unit for the given PPP connection. */u_int pppMTU(int pd){    PPPControl *pc = &pppControl[pd];    u_int st;        /* Validate parameters. */    if (pd < 0 || pd >= NUM_PPP || !pc->openFlag)        st = 0;    else        st = pc->mtu;            return st;}/* * Write n characters to a ppp link. *  RETURN: >= 0 Number of characters written *           -1 Failed to write to device */int pppWrite(int pd, const u_char *s, int n){    PPPControl *pc = &pppControl[pd];    u_char c;    u_int fcsOut = PPP_INITFCS;    struct pbuf *headMB = NULL, *tailMB;	headMB = pbuf_alloc(PBUF_RAW, 0, PBUF_POOL);    if (headMB == NULL) {#if LINK_STATS		lwip_stats.link.memerr++;		lwip_stats.link.proterr++;#endif /* LINK_STATS */		return PPPERR_ALLOC;    }    tailMB = headMB;            /* If the link has been idle, we'll send a fresh flag character to     * flush any noise. */    if ((sys_jiffies() - pc->lastXMit) >= PPP_MAXIDLEFLAG)        tailMB = pppAppend(PPP_FLAG, tailMB, NULL);    pc->lastXMit = sys_jiffies();         /* Load output buffer. */    while (n-- > 0) {        c = *s++;                /* Update FCS before checking for special characters. */        fcsOut = PPP_FCS(fcsOut, c);                /* Copy to output buffer escaping special characters. */        tailMB = pppAppend(c, tailMB, &pc->outACCM);    }        /* Add FCS and trailing flag. */    c = ~fcsOut & 0xFF;    tailMB = pppAppend(c, tailMB, &pc->outACCM);    c = (~fcsOut >> 8) & 0xFF;    tailMB = pppAppend(c, tailMB, &pc->outACCM);    tailMB = pppAppend(PPP_FLAG, tailMB, NULL);            /* If we failed to complete the packet, throw it away.     * Otherwise send it. */    if (!tailMB) {		PPPDEBUG((LOG_WARNING,                "pppWrite[%d]: Alloc err - dropping pbuf len=%d\n", pd, headMB->len));/*                "pppWrite[%d]: Alloc err - dropping %d:%.*H", pd, headMB->len, LWIP_MIN(headMB->len * 2, 40), headMB->payload)); */		pbuf_free(headMB);#if LINK_STATS		lwip_stats.link.memerr++;		lwip_stats.link.proterr++;#endif /* LINK_STATS */		return PPPERR_ALLOC;	}    PPPDEBUG((LOG_INFO, "pppWrite[%d]: len=%d\n", pd, headMB->len));/*     "pppWrite[%d]: %d:%.*H", pd, headMB->len, LWIP_MIN(headMB->len * 2, 40), headMB->payload)); */    nPut(pc, headMB);    return PPPERR_NONE;}/* * ppp_send_config - configure the transmit characteristics of * the ppp interface.

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩欧美自拍偷拍| 亚洲精品一二三| 中文字幕乱码亚洲精品一区| 国产欧美中文在线| 国产精品传媒入口麻豆| 亚洲激情男女视频| 日韩电影一二三区| 国产.精品.日韩.另类.中文.在线.播放| 九九精品一区二区| 欧美中文字幕一二三区视频| 欧美日韩大陆在线| 久久精品亚洲乱码伦伦中文| 18欧美乱大交hd1984| 日本视频中文字幕一区二区三区| 麻豆视频一区二区| 国产精品一区在线观看乱码| 麻豆精品在线播放| 成人av网站在线| 日韩欧美一卡二卡| 亚洲裸体xxx| 国产精品18久久久久久vr| 91官网在线观看| 久久久久久久性| 亚洲午夜免费电影| 99久久99久久免费精品蜜臀| 日韩一区二区视频| 亚洲黄色尤物视频| 99国内精品久久| 国产亚洲成aⅴ人片在线观看| 亚洲一二三区不卡| 色婷婷综合中文久久一本| 日本一区二区电影| 国产精品白丝jk白祙喷水网站 | 秋霞国产午夜精品免费视频| 国产一区二区电影| 欧美一激情一区二区三区| 一区二区三区欧美| 不卡的电影网站| 国产日韩欧美在线一区| 精品综合免费视频观看| 91一区在线观看| 欧美成人aa大片| 日本不卡123| 日韩欧美电影在线| 蜜臀av一区二区| 日韩欧美中文字幕公布| 另类的小说在线视频另类成人小视频在线| 欧洲亚洲精品在线| 亚洲国产一区二区三区| 欧美日韩免费视频| 日韩影院免费视频| 欧美一区午夜视频在线观看| 免费高清不卡av| 国产精品日产欧美久久久久| 9久草视频在线视频精品| 亚洲高清免费观看高清完整版在线观看| 在线观看免费一区| 麻豆国产欧美一区二区三区| ww久久中文字幕| 99精品视频在线播放观看| 一区二区免费看| 欧美日韩激情一区二区| 日韩精品一二区| 欧美国产日韩一二三区| 97se亚洲国产综合自在线观| 丝袜诱惑制服诱惑色一区在线观看| 日韩午夜小视频| 北岛玲一区二区三区四区| 中文字幕 久热精品 视频在线| 成人黄色777网| 五月天国产精品| 国产精品国产三级国产| 欧美一区二区三区日韩| 99视频在线精品| 青青草一区二区三区| 1024亚洲合集| 国产午夜精品一区二区| 欧美色爱综合网| 国产69精品久久99不卡| 另类人妖一区二区av| 一区二区三区视频在线看| 欧美国产日韩亚洲一区| 欧美成人aa大片| 欧美一级一区二区| 欧美亚洲丝袜传媒另类| 91一区二区在线| 国产呦萝稀缺另类资源| 日韩中文字幕区一区有砖一区| 亚洲免费av高清| 国产精品的网站| 国产亚洲一二三区| 欧美成人综合网站| 日韩欧美在线1卡| 日韩丝袜美女视频| 日韩欧美在线1卡| 欧美videossexotv100| 日韩一区二区免费在线观看| 成人av电影免费观看| 热久久久久久久| 婷婷丁香久久五月婷婷| 日韩和欧美一区二区| 亚洲地区一二三色| 五月天亚洲精品| 日韩电影一区二区三区| 麻豆极品一区二区三区| 精品一区二区三区日韩| 国产一区二区三区在线观看免费视频| 青青草国产成人av片免费| 蜜桃视频一区二区三区| 韩国成人精品a∨在线观看| 国产精品亚洲第一区在线暖暖韩国| 高清在线不卡av| 欧美在线高清视频| 日韩欧美国产一二三区| 国产亚洲一区二区在线观看| 亚洲精品自拍动漫在线| 日韩精品91亚洲二区在线观看| 另类欧美日韩国产在线| 成人avav影音| 欧美精品一二三区| 国产精品色眯眯| 午夜久久久久久久久| 国产电影一区二区三区| 欧美亚洲动漫精品| 久久影音资源网| 亚洲图片欧美视频| 国产成人在线视频播放| 欧美日本一区二区在线观看| 国产精品久久久久影院色老大| 伊人婷婷欧美激情| 青青草国产精品亚洲专区无| www.在线成人| 精品免费日韩av| 亚洲午夜一区二区三区| 国产精品香蕉一区二区三区| 色香蕉久久蜜桃| 国产女同性恋一区二区| 日韩激情一二三区| 日本道精品一区二区三区 | 日本欧洲一区二区| 在线亚洲人成电影网站色www| 久久蜜桃av一区二区天堂| 极品尤物av久久免费看| 日韩亚洲欧美成人一区| 午夜av一区二区| 欧美另类z0zxhd电影| 亚洲激情网站免费观看| 色网站国产精品| 亚洲人成精品久久久久久| 99视频热这里只有精品免费| 欧美精品一区二区三区很污很色的 | 2023国产精品| 极品瑜伽女神91| 久久久精品中文字幕麻豆发布| 日韩av不卡一区二区| 欧美伊人久久大香线蕉综合69| 国产亚洲1区2区3区| 国产一区二区视频在线播放| 精品乱人伦小说| 久久99国产精品尤物| 久久综合成人精品亚洲另类欧美 | 免费精品99久久国产综合精品| 91精品免费在线观看| 麻豆国产欧美日韩综合精品二区 | 精品99一区二区三区| 国产一区二区三区香蕉| 国产欧美日韩在线| 色婷婷综合久久久中文一区二区| 亚洲综合免费观看高清完整版在线| 色婷婷av久久久久久久| 男男视频亚洲欧美| 国产无人区一区二区三区| 成人看片黄a免费看在线| 亚洲视频电影在线| 日韩欧美国产小视频| 成+人+亚洲+综合天堂| 亚洲国产精品天堂| 欧美成人猛片aaaaaaa| 成年人网站91| 久99久精品视频免费观看| 亚洲欧美在线另类| 日韩精品一区二区三区中文不卡| 国产91在线观看| 日本不卡一区二区| 国产精品国产三级国产专播品爱网| 欧美日产在线观看| 国产一区二区三区四区五区入口 | 日韩高清不卡在线| 中文字幕佐山爱一区二区免费| 在线播放一区二区三区| av不卡在线观看| 麻豆freexxxx性91精品| 亚洲欧美福利一区二区| 久久精品男人的天堂| 日韩一区二区三区视频在线观看| 91在线视频播放| 成人午夜精品在线| 韩日av一区二区| 久久精品国产一区二区三区免费看| 亚洲色图制服丝袜|