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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? ppp.c

?? PPP協(xié)議C語言源代碼
?? C
?? 第 1 頁 / 共 5 頁
字號(hào):
        if (netp->hw.opt3 == 3) {
            if (netp->hw.locopts & COMPpcmp && cc & 1) {
                PH(netp->bufbas)->MACtype |= 1;
               /* Adjust possible addr/cntl fields */
                *netp->hw.bufin = *(netp->hw.bufin - 1);
                *(netp->hw.bufin - 1) = *(netp->hw.bufin - 2);
                netp->hw.bufin++;
                netp->hw.opt3++;
            }
        }
#endif
    }
#if MP
    if (netp->hw.opt3 == 4) {
        netp->hw.opt3++;
       /*
        ** The Multilink Protocol header requires extra space at the
        ** start of the frame in order to avoid having to move the
        ** whole packet before passing it up to the network layer.
        ** Here we can quickly move three bytes, change a pointer and an
        ** offset instead.
        */
        if (netp->hw.opt5 & MPmrru && cc == PROTmp) {
            char *cp;
            if (netp->hw.opt5 & MPsnhf) {
                PH(netp->bufbas)->poffset -= 4;
                cp = netp->hw.bufin - 4;
            }
            else {
                PH(netp->bufbas)->poffset -= 6;
                cp = netp->hw.bufin - 6;
            }

           /*
            ** If the peer is using protocol compression, we skip the unused
            ** bytes for the network protocol (in the fragment).
            */
            if (PH(netp->bufbas)->MACtype & 1) {
                PH(netp->bufbas)->poffset++;
                cp++;
            }
            *--cp = *--netp->hw.bufin;
            *--cp = *--netp->hw.bufin;
            *--cp = *--netp->hw.bufin;
            netp->hw.bufin = cp + 3;
        }
    }
#endif
    if (netp->hw.bufin == netp->hw.buflim)
        netp->hw.bufin = (char *)netp->bufbas + MESSH_SZ + LHDRSZ;
lab4:
    *netp->hw.bufin++ = cc;
    return;
}


/*
** * * * * * *
** goingc()  Character output interrupt routine
**
** static int goingc(struct NET *netp);
**
** PARAMETERS:
**   (in/out) netp             A pointer to a network structure
**
** RETURNS (not implemented):
**  -1                         Finished or error
**   char                      A character to send
**
** DESCRIPTION:
**   This function determines the next character to send out from
**   the buffer based on HDLC framing.
**
** USAGE COMMENTS:
**   This is only for use with an interrupt set up by the driver.
**
**   Flags (hwflags) tell where in the message we are:
**     0 no message, we start a new one, if none return -1
**     2 CTL_ESC inserted
**     5 end of message
**     8 message in progress
**
** * * * * * *
**
** MODIFICATION HISTORY:
**
**   18-AUG-1999  BSK  Adjust offset for Multilink frame
**   22-OCT-1998  BSK  Created comment
**
** * * * * * *
*/
static int goingc(struct NET *netp)
{
    unsigned char cc;
    MESS *mess;

    if (netp->hwflags & 7) {
        if (netp->hwflags & 2) {
            netp->hwflags -= 2;
            return netp->hw.nxtout;
        }
        if (netp->hwflags & 1) {
            netp->hwflags -= 1;
            return FLAG;
        }
        netp->hwflags = 8;
        mess = netp->bufbaso;
        if (mess->offset == netp->netno) {
            mess->offset = boTXDONE;
            if (mess->id <= bWACK) {
                if (mess->id == bRELEASE) {
                    mess->id = bALLOC;
                    NrelbufIR(mess);
                }
            }
            else
            {
                WAITNOMORE_IR(SIG_WN(netp->netno));
            }
        }
    }
    if (netp->hw.chsout == 0) {
nxt:
        if (QUEUE_EMPTY(netp, depart)) {
            netp->hwflags = 0;
            return -1;
        }
        QUEUE_OUT(netp, depart, mess);
        if (mess->offset != netp->netno)
            goto nxt;
        netp->hwflags = 8;
        netp->bufbaso = mess;
       /* Point to start of PPP frame */
        netp->hw.bufout = (char *)mess + PH(mess)->poffset;
       /* Message length (plus 2 for checksum) */
        netp->hw.chsout = mess->mlen - PH(mess)->poffset + 2;
        return FLAG;
    }
    if (--netp->hw.chsout == 0)
        netp->hwflags = 0xd;
    cc = *netp->hw.bufout++;


   /*
    ** For asynchronous links, ASCII control characters take form
    ** CTL_ESC, cc+0x20 unless the other host has turned this off.
    ** Bit n zero in netp->hw.ul1 means that ASCII value n can be
    ** sent directly.  Direct binary values are only sent when the
    ** link is established.
    */
    if (cc < 0x20)
        if (netp->state != LCPopen || ((netp->hw.ul1 >> cc) & 1))
            goto lab8;
    if (cc == FLAG || cc == CTL_ESC) {
lab8:
        netp->hw.nxtout = cc ^ 0x20;
        netp->hwflags |= 2;
        cc = CTL_ESC;
    }
    return cc;
}


/*
** * * * * * *
** screen()  Screen a message from the network.
**
** static int screen(MESS *mess);
**
** PARAMETERS:
**   (in/out) mess             A pointer to a buffer to screen
**
** RETURNS:
**  -4                         Do not delete buffer
**  -3                         Call write
**  -2                         No further action
**  -1                         Error occured
**   n                         Enter in queue number n
**
** DESCRIPTION:
**   This function takes in a buffer and filters it up the stack if
**   necessary or deals with PPP-oriented frames.
**
** * * * * * *
*/
static int screen(MESS *mess)
{
    int i1, i2, i3, netno, naklen, rejlen;
    unsigned short protocol, us1, us2;
    unsigned char prevstate, *cp, *cp2, *cp3, *cp4;
    unsigned long ul1;
    MESS *mp;
    struct NET *netp;

    netno = mess->netno;    /* Get the net number from message buf */
    netp = &nets[netno];    /* Point to proper network connection */

    mess->netno = netno;
    mess->conno = 0;        /* bcast indicator */

#ifdef MIB2
    netp->ifInOctets += mess->mlen - MESSH_SZ - LHDRSZ;
    netp->ifInUcastPkts++;
#endif

    cp = (unsigned char *)mess + PH(mess)->poffset;

   /*
    ** Check the async framing:
    ** - address and control,
    ** - protocol,
    ** - checksum.
    */
    if (netp->ifType == 23) {
        cp2 = cp;
        i3 = 0;
#if COMPRESSION & 1
        if ((PH(mess)->MACtype & 2) == 0)
#endif
        {
            if (cp2[0] != 0xff || cp2[1] != 0x03)
                i3++;
            cp2 += 2;
        }

#if COMPRESSION & 1
        if (PH(mess)->MACtype & 1) {
            if ((*cp2 & 1) != 1)
                i3++;
#ifdef LITTLE
            protocol = *cp2++ << 8;
#else
            protocol = *cp2++;
#endif
        }
        else
#endif
        {
            if (*cp2 & 1 || (cp2[1] & 1) == 0)
                i3++;
            protocol = *(short *)cp2;
            cp2 += 2;
        }

       /* If we couldn't get the address/control or protocol fields, error */
        if (i3)
            goto rej1;

        us1 = 0xffff;
        i1 = mess->mlen - (cp - (unsigned char *)mess);
        while (i1--)
            us1 = (us1 >> 8) ^ fcstab[(us1 ^ *cp++) & 0xff];
        us1 ^= 0xffff;
        us2 = ((unsigned short)cp[1] << 8) | cp[0];
        if (us1 != us2)
            goto rej1;
    }
    else
        protocol = PH(mess)->protocol;

#ifdef LQRP
    netp->InGoodOctets += mess->mlen - MESSH_SZ - LHDRSZ;
#endif

    prevstate = netp->state;        /* Previous state of PPP */
    if (prevstate == PPPhold) {     /* If holding for user action */
#if NTRACE >= 5
        Nprintf("PPP: State holding, packet ignored\n");
#endif
        return -2;                  /*  do nothing */
    }


#if MP
   /* Get PPP frame out of MP fragment */
    if (protocol == NC2(PROTmp)) {
        if ((prevstate & LCPopen) != LCPopen)
            goto rej1;
       /* Point to data after address/control and protocol */
        mess->offset = cp2 - (unsigned char *)mess;
        protocol = mpScreen(mess);
        if (protocol == (unsigned short)(int)-1)
            goto rej1;
        if (protocol == 0)
            return -2;
    }
#endif


   /* Handle network layer traffic first */
    mess->offset = MESSH_SZ + LHDRSZ;   /* Network data is always here */

    if (prevstate == PPPopen) {
        if (protocol == NC2(PROTip)) {
#if VJ
ipprot:
#endif
#if IDLE_TOUT
            netp->hw.idle_time = TimeMS();  /* Link still active */
#endif
            i1 = ussIPTable.screen(mess);
            if (i1 == -3)
                writE(mess->confix, mess);
            return i1;
        }
#if VJ
        else if (protocol == NC2(PROTcomp) || protocol == NC2(PROTuncomp)) {
            i1 = vjScreen(mess, protocol);
            if (i1 < 0)
                goto rej1;                  /* Reject unhandled message */
            goto ipprot;
        }
#endif
#if defined(LQRP) && QUALITY == PROTlqp
        else if (protocol == NC2(PROTlqp)) {
            i1 = ussLQRPTable.screen(mess);
            if (i1 == -3)
                writE(mess->confix, mess);
            return i1;
        }
#endif
    }

   /* Handle PPP traffic next */

#if NTRACE > 2 && PPP_DEBUG
    pppDebug(1, mess);
#endif

   /* Set up helpful pointers and other values for LCP, Auth and IPCP */

    cp = (unsigned char *)mess + mess->offset;  /* Point to PPP info. */
    us1 = cp[0];                                /* code */
    us2 = cp[1];                                /* identifier */
    i1 = ((int)cp[2] << 8) + cp[3] - 4;         /* length */
    cp2 = cp + 4;                               /* Point to data */
    naklen = rejlen = 0;                        /* No nak/rej yet */

    if (protocol == NC2(PROTlcp)) {
        if (prevstate == PPPclsng && us1 != LCPterm_req && us1 != LCPterm_ack)
            goto rej1;

        switch (us1) {
        case LCPconf_req:
            if ((prevstate & LCPopen) == LCPopen || prevstate == PPPclsd)
                pppStart(netno, 0);         /* tld, restart LCP */
            *cp = LCPconf_ack;              /* set code to ACK (2) */
            i2 = 0;                         /* Check for authentication */
            for (; i1 > 0; cp2 += us2) {    /* Cycle through options */
                us1 = cp2[0];               /* point to option code */
                us2 = cp2[1];               /* length of option request */
                if (us2 < 2)                /* length must be >= 2 */
                    break;
                i1 -= us2;
                switch (us1) {
                case LCPopt_RES0:
                    goto rej3;
                case LCPopt_MRU:
#if MP
                case LCPopt_MRRU:
#endif
                    us1 = ((unsigned short)cp2[2] << 8) + cp2[3];
                    if (us1 <= MAXBUF - MESSH_SZ - LHDRSZ && us1 > 0)
                        netp->maxblo = us1;
                    else {
                        cp2[2] = netp->maxblo >> 8;
                        cp2[3] = netp->maxblo;
nak1:
                        Nmemcpy((char *)mess + 200 + naklen, cp2, us2);
                        naklen += us2;
                    }
                    break;
                case LCPopt_ASYC:
                    netp->hw.ul1 = cp2[2] << 24 +
                                   cp2[3] << 16 +
                                   cp2[4] << 8 +
                                   cp2[5];
                    break;
                case LCPopt_AUTH:
#if AUTHENT & 1
                    if (cp2[2] == 0xc0 && cp2[3] == 0x23)
                        netp->hw.opt4 |= AUTHppap;
#endif
#if AUTHENT & 6
                    if (cp2[2] == 0xc2 && cp2[3] == 0x23) {
#if AUTHENT & 4
                        if (cp2[4] == CHAPalg_MD4)
                            netp->hw.opt4 |= AUTHpmsc;
#endif
#if AUTHENT & 2
                        if (cp2[4] == CHAPalg_MD5)
                            netp->hw.opt4 |= AUTHpchp;
#endif
                    }
#endif
                    if ((netp->hw.opt4 & 7) == 0) {
#if AUTHENT & 1
                       /* If authentication isn't supported, suggest PAP */
                        cp2[1] = 4, cp2[2] = 0xc0, cp2[3] = 0x23;
                        us2 = 4;
                        goto nak1;
#else
                        goto rej3;

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲一区二区三区四区五区黄| 精品三级在线看| 国产精品88888| 麻豆精品一二三| 99久久伊人精品| 成人av电影在线网| 91在线视频免费观看| 99re视频这里只有精品| 色婷婷综合久色| 欧美日韩在线电影| 日韩一级免费观看| 精品国产凹凸成av人网站| 久久久久久黄色| 国产精品久久久久国产精品日日| 亚洲欧美另类在线| 日本网站在线观看一区二区三区| 麻豆成人久久精品二区三区小说| 国产乱子伦视频一区二区三区| 国产盗摄一区二区| 色综合中文综合网| 欧美日韩精品一区二区三区| 欧美日韩在线三级| 精品久久久网站| 中文字幕日本不卡| 亚洲va欧美va人人爽| 麻豆精品在线视频| 9色porny自拍视频一区二区| 欧美性受极品xxxx喷水| 日韩精品影音先锋| 亚洲人快播电影网| 麻豆国产精品视频| 91理论电影在线观看| 欧美高清dvd| 国产欧美日韩精品在线| 亚洲在线一区二区三区| 国产一区二区三区四 | 亚洲欧美韩国综合色| 午夜激情久久久| 成人精品在线视频观看| 欧美一区二区在线不卡| 亚洲欧美日韩综合aⅴ视频| 久久99久久99| 欧美在线|欧美| 国产欧美日韩激情| 免费在线视频一区| 91蝌蚪porny九色| 久久这里都是精品| 日本三级亚洲精品| 色欧美日韩亚洲| 国产欧美视频一区二区三区| 石原莉奈一区二区三区在线观看| 成人h版在线观看| 精品国产污污免费网站入口 | 亚洲欧洲性图库| 精品亚洲porn| 4438x成人网最大色成网站| 日韩成人免费电影| 99久久综合国产精品| 久久久美女艺术照精彩视频福利播放| 亚洲国产裸拍裸体视频在线观看乱了 | 久久www免费人成看片高清| 日本精品一级二级| 国产农村妇女毛片精品久久麻豆| 免费成人结看片| 欧美一区二区日韩一区二区| 一区二区三区国产精品| 成人h动漫精品一区二区| 精品噜噜噜噜久久久久久久久试看| 91女厕偷拍女厕偷拍高清| 成人免费毛片aaaaa**| 欧美成人video| 久久疯狂做爰流白浆xx| 宅男在线国产精品| 七七婷婷婷婷精品国产| 欧美男生操女生| 美女爽到高潮91| 日韩精品专区在线影院观看| 久久99精品久久久久久国产越南| 日韩免费观看高清完整版在线观看| 蜜臀av性久久久久蜜臀av麻豆| 欧美精品日韩精品| 美女视频免费一区| 久久综合精品国产一区二区三区 | 自拍av一区二区三区| 99久久er热在这里只有精品15| 亚洲特黄一级片| 在线中文字幕一区| 午夜精品久久久久久久久久久| 91精品国产综合久久福利软件 | 成人自拍视频在线观看| 国产精品大尺度| 一本大道久久精品懂色aⅴ | 国产制服丝袜一区| 国产精品天美传媒沈樵| 色久优优欧美色久优优| 视频一区欧美日韩| 久久久久久久精| 在线视频你懂得一区| 日本在线播放一区二区三区| 久久久久久久免费视频了| av在线不卡电影| 亚洲午夜精品一区二区三区他趣| 91精品国产免费久久综合| 国产在线精品视频| 亚洲男人天堂av网| 精品国产91九色蝌蚪| 97国产一区二区| 精品一区二区免费| 亚洲一区二区av在线| 久久综合色婷婷| 欧美亚洲禁片免费| 国产成人亚洲综合a∨猫咪| 一区二区视频在线| 亚洲欧美日韩小说| 精品999久久久| 欧美亚洲另类激情小说| 国产精品18久久久久久久久久久久| 亚洲欧美一区二区三区孕妇| 欧美videos大乳护士334| 色婷婷亚洲一区二区三区| 久久国产福利国产秒拍| 亚洲最大成人网4388xx| 久久久99精品久久| 日韩一区二区影院| 欧美私人免费视频| aa级大片欧美| 岛国精品在线观看| 精品一区二区三区视频| 亚洲成人动漫在线免费观看| 国产精品视频一区二区三区不卡| 日韩美女主播在线视频一区二区三区| 91啪在线观看| 91在线播放网址| 成人国产精品免费| 国产麻豆成人传媒免费观看| 日韩成人精品视频| 亚洲va在线va天堂| 亚洲激情中文1区| 亚洲美女区一区| 中文字幕亚洲欧美在线不卡| 久久精品免费在线观看| 精品免费99久久| 久久久久久夜精品精品免费| 精品日本一线二线三线不卡| 日韩午夜在线观看视频| 91精品午夜视频| 欧美一区二区三区喷汁尤物| 91精品国产91综合久久蜜臀| 91精品国产品国语在线不卡| 欧美日韩黄色一区二区| 欧美日韩一级黄| 欧美日韩精品久久久| 在线播放日韩导航| 欧美日韩另类国产亚洲欧美一级| 欧美自拍丝袜亚洲| 4438成人网| 2024国产精品视频| 国产网红主播福利一区二区| 国产亚洲精品免费| 国产精品看片你懂得 | 欧美精品乱码久久久久久按摩| 欧美色爱综合网| 日韩三级视频在线观看| 久久午夜电影网| 欧美极品aⅴ影院| 亚洲激情中文1区| 日本欧美久久久久免费播放网| 美女被吸乳得到大胸91| 国产成人在线网站| 色综合久久综合网| 91精品国产欧美一区二区18| 久久亚洲综合色一区二区三区| 中文字幕免费不卡| 亚洲国产视频在线| 久久机这里只有精品| 成人精品免费网站| 欧美三级电影网| 久久精品一区二区三区不卡| 亚洲欧美另类在线| 六月丁香综合在线视频| k8久久久一区二区三区| 欧美性猛交xxxx乱大交退制版| 欧美va亚洲va国产综合| 亚洲人成7777| 九九视频精品免费| 91久久国产综合久久| 精品国精品自拍自在线| 亚洲精品日日夜夜| 色综合网色综合| 日韩一区二区在线播放| 中文字幕一区在线| 激情综合网av| 欧美在线free| 中文字幕在线观看一区| 日本最新不卡在线| 在线精品视频一区二区三四| 久久久精品天堂| 日本欧美加勒比视频| 在线看日本不卡| 国产精品色婷婷|