亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
亚洲成av人片www| 日韩va亚洲va欧美va久久| 在线中文字幕一区二区| 日本中文字幕一区二区有限公司| 欧美一区二区三区婷婷月色| 国产一区二区免费在线| 中文字幕一区av| 911精品国产一区二区在线| 久久不见久久见中文字幕免费| 国产亚洲欧美日韩在线一区| 99精品视频在线免费观看| 日本最新不卡在线| 国产精品久久久久影院亚瑟| 欧美日韩国产电影| 成人免费视频视频| 麻豆专区一区二区三区四区五区| 中文字幕在线免费不卡| 日韩精品中文字幕一区二区三区| 色国产综合视频| 高清国产一区二区| 六月婷婷色综合| 亚洲国产精品一区二区www| 国产日本一区二区| 在线电影一区二区三区| 色婷婷av一区| 97成人超碰视| 国产成人av一区二区三区在线观看| 一区二区三区不卡在线观看 | 久久网这里都是精品| 欧美酷刑日本凌虐凌虐| 91国产福利在线| 色综合欧美在线视频区| 成人激情午夜影院| 国产一区二区伦理| 麻豆精品视频在线观看免费| 日日嗨av一区二区三区四区| 亚洲综合区在线| 一区二区三区在线观看欧美| 亚洲婷婷综合久久一本伊一区 | aaa欧美大片| 国产成人av电影在线观看| 精品一区二区精品| 国产一区高清在线| 国产传媒日韩欧美成人| 国产高清精品网站| 成人激情午夜影院| 91网站最新网址| 色香蕉成人二区免费| 欧美午夜精品免费| 日韩亚洲电影在线| 精品国产髙清在线看国产毛片 | 国产suv精品一区二区三区| 国产精品18久久久久久久久 | 亚洲精品一线二线三线| 欧美二区乱c少妇| 亚洲乱码国产乱码精品精98午夜 | 色综合久久66| 欧美一区二区三区日韩| 亚洲精品一区二区三区福利| 国产午夜亚洲精品午夜鲁丝片| 国产精品麻豆久久久| 亚洲最新视频在线播放| 蜜臀av在线播放一区二区三区 | 成人手机电影网| 欧美日韩免费在线视频| 久久久久久99久久久精品网站| 亚洲免费av网站| 蜜桃av一区二区在线观看| 成人app在线观看| 欧美一区二区视频在线观看| 日本一区二区视频在线观看| 亚洲午夜羞羞片| 福利一区二区在线| 欧美电影一区二区| 亚洲三级在线看| 国产xxx精品视频大全| 91精品国产色综合久久不卡蜜臀 | 在线免费视频一区二区| 精品伦理精品一区| 久久青草欧美一区二区三区| 亚洲va国产天堂va久久en| 成人免费观看男女羞羞视频| 欧美一二三区精品| 亚洲国产视频一区二区| 99久久国产综合色|国产精品| 欧美精品一区二区三区蜜臀| 亚洲国产一区二区三区青草影视| 国产高清在线精品| 26uuu亚洲综合色欧美| 秋霞国产午夜精品免费视频| 欧美在线高清视频| 亚洲精品成a人| 91亚洲资源网| 亚洲视频一区二区在线观看| 国产成人av电影在线观看| 久久视频一区二区| 国产成人精品网址| 久久久久久久性| 国产一区二区三区最好精华液| 欧美一级艳片视频免费观看| 视频在线在亚洲| 欧美一区二区成人6969| 无码av免费一区二区三区试看 | 精品久久久久久久久久久久久久久| 亚洲成人福利片| 4hu四虎永久在线影院成人| 亚洲h在线观看| 91精品国产色综合久久不卡电影 | 日韩成人免费看| 欧美大片在线观看一区二区| 久久99精品国产.久久久久久 | 欧美日韩一区小说| 日韩精品五月天| 精品久久久久久最新网址| 成人永久aaa| 一区二区三区在线视频免费观看| 欧美伦理影视网| 久久99九九99精品| 国产精品入口麻豆原神| 色噜噜久久综合| 日韩高清在线不卡| 国产嫩草影院久久久久| 色视频成人在线观看免| 麻豆精品视频在线观看免费 | 色综合久久99| 美女爽到高潮91| 亚洲日本丝袜连裤袜办公室| 欧美系列亚洲系列| 精品一区二区三区免费观看| 国产精品久久久久久久久免费相片 | 成人不卡免费av| 舔着乳尖日韩一区| 国产精品第五页| 日韩欧美一区在线| 97aⅴ精品视频一二三区| 日韩1区2区日韩1区2区| 中文字幕亚洲欧美在线不卡| 日韩一区二区三区四区| 日本乱人伦aⅴ精品| 韩国成人福利片在线播放| 亚洲一级二级三级| 国产欧美日韩不卡免费| 日韩欧美激情四射| 欧美在线制服丝袜| 国产盗摄一区二区| 日韩黄色片在线观看| 中文字幕一区二区三区视频| 日韩一区二区三区在线| 在线观看免费视频综合| 99久久99久久精品免费观看| 国产激情91久久精品导航| 久久99国产精品免费| 日韩和欧美一区二区三区| 亚洲综合999| 一区二区三区四区不卡在线| 国产精品久久久久9999吃药| 久久精品视频在线免费观看| 精品电影一区二区三区 | 亚洲国产电影在线观看| 久久免费视频色| 久久欧美一区二区| 久久婷婷国产综合精品青草| 欧美哺乳videos| 欧美sm美女调教| 精品国产一区二区国模嫣然| 日韩欧美在线不卡| 亚洲精品在线观看网站| www欧美成人18+| 精品少妇一区二区三区免费观看| 欧美一级国产精品| 欧美成人一区二区| 久久久久久日产精品| 国产精品久99| 亚洲蜜桃精久久久久久久| 夜夜亚洲天天久久| 日本在线不卡视频一二三区| 毛片av一区二区| 国产成人精品免费| 色综合天天性综合| 欧美日韩极品在线观看一区| 精品久久久久久综合日本欧美| 欧美激情综合五月色丁香| 亚洲精品欧美激情| 精品一区二区三区免费视频| 国产91色综合久久免费分享| 99视频精品免费视频| 欧美日韩国产综合久久| 久久久亚洲午夜电影| 一区二区三区日本| 国产精品99久久久久久宅男| 91精品福利视频| 久久久久久久久久久久电影| 一区二区三区在线观看动漫| 精品一区二区三区的国产在线播放 | 国产成人h网站| 欧美日韩不卡一区| 亚洲人成亚洲人成在线观看图片| 三级一区在线视频先锋 | 成人网男人的天堂| 日韩一区二区视频|