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

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

?? ppp.c

?? PPP協議C語言源代碼
?? C
?? 第 1 頁 / 共 5 頁
字號:
                return 0;
           /* If in/out failed or down done */
            else if (prevstate == -1 || IS_MODEM_DIALDOWN(netp)) {
                if (IS_MODEM_DIALOUT(netp)) {
                    PPPSIG_DIALOUT_DOWN(netno);
                }
                else if (IS_MODEM_DIALIN(netp)) {
                    PPPSIG_DIALIN_DOWN(netno);
                }
                else if (prevstate == -1) {
                    PPPSIG_DIALDOWN_DOWN(netno);
                }
                else {
                    PPPSIG_DIALDOWN_UP(netno);
                }
                WAITNOMORE(SIG_WN(netno));
                MODEM_DIALIN(netno);
                PPPSIG_PPP_DOWN(netno);
                return -1;
            }
           /* If success and active */
            else if (IS_MODEM_DIALOUT(netp)) {
                PPPSIG_DIALOUT_UP(netno);
                pppForceUp(netno);
            }
            else {
                PPPSIG_DIALIN_UP(netno);
#if IDLE_TOUT
               /* If success and passive */
                netp->hw.idle_time = TimeMS();
#endif
            }
        }
#if IDLE_TOUT
       /* If remote dialed in without starting PPP, hangup after timeout. */
        else if ((netconf[netp->confix].flags & DIAL) && IS_MODEM_DIALIN(netp)) {
            if (((TimeMS()-netp->hw.idle_time)>>10) > IDLE_TOUT)
                goto term;
        }
#endif
        else
            return -1;
        return 0;
#else
        return -1;
#endif
    }

   /* Check for a timeout. */
    prevstate = netp->state;
    ul2 = TOUTMS;
#if TOUT_GROW
    ul2 >>= (netp->hw.opt7/2);
#endif
    if ((ul1 - netp->hw.timems) > ul2) {
        if (netp->state == PPPclsng) {
            if (netp->hw.opt7 <= 0) {
#if NTRACE >= 3
                Nprintf("PPP: Terminate counter expired\n");
                Nprintf("PPP: Link closed\n");
#endif
                netp->state = PPPclsd;
                pppDQ(netno);
                PPPSIG_LCP_DOWN(netno);
#if DIALD
                if ((netconf[netp->confix].flags & DIAL) == 0)
#endif
                {
                    PPPSIG_PPP_DOWN(netno);
                }

                pppForceDown(netno);
                return -1;
            }
        }
        else if (netp->hw.opt7 <= 0) {
#if NTRACE >= 3
            Nprintf("PPP: Restart counter expired\n");
#endif
term:
            pppForceDown(netno);
        }
        else if ((netp->state & LCPopen) != LCPopen)
            netp->state &= ~(LCPtxREQ | LCPrxACK);
        else if (netp->hw.opt4 & AUTHhini)
            netp->hw.opt4 &= ~AUTHwait;
        else if ((netp->state & IPCPopen) != IPCPopen)
            netp->state &= ~(IPCPtxREQ | IPCPrxACK);

       /* If we can't get a buffer, make timeouts work normally */
        if ((mess = Ngetbuf()) == 0) {
            netp->state = prevstate;
            return 0;
        }
        netp->hw.timems = ul1;
        mess->netno = netno;
        pppNegotiate(mess);
        mess->id = bALLOC;
        Nrelbuf(mess);
    }

    return 0;   /* Link/modem working */
}


/*
** * * * * * *
** writE()  External/Internal function to write out a frame
**
** static int writE(int conno, MESS *mess);
**
** PARAMETERS:
**  (in) conno                 A yfnet connection number
**  (in/out) mess              A pointer to a buffer to write out
**
** RETURNS:
** -1                          Cannot queue packet or driver error
**  0                          Frame taken care of (queued)
**  1                          Frame sent immediately
**
** DESCRIPTION:
**  This function will frame and write a buffer.
**
** * * * * * *
*/
static int writE(int conno, MESS *mess)
{
    int i1, netno;
    unsigned short us1, protoc;
    unsigned char *cp;
    struct NET *netp;
#if VJ
    MESS *mp2;
#endif

    netno = mess->netno;
    netp = &nets[netno];

    (void) conno;

   /*
    ** If PPP is not Open:
    **      Queue datagram (if configured)
    **      Force link open
    */
    if (netp->state != PPPopen) {
#if DBUFFER
        if (!QUEUE_FULL(netp, future) && netp->hw.opt8 < DBUFFER_SZ) {
            netp->hw.opt8++;
            mess->conno = conno;
            QUEUE_IN(netp, future, mess);
#if NTRACE >= 5
            Nprintf("PPP: Datagram queued for con %d\n", conno);
#endif
        }
        else {
#if NTRACE
            Nprintf("PPP: Queue full, datagram dropped on con %d!\n", conno);
#endif
            mess->offset = boTXDONE;    /* "Send" the packet */
        }
#endif
        pppForceUp(netno);
        YIELD();
#if MP
       /* Find the next companion link to open for Multilink */
        if (netp->hw.opt5 & MPmrru)
            while (++netno < NNETS)
                if (nets[netno].netstat &&
                    nets[netno].hw.opt5 & MPmrru &&
                    strcmp(netconf[netp->confix].pname,
                           netconf[nets[netno].confix].pname) == 0)
                {
                    netconf[nets[netno].confix].Iaddr.l =
                            netconf[netp->confix].Iaddr.l;
                    nets[netno].haddr.l = netp->haddr.l;
                    nets[netno].raddr.l = netp->raddr.l;
                    pppForceUp(netno);
                    YIELD();
                }
#endif
#if DBUFFER
        if (mess->offset == boTXDONE)   /* Sent immediately */
            return 1;
        return 0;                       /* Queued in--not sent yet */
#else
        mess->offset = boTXDONE;
        return 1;
#endif
    }


   /*
    ** Here is the normal link layer write
    **      Update idle link time (if configured)
    **      Compress TCP/IP header (if configured)
    **      Create the PPP frame
    **          Add protocol (compressed or uncompressed)
    **          Encapsulate in Multilink frame (if configured)
    **          Add address/control for AHDLC (if not compressed)
    **          Create checksum and append it to the frame
    **      Transmit frame
    */
#if IDLE_TOUT
    netp->hw.idle_time = TimeMS();
#endif

   /* Call TCP/IP header compression if wanted. */
    if ((protoc = PH(mess)->protocol) == NC2(0x0800)) {
        protoc = NC2(PROTip);
#if VJ
        if (TXslots[netno]) {
            protoc = vjWrite(mess, &mp2);
            if (protoc == NC2(PROTcomp))
                mess = mp2;
        }
#endif
    }


   /* Point to PPP information field */
    cp = (unsigned char *)mess + MESSH_SZ + LHDRSZ;

    PH(mess)->MACtype = 0;  /* No compression (yet) for WRAP driver */


   /* Store protocol code */
    *--cp = ((char *)&protoc)[1];
#if (COMPRESSION & 1) == 0
    *--cp = *((char *)&protoc);
#else
    if (netp->hw.remopts & COMPpcmp && *(char *)&protoc == 0) {
        *(cp - 1) = 0;
        PH(mess)->MACtype |= 1; /* For WRAP driver */
    }
    else
        *--cp = *((char *)&protoc);
#endif


#if MP
   /* For multilink protocol, store MP header and get transmit link number */
    if (netp->hw.opt5 & MPmrru) {
        mess->netno = mpWrite(netno, &cp);
        netp = &nets[mess->netno];
#if COMPRESSION & 1
        if (netp->hw.remopts & COMPpcmp)
            PH(mess)->MACtype |= 1;
#endif
    }
#endif


   /* Create async framing */
    if (netp->ifType == 23) {
#if COMPRESSION & 1
        if (netp->hw.remopts & COMPacmp)
            PH(mess)->MACtype |= 2; /* For WRAP driver */
        else
#endif
        {
            *--cp = 0x03;   /* Control */
            *--cp = 0xff;   /* Address */
        }

       /* Set driver offset */
        PH(mess)->poffset = cp - (unsigned char *)mess;
        i1 = mess->mlen - PH(mess)->poffset;

       /* Calculate and append AHDLC checksum */
        us1 = 0xffff;
        while (i1--)
            us1 = (us1 >> 8) ^ fcstab[(us1 ^ *cp++) & 0xff];
        us1 ^= 0xffff;
        *cp++ = us1;
        *cp = us1 >> 8;
    }

#ifdef MIB2
    netp->ifOutOctets += mess->mlen - PH(mess)->poffset + 2;
    netp->ifOutUcastPkts++;
#endif

    us1 = mess->id;

   /* Write out the packet by calling the driver */
    i1 = netp->protoc[1]->writE(netno, mess);
    if (i1 != 0 || us1 <= bWACK)
        return i1;

    WAITFOR(mess->offset == boTXDONE, SIG_WN(netno), netp->tout, i1);
    return 1;
}


/*
** * * * * * *
** comec()  Character input interrupt routine
**
** static void comec(int cc, struct NET *netp);
**
** PARAMETERS:
**  (in) cc                     A character to input
**  (in/out) netp               A pointer to a network structure
**
** RETURNS (not implemented):
**  0                           Character processed (do nothing)
**  1                           Enable host driver transmit interrupt
** -1                           Transmit XOFF
**
** DESCRIPTION:
**  This function takes in a HDLC framed character and maps it to a
**  data entity in the in buffer.
**
** * * * * * *
*/
static void comec(int cc, struct NET *netp)
{
    MESS *mess;

   /* If first octet in */
    if (netp->hw.bufin == 0) {
       /* FLAG (0x7e) should always begin and end a PPP HDLC frame */
        if (cc != FLAG && netp->hw.lastin != FLAG)
            return;

       /* Make buffer to put data from network */
        if ((netp->bufbas = NgetbufIR()) == 0)
            return;
       /* netp->hw.bufin = (char *)&PH(netp->bufbas)->flag; */
        netp->hw.bufin = (char *)netp->bufbas + MESSH_SZ + HOFF;
        netp->hw.buflim = (char *)netp->bufbas + MAXBUF;
        mess = netp->bufbas;
        PH(mess)->MACtype = 0;
        PH(mess)->poffset = MESSH_SZ + HOFF + 1;    /* After flag */
        netp->hw.opt3 = 0;              /* Start of frame */
        if (cc == FLAG)                 /* First character should be 0x7e */
            goto lab4;
        *netp->hw.bufin++ = FLAG;       /* lastin was flag so now use it */
    }

    if (netp->hw.lastin == CTL_ESC) {   /* Current character is escaped */
        cc ^= 0x20;                     /* Decode character */
        netp->hw.lastin = 0;
        goto lab3;
    }

    netp->hw.lastin = cc;
    if (cc == CTL_ESC)                  /* Next character is data */
        return;

    if (cc == FLAG) {                   /* End of frame flag found */
        mess = netp->bufbas;
        mess->mlen = netp->hw.bufin - (char *)mess - 2;
        mess->netno = netp->netno;

       /* If message size is less than header, an error must have occured */
        if (mess->mlen <= MESSH_SZ + LHDRSZ) {
           /* Flag must have signaled beginning of frame, not end */
            netp->hw.bufin = (char *)netp->bufbas + MESSH_SZ + HOFF;
            goto lab4;
        }

        if (QUEUE_FULL(netp, arrive))
            NrelbufIR(mess);
        else {
            PH(mess)->poffset += PH(mess)->MACtype;
            QUEUE_IN(netp, arrive, mess);
        }
        WAITNOMORE_IR(SIG_RN(netp->netno));
        netp->hw.bufin = 0;
        return;
    }

lab3:
   /*
    ** Check only the first three characters for addr/ctl and protocol.
    ** If there are any problems, let screen() take care of them.
    */
    if (netp->hw.opt3 < 4) {
        netp->hw.opt3++;

#if COMPRESSION & 1
       /*
        ** If first byte in is not the address and address/control
        ** compression is enabled, make a note of it and go on.  Tell the
        ** portion of code that looks for the protocol field that it is here
        ** (opt3 == 3).
        */
        if (netp->hw.locopts & COMPacmp &&
            cc != 0xff &&
            netp->hw.opt3 == 1)
        {
            PH(netp->bufbas)->MACtype |= 2; /* Addr/Cntl field compressed */
            netp->hw.bufin += 2;            /* Skip reading them */
            netp->hw.opt3 = 3;
        }

       /*
        ** If the third byte is here and is the lower byte of a protocol
        ** code and protocol compression is enabled, make a note that the
        ** protocol was copmressed.
        */

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
99re亚洲国产精品| 欧美精品第1页| 欧美精品v国产精品v日韩精品| 精品国产免费一区二区三区四区| 日韩一区在线免费观看| 精品一二线国产| 欧美专区亚洲专区| 国产精品久久久久毛片软件| 麻豆极品一区二区三区| 日本乱码高清不卡字幕| 国产精品欧美一区喷水| 蜜桃视频一区二区三区在线观看 | 91在线视频网址| 欧美一区二区三区精品| 亚洲香蕉伊在人在线观| 99久久久久久| 国产精品免费丝袜| 国产91高潮流白浆在线麻豆| 精品成a人在线观看| 日本不卡高清视频| 欧美人动与zoxxxx乱| 亚洲一区视频在线观看视频| 99久久综合99久久综合网站| 日本一二三四高清不卡| 国产福利视频一区二区三区| www国产成人| 国产婷婷精品av在线| 欧美成人午夜电影| 日韩一区二区在线看片| 久久精品欧美日韩精品| 精品写真视频在线观看| 精品国产免费一区二区三区香蕉| 日韩电影在线一区二区三区| 欧美高清www午色夜在线视频| 亚洲午夜久久久久久久久久久 | 国产成人夜色高潮福利影视| 精品精品国产高清a毛片牛牛| 奇米影视一区二区三区| 欧美大片在线观看一区二区| 韩国女主播一区| 久久久久久久久久久电影| 国产成人免费在线视频| 国产精品不卡一区二区三区| av中文字幕不卡| 夜夜嗨av一区二区三区网页| 欧美一区二区福利在线| thepron国产精品| 99v久久综合狠狠综合久久| 国产精品国产三级国产aⅴ无密码 国产精品国产三级国产aⅴ原创 | 欧美草草影院在线视频| 国产综合一区二区| 国产精品免费看片| 在线影视一区二区三区| 日产欧产美韩系列久久99| 欧美va在线播放| av男人天堂一区| 亚洲国产欧美一区二区三区丁香婷| 精品视频123区在线观看| 麻豆91在线播放| 中文字幕一区二区三区av| 日本二三区不卡| 另类小说欧美激情| 亚洲图片激情小说| 欧美性淫爽ww久久久久无| 欧美精品一区二区在线播放| 五月天国产精品| 国产免费久久精品| 欧美亚洲禁片免费| 麻豆成人免费电影| 亚洲精品国产成人久久av盗摄 | 午夜精品久久久久久久| 久久色中文字幕| 一本久久a久久免费精品不卡| 日韩精品电影一区亚洲| 中文字幕免费一区| 777色狠狠一区二区三区| 国产成人亚洲综合a∨猫咪| 伊人婷婷欧美激情| 久久久久久久性| 欧美日韩一区二区三区四区五区| 国产曰批免费观看久久久| 一区二区三区不卡视频在线观看| 欧美成人video| 精品视频123区在线观看| 粉嫩一区二区三区在线看| 五月激情综合色| 依依成人综合视频| 国产午夜精品久久久久久久 | 亚洲第一成人在线| 欧美高清在线一区二区| 欧美一级欧美三级在线观看| 成人av电影在线| 国产一区二区在线影院| 天堂一区二区在线免费观看| 中文字幕一区二区在线播放| 欧美v亚洲v综合ⅴ国产v| 欧美久久久久久久久久| 在线亚洲精品福利网址导航| 国产精品12区| 国产综合一区二区| 奇米888四色在线精品| 亚洲第一狼人社区| 一区二区三区精品视频| 国产欧美日本一区视频| 精品久久久久av影院| 91.com在线观看| 91麻豆精品久久久久蜜臀| 欧美图区在线视频| 91久久香蕉国产日韩欧美9色| 91美女在线视频| 99精品视频中文字幕| 97久久超碰国产精品| aa级大片欧美| 91亚洲精品久久久蜜桃网站| 99久久国产综合精品色伊| av在线综合网| 91蜜桃传媒精品久久久一区二区| 99久久婷婷国产综合精品电影 | 久久黄色级2电影| 大陆成人av片| 欧美日韩一区二区不卡| 国产一区二区三区精品欧美日韩一区二区三区 | 亚洲欧美日本韩国| 一区二区在线观看视频在线观看| 日本一区二区三区四区| 国产精品五月天| 亚洲天堂精品视频| 亚洲在线视频免费观看| 亚洲va欧美va人人爽| 日本视频在线一区| 国产麻豆成人传媒免费观看| 国产成人免费视频网站高清观看视频| 国产高清精品网站| jlzzjlzz亚洲日本少妇| 91视频免费看| 69精品人人人人| 欧美三区在线观看| 精品国产凹凸成av人导航| 欧美白人最猛性xxxxx69交| 91精品国产综合久久久久久 | 亚洲三级在线免费| 亚洲图片欧美综合| 韩国毛片一区二区三区| 99视频有精品| 欧美极品少妇xxxxⅹ高跟鞋 | 成人天堂资源www在线| 91亚洲国产成人精品一区二区三| 在线观看亚洲专区| 26uuu欧美| 亚洲精品乱码久久久久久| 久久精品免费观看| 99久久99久久精品免费观看| 欧美理论片在线| 久久综合久久综合久久| 一个色综合av| 麻豆一区二区三| 91麻豆国产福利精品| 欧美大片免费久久精品三p| 久久免费精品国产久精品久久久久| 一区二区高清免费观看影视大全 | 亚洲精品国产品国语在线app| 三级久久三级久久久| 大尺度一区二区| 欧美日韩国产高清一区二区三区| 精品国产自在久精品国产| 亚洲综合小说图片| 国产丶欧美丶日本不卡视频| 欧美日韩二区三区| 亚洲欧洲日韩一区二区三区| 美国一区二区三区在线播放| 日本道精品一区二区三区 | 7777女厕盗摄久久久| 中文字幕日本乱码精品影院| 裸体健美xxxx欧美裸体表演| 在线一区二区三区做爰视频网站| 26uuu精品一区二区三区四区在线| 亚洲国产aⅴ天堂久久| 不卡影院免费观看| 久久久一区二区三区| 日韩精品乱码免费| 欧美少妇xxx| 亚洲欧美成人一区二区三区| 中文字幕中文字幕一区二区 | 中文文精品字幕一区二区| 五月激情综合婷婷| 欧美性猛交一区二区三区精品| 亚洲精品乱码久久久久久| 国产精品一区久久久久| 日韩欧美黄色影院| 免费在线观看视频一区| 欧美福利一区二区| 亚洲成人一区在线| 欧美女孩性生活视频| 亚洲午夜久久久久久久久久久| 色噜噜狠狠一区二区三区果冻| 日韩美女啊v在线免费观看| www.欧美亚洲| 成人欧美一区二区三区视频网页| 成人妖精视频yjsp地址| 亚洲国产精品精华液2区45|