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

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

?? if_ppp.c

?? vxwork源代碼
?? C
?? 第 1 頁 / 共 4 頁
字號:
                 * Get another packet to be sent                 */                m = ppp_dequeue(sc);                if (m == NULL)                    break;                /*                 * The extra PPP_FLAG will start up a new packet, and thus                 * will flush any accumulated garbage.  We do this whenever                 * the line may have been idle for some time.                 */	        ioctl(fd, FIONWRITE, (int) &count);	        if (count == 0) {		    ++sc->sc_bytessent;		    ch = PPP_FLAG;		    (void) write(fd, &ch, 1);	        }                /* Calculate the FCS for the first mbuf's worth. */                sc->sc_outfcs = pppfcs(PPP_INITFCS, mtod(m, u_char *), m->m_len);            }	    for (;;) {		start = mtod(m, u_char *);		len = m->m_len;		stop = start + len;	        while (len > 0) {                    /*                     * Find out how many bytes in the string we can                     * handle without doing something special.                     */                    for (cp = start; cp < stop; cp++)                        if (ESCAPE_P(*cp))                            break;                    n = cp - start;		    if (n) {                        int cc, nleft;                        for (nleft = n; nleft > 0; nleft -= cc) {                            if ((cc =  write(fd, (char *)start, n)) <= 0)                                break;                            if (cc > nleft)                                cc = nleft;                        }                        ndone = n - nleft;                        len -= ndone;                        start += ndone;                        sc->sc_bytessent += ndone;                        if (ndone < n)                            break;  /* packet doesn't fit */                    }		    /*		     * If there are characters left in the mbuf,		     * the first one must be special..		     * Put it out in a different form.		     */		    if (len) {			ch = PPP_ESCAPE;			if (write(fd, &ch, 1) != 1)			    break;    			ch = *start ^ PPP_TRANS;			if (write(fd, &ch, 1) != 1)			    break;    			sc->sc_bytessent += 2;			start++;			len--;		    }	        }                /*                 * If we didn't empty this mbuf, remember where we're up to.                 * If we emptied the last mbuf, try to add the FCS and closing                 * flag, and if we can't, leave sc_outm pointing to m, but with                 * m->m_len == 0, to remind us to output the FCS and flag later.                 */                done = len == 0;                if (done && m->m_next == NULL) {                    u_char *p;                    int c;                    u_char endseq[8];                    /*                     * We may have to escape the bytes in the FCS.                     */                    p = endseq;                    c = ~sc->sc_outfcs & 0xFF;                    if (ESCAPE_P(c)) {                        *p++ = PPP_ESCAPE;                        *p++ = c ^ PPP_TRANS;                    } else                        *p++ = c;                    c = (~sc->sc_outfcs >> 8) & 0xFF;                    if (ESCAPE_P(c)) {                        *p++ = PPP_ESCAPE;                        *p++ = c ^ PPP_TRANS;                    } else                        *p++ = c;                    *p++ = PPP_FLAG;                    /*                     * Try to output the FCS and flag.  If the bytes                     * don't all fit, back out.                     */                    write(fd, (char *)endseq, (int)p-(int)endseq);                }                if (!done) {		    m->m_data = (caddr_t)start;                     m->m_len = len;                    sc->sc_outm = m;                    break;         /* can't do any more at the moment */                }                /* Finished with this mbuf; free it and move on. */                m2 = m_free (m);                if (m2 == NULL)                    break;                m = m2;                sc->sc_outfcs = pppfcs(sc->sc_outfcs, mtod(m, u_char *), m->m_len);            }            /* Finished a packet */            sc->sc_outm = NULL;            sc->sc_bytessent++;     /* account for closing flag */            sc->sc_if.if_opackets++;	    sc->sc_if.if_obytes = sc->sc_bytessent;	}	taskUnsafe();    }}/* * Allocate enough mbuf to handle current MRU. */static intpppgetm(sc)    register struct ppp_softc *sc;{    struct mbuf *m, **mp;    int len;    int s;    s = splimp();    mp = &sc->sc_m;    for (len = HDROFF + sc->sc_mru + PPP_HDRLEN + PPP_FCSLEN; len > 0; ){	if ((m = *mp) == NULL) {	    m = mHdrClGet (M_DONTWAIT, MT_DATA, len, FALSE);	    if (m == NULL)		break;	    *mp = m;	}	len -= M_DATASIZE(m);	mp = &m->m_next;    }    splx(s);    return len <= 0;}/* * pppintr - PPP tty protocol hook routine */static intpppintr(unit, c)    int unit;    int c;{    register struct ppp_softc *sc = ppp_softc[unit];    TY_DEV * pTyDev;    RING_ID ringId;    if (ppp_softc[unit] == NULL)        return FALSE;    /* Set discard flag if this is a new packet and ring buffer full */    if ( sc->sc_qlen == 0 )    {        pTyDev = (TY_DEV *) iosFdDevFind(sc->sc_fd);        ringId = pTyDev->rdBuf;        if (rngIsFull (ringId))            sc->sc_flags |= SC_DISCARD_PKT;        else            sc->sc_flags &= ~SC_DISCARD_PKT;    }    ++sc->sc_qlen;    if (sc->sc_qlen > PPPBUFSIZE)        {        netJobAdd((FUNCPTR) ppp_tty_read, (int)unit, (int) sc,                  (int) sc->sc_qlen, 0, 0);        sc->sc_qlen = 0;        return (FALSE);        }         if (((ppp_if[unit]->lcp_fsm.state) != OPENED) && ((c & 0xff) == 'T'))        {        netJobAdd((FUNCPTR) ppp_tty_read, (int)unit, (int) sc,                  (int) sc->sc_qlen, 0, 0);        return (FALSE);        }    if ((c & 0xff) == PPP_FLAG)         {        netJobAdd((FUNCPTR) ppp_tty_read, (int)unit, (int) sc,                       (int) sc->sc_qlen, 0, 0);        sc->sc_qlen = 0;        }    return (FALSE);}/* * ppp_tty_read - read from ppp tty interface */static voidppp_tty_read(unit, sc, count)    int unit;    register struct ppp_softc *sc;    register int count;{    register int i;    register int num;    char buf[PPPBUFSIZE + 2];    /* count should never be greater than PPPBUFSIZE+1 */    num = read(sc->sc_fd, buf, count);    if (count > PPPBUFSIZE)       {       /* The received packet is greater than the MTU - Drop the packet */       sc->sc_if.if_ierrors++;       return;       }    if ((ppp_if[unit]->lcp_fsm.state) != OPENED)        {        if (strncmp("CLIENT", buf, strlen("CLIENT") )==0)           {           sc->sc_qlen = 0;           write(sc->sc_fd, "CLIENTSERVER", strlen("CLIENTSERVER"));           return;           }        }    if (sc->sc_flags & SC_DISCARD_PKT)        {        /* Packet discarded */        sc->sc_if.if_ierrors++;        sc->sc_flags &= ~SC_DISCARD_PKT;        return;        }    for (i = 0; i < num; i++)        pppinput(sc, buf[i]);}/* * PPP packet input routine. * The caller has checked and removed the FCS. * The return value is 1 if the packet was put on sc->sc_inq, * 0 otherwise. */#define COMPTYPE(proto) ((proto) == PPP_VJC_COMP? TYPE_COMPRESSED_TCP: \                         TYPE_UNCOMPRESSED_TCP)/******************************************************************************** ppppktin - pass the packet to the appropriate stack LCP or IP* * This routine determines packet type and queues the mbuf to the appropriate* queue. This routine returns a value of 1 if the packet type is other than* PPP_IP.** NOMANUAL** RETURNS: 0/1*/static intppppktin(sc, m)    struct ppp_softc *sc;    struct mbuf *m;{    struct ifqueue *inq;    int s, ilen, xlen, proto, rv;    u_char *cp, adrs, ctrl;    struct mbuf *mp;    char buf[PPPBUFSIZE];    sc->sc_if.if_ipackets++;    sc->sc_if.if_lastchange = tickGet (); 	/* record the last change */    rv = 0;    cp = mtod(m, u_char *);    adrs = cp[0];    ctrl = cp[1];    proto = (cp[2] << 8) + cp[3];    ilen = 0;    for (mp = m; mp != NULL; mp = mp->m_next)	ilen += mp->m_len;#ifdef VJC    /*     * See if we have a VJ-compressed packet to uncompress.     */    if (proto == PPP_VJC_COMP || proto == PPP_VJC_UNCOMP) {	char *pkttype = proto == PPP_VJC_COMP? "": "un";	if (sc->sc_flags & SC_REJ_COMP_TCP) {	    if (sc->sc_flags & SC_DEBUG)		printf("ppp%d: %scomp pkt w/o compression; flags 0x%x\n",			sc->sc_if.if_unit, pkttype, sc->sc_flags);	    m_freem(m);	    sc->sc_if.if_ierrors++;	    return 0;	}	if (proto == PPP_VJC_COMP && m->m_data - M_DATASTART(m) < MAX_HDR) {	    /*	     * We don't have room in the mbuf to decompress this packet.	     * XXX For now we just drop the packet.	     */	    if (sc->sc_flags & SC_DEBUG)		printf("ppp%d: no room to VJ-decompress packet\n",		       sc->sc_if.if_unit);	    m_freem(m);	    sc->sc_if.if_ierrors++;	    return 0;	}	m->m_data += PPP_HDRLEN;	m->m_len -= PPP_HDRLEN;	ilen -= PPP_HDRLEN;	xlen = sl_uncompress_tcp((u_char **)(&m->m_data), m->m_len,					  COMPTYPE(proto), &sc->sc_comp);	if (xlen == 0) {	    if (sc->sc_flags & SC_DEBUG)		printf("ppp%d: sl_uncompress failed on type %scomp\n",			sc->sc_if.if_unit, pkttype);	    m_freem(m);	    sc->sc_if.if_ierrors++;	    return 0;	}	/* adjust the first mbuf by the decompressed amt */	xlen += PPP_HDRLEN;	m->m_len += xlen - ilen;	ilen = xlen;	m->m_data -= PPP_HDRLEN;	proto = PPP_IP;	/* put the ppp header back in place */	if (cp != mtod(m, u_char *)) {	    cp = mtod(m, u_char *);	    cp[0] = adrs;	    cp[1] = ctrl;	    cp[2] = 0;	}	cp[3] = PPP_IP;    }#endif /* VJC */    /*     * If the packet will fit in a header mbuf, don't waste a     * whole cluster on it.     */    m->m_pkthdr.len = ilen;    m->m_pkthdr.rcvif = &sc->sc_if;#if NBPFILTER > 0    /* See if bpf wants to look at the packet. */    if (sc->sc_bpf)	bpf_mtap(sc->sc_bpf, m);#endif        /* call etherInputHookRtn here */    if (etherInputHookRtn != NULL) {        FAST char *p = (char *) buf; 	for (mp = m; mp != NULL; p += mp->m_len, mp = mp->m_next)	    bcopy(mtod (mp, char *), p, mp->m_len); 	if ((*etherInputHookRtn) (&sc->sc_if, buf, ilen) != 0)	    {	    m_freem (m); 	/* free mbuf, not handed to the upperlayer */	    return (OK);	    }    }    switch (proto) {#ifdef INET    case PPP_IP:	/*	 * IP packet - take off the ppp header and pass it up to IP.	 */	if ((sc->sc_if.if_flags & IFF_UP) == 0	    || (sc->sc_flags & SC_ENABLE_IP) == 0) {	    /* interface is down - drop the packet. */	    m_freem(m);	    return 0;	}	m->m_pkthdr.len -= PPP_HDRLEN;	m->m_data += PPP_HDRLEN;	m->m_len -= PPP_HDRLEN;	inq = &ipintrq;	break;#endif    default:	/*	 * Some other protocol - place on input queue for read().	 */	inq = &sc->sc_inq;	rv = 1;	break;    }    /*     * Put the packet on the appropriate input queue.     */    if (proto == PPP_IP)	{	sc->sc_iprcvd++;            /* incr ip packets received */	ipintr (m);	}    else	{        s = splimp();        if (IF_QFULL(inq)) 	    {	    IF_DROP(inq);	    if (sc->sc_flags & SC_DEBUG)	    printf("ppp%d: queue full\n", sc->sc_if.if_unit);	    sc->sc_if.if_ierrors++;	    sc->sc_if.if_iqdrops++;	    m_freem(m);	    rv = 0;            }         else	    {            IF_ENQUEUE(inq, m);	    kill(sc->sc_tid, SIGIO); 	/* give to alternate processing */	    }        splx(s);	}    return rv;}/* * tty interface receiver interrupt. */static unsigned paritytab[8] = {    0x96696996, 0x69969669, 0x69969669, 0x96696996,    0x69969669, 0x96696996, 0x96696996, 0x69969669};static voidpppinput(sc, c)    struct ppp_softc *sc;    register int c;{    struct mbuf *m;    int ilen;    ++sc->sc_bytesrcvd;    c &= 0xff;    if (c & 0x80)	sc->sc_flags |= SC_RCV_B7_1;    else	sc->sc_flags |= SC_RCV_B7_0;    if (paritytab[c >> 5] & (1 << (c & 0x1F)))	sc->sc_flags |= SC_RCV_ODDP;    else	sc->sc_flags |= SC_RCV_EVNP;    if (sc->sc_flags & SC_LOG_RAWIN)	ppplogchar(sc, c);    if (c == PPP_FLAG) {	ilen = sc->sc_ilen;	sc->sc_ilen = 0;	sc->sc_if.if_ibytes = sc->sc_bytesrcvd;	if (sc->sc_rawin_count > 0) 	    ppplogchar(sc, -1);	/*	 * If SC_ESCAPED is set, then we've seen the packet

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
精品国产乱码久久久久久免费| 亚洲人成在线观看一区二区| 欧美色大人视频| 日本午夜精品一区二区三区电影| 国产精品久久午夜夜伦鲁鲁| 精品欧美一区二区在线观看| 精品少妇一区二区| 26uuu久久综合| 国产欧美精品一区二区三区四区| 国产日韩影视精品| 中文字幕一区二区三区在线不卡| 国产精品国产三级国产| 亚洲欧美在线视频观看| 《视频一区视频二区| 亚洲视频一二三区| 亚洲免费观看高清在线观看| 亚洲美女屁股眼交| 亚洲午夜精品17c| 青青草精品视频| 精品中文字幕一区二区| 国产经典欧美精品| 91啪在线观看| 欧美视频你懂的| 欧美一级xxx| 国产午夜亚洲精品羞羞网站| 亚洲欧美日韩系列| 五月激情综合网| 国产乱人伦精品一区二区在线观看 | 久久婷婷久久一区二区三区| 久久久久久一二三区| 亚洲图片你懂的| 亚洲成人在线观看视频| 美女视频一区二区三区| 国产精品小仙女| 色天天综合色天天久久| 欧美一区二区三区免费视频| 国产亚洲人成网站| 亚洲专区一二三| 久久精品av麻豆的观看方式| aaa欧美日韩| 91精品国产高清一区二区三区蜜臀| 久久日一线二线三线suv| 亚洲欧洲99久久| 蜜臀va亚洲va欧美va天堂| 成人国产精品免费观看动漫| 欧美日韩久久久久久| 久久伊人中文字幕| 一区二区三区中文字幕在线观看| 老司机免费视频一区二区三区| 成人性生交大片免费看在线播放 | 亚洲欧洲精品成人久久奇米网| 亚洲成人777| 国产成人午夜视频| 欧美最猛黑人xxxxx猛交| 精品对白一区国产伦| 综合久久一区二区三区| 久久er精品视频| 91久久精品一区二区| 久久青草欧美一区二区三区| 亚洲国产精品自拍| 成人国产精品免费网站| 日韩欧美中文一区二区| 亚洲激情六月丁香| 国产成人亚洲综合色影视| 777久久久精品| 亚洲三级理论片| 韩国av一区二区| 欧美欧美欧美欧美| 亚洲日本在线观看| 国产成人精品影视| 日韩情涩欧美日韩视频| 亚洲国产成人av网| 91丨九色丨黑人外教| 2019国产精品| 日本在线不卡一区| 欧美日韩情趣电影| 亚洲卡通动漫在线| www.性欧美| 日本一区二区三区高清不卡| 久久99精品国产.久久久久 | 久久精品视频在线看| 亚洲成人在线免费| 在线免费观看日本欧美| 中文幕一区二区三区久久蜜桃| 秋霞影院一区二区| 欧美日韩国产123区| 亚洲在线中文字幕| 色素色在线综合| 亚洲精品欧美综合四区| 成年人国产精品| 久久久久国产精品人| 国产一区二区在线影院| 精品剧情在线观看| 麻豆视频观看网址久久| 日韩视频免费直播| 日本中文字幕一区| 日韩一区二区三区在线观看| 日韩av不卡一区二区| 5858s免费视频成人| 99re6这里只有精品视频在线观看| 久久麻豆一区二区| 国产在线视视频有精品| 久久中文娱乐网| 国产成人精品一区二区三区四区| 久久久久久久电影| 成人午夜av影视| 国产精品久久国产精麻豆99网站| 成人永久免费视频| 亚洲欧洲av色图| 色国产综合视频| 亚洲大片精品永久免费| 欧美一区二区三区免费视频| 久久精品国产久精国产| 久久久久久99久久久精品网站| 国产精品一区二区久激情瑜伽| 欧美成人一区二区| 国产精品主播直播| 国产精品免费视频一区| 91丨porny丨在线| 亚洲二区在线观看| 91精品国产欧美一区二区18| 久久精品国产99久久6| 国产欧美一区二区精品性色超碰 | 久久久精品国产99久久精品芒果| 精品一区二区三区的国产在线播放| 精品成人a区在线观看| 国产超碰在线一区| 亚洲欧美国产77777| 欧美高清激情brazzers| 久久精工是国产品牌吗| 中文字幕国产一区| 欧美午夜一区二区三区| 久久99久久99| 欧美国产日韩一二三区| 在线欧美日韩精品| 久久成人免费日本黄色| 国产精品传媒在线| 欧美精品高清视频| 国产福利电影一区二区三区| 亚洲免费成人av| 91精品一区二区三区久久久久久 | 久久久九九九九| 99riav久久精品riav| 免费观看30秒视频久久| 欧美精彩视频一区二区三区| 欧美丝袜丝交足nylons图片| 狠狠色狠狠色综合| 亚洲一区在线免费观看| 日韩视频免费直播| 一本一本大道香蕉久在线精品| 免费在线观看成人| 国产精品国产三级国产a| 欧美一级欧美三级在线观看| 风间由美中文字幕在线看视频国产欧美| 一区二区三区四区亚洲| 精品美女在线观看| 色老汉av一区二区三区| 极品少妇一区二区| 一区二区三区蜜桃| 久久综合精品国产一区二区三区| 欧美午夜精品一区二区三区| 高清不卡在线观看| 日韩电影免费在线| 亚洲免费电影在线| 国产日韩欧美电影| 91精品国产综合久久久久久| 成人激情黄色小说| 久久66热偷产精品| 亚洲午夜三级在线| 国产欧美一区二区精品性| 555www色欧美视频| 91视视频在线观看入口直接观看www | 中文字幕va一区二区三区| 91精品国产一区二区三区蜜臀| 成人动漫一区二区在线| 韩国欧美国产一区| 天天色天天操综合| 一区二区三区精品视频在线| 国产精品久久二区二区| 久久久精品黄色| 91精品国产一区二区三区香蕉 | 国产精品久久久久久久久免费相片 | 国产一二三精品| 免费精品视频在线| 亚洲成人精品在线观看| 国产精品久久久久桃色tv| 国产亚洲一区二区在线观看| 国产一区二区毛片| 欧美日韩黄色一区二区| 亚洲成国产人片在线观看| 国产成人综合在线| 欧美一级精品在线| 日韩有码一区二区三区| 91国产丝袜在线播放| 久久在线观看免费| 国产不卡在线一区| 国产亚洲欧美中文| 国产91精品久久久久久久网曝门 | 国产精品成人午夜| 国产一区二区三区久久悠悠色av |