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

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

?? ppp.c

?? PPP協議C語言源代碼
?? C
?? 第 1 頁 / 共 5 頁
字號:
                strcpy((char *)cp2+1, netp->hw.userid);
                cp2 += *cp2 + 1;
                *cp2 = (unsigned char)strlen(netp->hw.passwd);
                strcpy((char *)cp2+1, netp->hw.passwd);
                cp2 += *cp2 + 1;
                goto write;
            }
            else
#endif



#if REQAUTH == PROTchap
           /* If host requested CHAP, we send challenge */
            if (netp->hw.opt4 & (AUTHhchp|AUTHhmsc))
            {
                if (netp->hw.opt4 & AUTHhwat)
                    return;
#if AUTHENT & 1
old_chap:
#endif
                netp->hw.opt4 |= (char)AUTHhwat;
                PH(mess)->protocol = NC2(PROTchap);
                *cp = CHAPchallenge;           /* Create challenge */
                *cp2++ = 8;                         /* Length == 8 */
                netp->hw.ul2 = TimeMS();            /* Value == Time() */
                *cp2++ = strlen(netp->hw.userid);   /* Element: 0 */
                Nmemcpy((char *)cp2, (char *)&netp->hw.ul2, 4);
                cp2 += 4;                           /*          1 - 4 */
                *cp2++ = (netp->hw.ul2 >> 3);       /*          5 */
                *cp2++ = (netp->hw.ul2 >> 10);      /*          6 */
                *cp2++ = (netp->hw.ul2 >> 15);      /*          7 */
#if AUTH_ALG == CHAPalg_MD5
                strcpy((char *)cp2, netp->hw.userid);    /* Add name */
                cp2 += strlen(netp->hw.userid);
#endif
                goto write;
            }
            else
#endif




#if AUTHENT & 6 || REQAUTH == PROTpap
            if (netp->hw.opt4 & AUTHpini)
                return;
            else
#endif
            if ((netp->state & IPCPtxREQ) == 0) {
                netp->state |= IPCPtxREQ;
                netp->state &= ~IPCPrxACK;
                PH(mess)->protocol = NC2(PROTipcp);
                *cp = IPCPconf_req;
                *cp2++ = IPCPopt_IPAD;
                *cp2++ = 2 + Iid_SZ;
                Nmemcpy(cp2, netp->haddr.c, Iid_SZ);
                cp2 += Iid_SZ;
#if VJ
                if (TXslots[mess->netno]) {
                    *cp2++ = IPCPopt_IPCP;
                    *cp2++ = 6;
                    *cp2++ = 0;
                    *cp2++ = 0x2d;
                    *cp2++ = TXslots[mess->netno];
                    *cp2++ = TXixcomp[mess->netno];
                }
#endif
                goto write;
            }
        }
        else if ((netp->state & LCPtxREQ) == 0) {
            netp->state |= LCPtxREQ;
            netp->state &= ~LCPrxACK;
            PH(mess)->protocol = NC2(PROTlcp);
            *cp = LCPconf_req;

           /* Loop though possible configure options (i1 = type) */
            for (i1=0; i1 < 16; i1++) {
               /* if the option is selected, include it in conf-req */
                if (netp->hw.locopts & (1<<i1)) {
                    *cp2++ = i1;
                    switch (i1) {
                    default:
                        cp2 -= 1;   /* Not supported; Undo operation */
                        break;
#if PPP_MRU
                    case LCPopt_MRU:
                        *cp2++ = 4;
                        *cp2++ = netp->maxblo >> 8;
                        *cp2++ = netp->maxblo;
                        break;
#endif
#if ASYNC
                    case LCPopt_ASYC:
                        *cp2++ = 6;
                        Nmemcpy(cp2, (char *)&netp->hw.ul1, 4);
                        cp2 += 4;
                        break;
#endif
#if REQAUTH
                    case LCPopt_AUTH:
#if REQAUTH == PROTchap
                        *cp2++ = 5;
#else
                        *cp2++ = 4;
#endif
                        *cp2++ = (unsigned char)(REQAUTH>>8);
                        *cp2++ = (unsigned char)REQAUTH;
#if REQAUTH == PROTchap
                        *cp2++ = AUTH_ALG;
#endif
                        break;
#endif
#if defined(LQRP) && QUALITY
                    case LCPopt_LQPT:
                        *cp2++ = 8;
                        *cp2++ = QUALITY >> 8;
                        *cp2++ = QUALITY;
                        Nmemcpy(cp2, (unsigned char *)netp->peerLQRPms, 4);
                        cp2 += 4;
                        break;
#endif
#if MAGICNUM
                    case LCPopt_MNUM:
                        *cp2++ = 6;
                        netp->hw.mnum = TimeMS();
                        Nmemcpy(cp2, (char *)&netp->hw.mnum, 4);
                        cp2 += 4;
                        break;
#endif
#if COMPRESSION & 1
                    case LCPopt_PCMP:
                    case LCPopt_ACMP:
                        *cp2++ = 2;
                        break;
#endif
                    }
                }
            }
/* MP is not included in for loop because it's options are > 16 */
#if MP
            if (netp->hw.opt5 & MPmrru) {
               /* This option also initiates MP if accepted */
                *cp2++ = LCPopt_MRRU;
                *cp2++ = 4;
                *cp2++ = (MAXBUF - MESSH_SZ - LHDRSZ) >> 8;
                *cp2++ = MAXBUF - MESSH_SZ - LHDRSZ;
            }
            if (netp->hw.opt5 & MPsnhf) {
                *cp2++ = LCPopt_SNHF;
                *cp2++ = 2;
            }
            if (netp->hw.opt5 & MPendd) {
               /*
                ** The endpoint descriminator used by yfnet is the locally
                ** assigned localhostname.  To use a different class, change
                ** the following two lines to provide mpFindBundle with a new
                ** class, address length and address.  In addition, the
                ** packet must be formatted with the following:
                **
                **      one octet for the class
                **      one octet for the address length (0 to 20)
                **      the address (in 0 to 20 octets)
                **
                ** The pointer, cp2, must point to the the octet after the
                ** last octet in the packet upon completion.
                */
                i1 = (int)strlen(localhostname);
                if (mpFindBundle(mess->netno, ENDDcf_LCAS, i1, localhostname) >= 0) {
                    *cp2++ = LCPopt_ENDD;
                    *cp2++ = i1 + 3;
                    *cp2++ = ENDDcf_LCAS;
                    Nmemcpy((char *)cp2, localhostname, i1);
                    cp2 += i1;
                }
            }
#endif

write:
            cp[1] = ++netp->hw.opt1;                /* Set ID field */
            i1 = cp2 - cp;                          /* Get length */
            cp[2] = i1 >> 8, cp[3] = i1;            /* Set length field */
            netp->hw.opt7--;                        /* Restart counter-- */
            mess->mlen = i1 + MESSH_SZ + LHDRSZ;    /* Buffer tx length */
            pppWrite(mess);                         /* TX negotiation */
#if REQAUTH == PROTchap && AUTHENT & 1 && 0
/*
** This isn't included unless there is trouble when both host's are
** authenticating with the remote host using PAP and us using CHAP.
** This is very unlikely to occur.  If you notice that PAP is being
** performed to the exclusion of CHAP, preprocess this in.
*/
            if ((netp->state & LCPopen) == LCPopen &&
                    netp->hw.opt4 & (AUTHhchp|AUTHhmsc) &&
                    netp->hw.opt4 & AUTHhwat == 0)
                goto old_chap;
#endif
        }
    }
}


/*
** * * * * * *
** pppForceUP()   Bring the link up if it's down
**
** static int pppForceUp(int netno);
**
** PARAMETERS:
**   (in) netno    The yfnet network number (the interface to bring up)
**
** RETURNS:
**   1             PPP is open
**   0             PPP is working to be open
**
** DESCRIPTION:
**   Thnis function forces PPP to bring itself up rather than being
**   passive.  It enacts an active open.  Do not call if a passive open
**   is being stimulated.
**
** * * * * * *
*/
static int pppForceUp(int netno)
{
    struct NET *netp;
    MESS *mess;

    netp = &nets[netno];
    if (netp->state == PPPopen)
        return 1;   /* PPP is already up */

    if (netp->state == PPPclsd || netp->state == PPPclsng) {
#if DIALD
        if (netconf[netp->confix].flags & DIAL) {
            if (!IS_MODEM_DONE(netp) ||
                !IS_MODEM_DIALOUT(netp) ||
                netp->state == PPPclsng)
            {
                netp->state = PPPclsd;
                MODEM_DIALOUT(netno);
                YIELD();
                return 0;
            }
        }
#endif
        pppStart(netno, 1); /* Make PPP ready for starting actively */
        if ((mess = Ngetbuf()) != 0) {
            mess->netno = netno;
            pppNegotiate(mess);
            mess->id = bALLOC;
            Nrelbuf(mess);
        }
        else
            netp->state = LCPtxREQ; /* Wait for time-out to resend */

        YIELD();
    }
    return 0;   /* PPP is trying to get up */
}


/*
** * * * * * *
** pppForceDown()   Bring the link down if it's up
**
** static int pppForceDown(int netno);
**
** PARAMETERS:
**   (in) netno    The yfnet network number (the interface to bring up)
**
** RETURNS:
**   1             PPP is down
**   0             PPP is working to be down
**
** DESCRIPTION:
**   This function forces PPP to bring itself down regardless.
**
** * * * * * *
*/
static int pppForceDown(int netno)
{
    struct NET *netp;

    netp = &nets[netno];
    if (netp->state == PPPclsng)
        return 0;

    if (netp->state == PPPclsd) {
#if DIALD
        if (netconf[netp->confix].flags & DIAL) {
           /* Unless we're passively waiting, dial down */
            if (IS_MODEM_DONE(netp) || !IS_MODEM_DIALIN(netp)) {
                MODEM_DIALDOWN(netno);
                return 0;
            }
        }
        else
#endif
        {
            WAITNOMORE(SIG_WN(netno));
        }
        return 1;   /* PPP is already down or going down */
    }

   /* If the link is open, propegate a close */
#if NTRACE
    Nprintf("PPP: Closing network %d\n", netno);
#endif
    netp->state = PPPclsng;
    netp->hw.opt7 = MAXTERM;
    pppDQ(netno);

    return 0;   /* PPP is trying to get down */
}


/*
** * * * * * *
** pppTimeout()  State machine driver for PPP.
**
** int pppTimeout(int netno);
**
** PARAMETERS:
**   (in) netno                Interface index into nets structure
**
** RETURNS:
**  -1                         PPP closed
**   0                         PPP working to be open/closed
**   1                         PPP open
**
** DESCRIPTION:
**   This function drives the state machine for PPP.
**
** * * * * * *
*/
int pppTimeout(int netno)
{
    char *cp;
    unsigned long ul1, ul2;
    int prevstate;
    MESS *mess;
    struct NET *netp;

    netp = &nets[netno];
    ul1 = TimeMS();
#if ECHO_TOUTMS
   /* Send an echo-req if necessary */
    if ((netp->state & LCPopen) == LCPopen) {
        if ((ul1-netp->hw.echo_time) > ECHO_TOUTMS) {
            if (netp->hw.opt6 > ECHO_RETRIES) {
#if NTRACE >= 3
                Nprintf("PPP: Echo request counter expired\n");
#endif
                goto term;
            }
            if ((mess = Ngetbuf()) == 0)
                return 0;
            netp->hw.opt6++;
            netp->hw.echo_time = ul1;
            mess->netno = netno;
            PH(mess)->protocol = NC2(PROTlcp);          /* Protocol */
            cp = (char *)mess + MESSH_SZ + LHDRSZ;
            *cp++ = LCPecho_req;                        /* Code */
            *cp++ = ++netp->hw.opt1;                    /* ID */
            *cp++ = 0; *cp++ = 8;                       /* Length */
#if MAGICNUM
            if (netp->hw.locopts & (1<<LCPopt_MNUM))    /* MagicNum */
                Nmemcpy(cp, (char *)&netp->hw.mnum, 4);
            else
#endif
                memset(cp, 0, 4);
            mess->mlen = MESSH_SZ + LHDRSZ + 8;
            pppWrite(mess);
            mess->id = bALLOC;
            Nrelbuf(mess);
        }
    }
#endif

    if (netp->state == PPPhold)
        return 0;

   /* If link is open, check for idle if necessary and return 1 */
    if (netp->state == PPPopen) {
#if IDLE_TOUT
        if (((ul1-netp->hw.idle_time)>>10) > IDLE_TOUT) {
#if NTRACE >= 3
            Nprintf("PPP: Idle timeout expired\n");
#endif
            goto term;
        }
#endif
        return 1;       /* Link is open */
    }

   /* If PPP is closed, do dialing if necessary and return -1 */
    if (netp->state == PPPclsd) {
#if DIALD
       /* If there is dialing to do */
        if (!IS_MODEM_DONE(netp) && !IS_MODEM_NONE(netp)) {
           /* If still working */
            if ((prevstate = MODEM_PROCESS(netno)) == 0)

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久综合999| 免费观看日韩电影| 青青草原综合久久大伊人精品优势| 国产精品成人一区二区艾草 | 欧美吻胸吃奶大尺度电影 | 国产日韩欧美精品综合| 亚洲女人****多毛耸耸8| 精东粉嫩av免费一区二区三区| 91麻豆精东视频| 国产午夜亚洲精品羞羞网站| 视频一区二区三区中文字幕| 91在线视频网址| www国产亚洲精品久久麻豆| 亚洲丰满少妇videoshd| 97se亚洲国产综合自在线| 精品国内二区三区| 天堂午夜影视日韩欧美一区二区| 一本大道av伊人久久综合| 国产网站一区二区| 激情综合色播五月| 欧美精品第1页| 亚洲午夜久久久久久久久电影院 | 久久色.com| 另类综合日韩欧美亚洲| 在线电影院国产精品| 一区二区三区免费| 色综合天天视频在线观看| 国产精品蜜臀av| 国产成人在线视频播放| 精品免费日韩av| 麻豆成人久久精品二区三区红| 欧美视频中文字幕| 亚洲成在人线免费| 欧美性欧美巨大黑白大战| 亚洲另类在线视频| 欧美中文字幕一二三区视频| 一区二区三区在线高清| 色欲综合视频天天天| 亚洲精品久久久久久国产精华液| 91亚洲精品久久久蜜桃网站| 国产精品久久三区| 91麻豆免费在线观看| 亚洲尤物视频在线| 欧美系列日韩一区| 日本中文字幕一区二区有限公司| 7777精品伊人久久久大香线蕉完整版 | 天天爽夜夜爽夜夜爽精品视频| 欧美四级电影网| 日本亚洲欧美天堂免费| 欧美一区二区福利视频| 国产不卡视频一区| 亚洲日本韩国一区| 欧美日韩日日摸| 九九久久精品视频| 亚洲国产精品激情在线观看| 91麻豆免费看片| 日韩av不卡在线观看| 国产婷婷精品av在线| av在线不卡电影| 亚洲超碰精品一区二区| 日韩精品一区二区三区中文不卡| 国产精品一卡二卡| 亚洲免费av高清| 91精品国产综合久久香蕉麻豆| 激情亚洲综合在线| 亚洲欧美成人一区二区三区| 69堂亚洲精品首页| 国产乱淫av一区二区三区| 亚洲欧美综合另类在线卡通| 欧美精品aⅴ在线视频| 国产资源在线一区| 亚洲综合激情网| 日韩精品最新网址| 一本一道久久a久久精品 | 亚洲欧美另类图片小说| 欧美一区二区在线看| 成人免费视频免费观看| 午夜精品一区二区三区免费视频 | 国产高清一区日本| 午夜精品福利一区二区三区av| 欧美国产一区二区| 欧美精品aⅴ在线视频| av男人天堂一区| 秋霞午夜鲁丝一区二区老狼| 国产精品毛片久久久久久| 日韩一级完整毛片| 色综合中文字幕| 国产在线一区观看| 视频一区二区中文字幕| 亚洲欧洲综合另类| 国产欧美一区二区三区在线看蜜臀| 在线观看免费一区| 99国产精品久久| 国产一区二区三区四| 天堂久久久久va久久久久| 国产精品美女久久久久久久久久久| 日韩欧美国产不卡| 欧美日韩一本到| 色天天综合色天天久久| 国产大陆精品国产| 开心九九激情九九欧美日韩精美视频电影| 一区二区三区四区亚洲| ●精品国产综合乱码久久久久 | 91精品国产综合久久精品性色| 91丨porny丨国产| 粉嫩aⅴ一区二区三区四区五区| 男男gaygay亚洲| 图片区小说区国产精品视频| 亚洲在线一区二区三区| 一区二区三区四区蜜桃| 亚洲黄色免费电影| 国产精品第13页| 一区二区中文视频| 亚洲视频你懂的| 日韩理论片网站| 亚洲免费成人av| 亚洲综合色成人| 亚洲电影第三页| 天堂va蜜桃一区二区三区| 天堂成人免费av电影一区| 婷婷综合五月天| 日韩精品免费专区| 蜜臀精品久久久久久蜜臀| 免费观看久久久4p| 久久国产麻豆精品| 国产精品一区二区你懂的| 高清国产一区二区| a级精品国产片在线观看| 色综合天天综合网天天狠天天| 99精品久久久久久| 91福利在线导航| 日韩一区二区影院| 亚洲精品一区二区三区蜜桃下载| 久久久久久一二三区| 国产精品毛片久久久久久| 亚洲欧美日韩久久精品| 婷婷国产v国产偷v亚洲高清| 蜜桃视频免费观看一区| 成人午夜激情视频| 日本韩国欧美国产| 日韩欧美一级特黄在线播放| 久久久久久久综合日本| 国产精品国产三级国产有无不卡| 亚洲久本草在线中文字幕| 三级不卡在线观看| 国产美女一区二区三区| 色综合久久精品| 欧美videos中文字幕| 国产精品欧美久久久久无广告 | 国产精品对白交换视频| 亚洲国产日韩一级| 国产剧情av麻豆香蕉精品| 色综合视频在线观看| 欧美一区二区三区免费观看视频| 久久久99久久| 一区二区免费在线| 久久国内精品视频| 色婷婷激情综合| 精品国产制服丝袜高跟| 一区二区三区日韩在线观看| 久久99精品久久久久久国产越南 | 成人精品免费网站| 欧美一级欧美三级在线观看| 国产精品久久久久久久久晋中 | 91一区二区三区在线播放| 欧美xxxxxxxx| 亚洲成av人片在www色猫咪| 国产成人免费av在线| 欧美精品久久久久久久久老牛影院| 久久久久久久久久久99999| 夜夜揉揉日日人人青青一国产精品| 日韩国产精品久久| 亚洲第一狼人社区| 精品在线视频一区| 国产综合色在线| caoporn国产精品| 精品视频1区2区| 国产午夜一区二区三区| 天天色综合天天| 99精品视频在线播放观看| 欧美一区二区三区免费视频| 亚洲精品一线二线三线| 一个色妞综合视频在线观看| 国产在线麻豆精品观看| 99久久伊人网影院| 国产欧美日韩中文久久| 午夜精品影院在线观看| 菠萝蜜视频在线观看一区| 久久久久久夜精品精品免费| 午夜精品福利一区二区蜜股av| 成人av影院在线| 日韩一区二区三区电影| 日韩专区中文字幕一区二区| 99精品黄色片免费大全| 精品国精品国产| 国产在线精品一区二区| 欧美二区在线观看| 亚洲激情图片小说视频| 丁香婷婷深情五月亚洲| 欧美一二三区在线|