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

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

?? diald.c

?? PPP協(xié)議C語言源代碼
?? C
?? 第 1 頁 / 共 2 頁
字號:
            i2 = getDialInt(&netp->hw.sp);

           /* Test:  (Value1 Condition Value2) */
            switch (c1) {
                default:
                    goto term;
                case 1:
                    if (i1 < i2)
                        goto good_goto;
                    goto bad_goto;
                case 2:
                    if (i1 <= i2)
                        goto good_goto;
                    goto bad_goto;
                case 3:
                case 4:
                    if (i1 == i2)
                        goto good_goto;
                    goto bad_goto;
                case 5:
                    if (i1 > i2)
                        goto good_goto;
                    goto bad_goto;
                case 6:
                    if (i1 >= i2)
                        goto good_goto;
                    goto bad_goto;
            }
        case ussDialXcmdLogE:   /* type int-index */
            i1 = *netp->hw.sp++;
            _sv[netno].logp = ussDialLogTable[i1];
            _sv[netno].logid = i1;
            break;
        case ussDialXcmdNologE: /* type */
            _sv[netno].logp = 0;
            _sv[netno].logid = -1;
            break;
        case ussDialXcmdUpE:    /* type */
        case USS_DIAL_SFLAG:    /* unofficial-type */
#if NTRACE >= 3
            Nprintf("DIALD: Ending script (good) %s\n", _sv[netp->netno].name);
#endif
            netp->hw.st = ussDialStateDoneE;
            dialDown(netno);
            return 1;           /* Finished with success */
        default:                /* Unknown command, see if next byte is OK */
            break;
        }
        break;
    case ussDialStateSendE:     /* Timeout on Send (shouldn't happen) */
        netp->hw.opt1 = 0;
        netp->hw.st = ussDialStateNextE;
        break;
    case ussDialStatePausE:     /* Timeout on pause (not a bad thing) */
        netp->hw.st = ussDialStateNextE;
        break;
    case ussDialStateDoneE:     /* Already finished (shouldn't happen) */
        return 1;
    case ussDialStateRecvE:     /* Timeout on Expect */
    case ussDialStateRecvE|ussDialStateBChckE:  /* Check for data received */
        cp = (char *)_sv[netno].mp+MESSH_SZ+LHDRSZ; /* Expected data */
        cp2 = netp->hw.buflim;                      /* Received data */

#if NTRACE >= 9
        {
            char *a;
            Nprintf("DIALD: Compare '");
            for (a=cp; *a; a++)
                if (*a == '\r')
                    Nputchr('r');
                else if (*a == '\n')
                    Nputchr('n');
                else
                    Nputchr(*a);
            Nprintf("' with '");
            for (a=cp2; *a; a++)
                if (*a == '\r')
                    Nputchr('r');
                else if (*a == '\n')
                    Nputchr('n');
                else
                    Nputchr(*a);
            Nprintf("'\n");
        }
#endif

       /* If the data is found */
        if (isSubString(cp2, cp)) {
            netp->hw.st = ussDialStateNextE;
           /*
            ** In many cases, a send must be performed immediately after
            ** an expect.  Many modems are single duplexed when off-line so
            ** this fails as the modem transmits a few more characters than
            ** the ones the user script was expecting.  The following code
            ** adds a delay based on the baud rate and the assumption that
            ** three characters (that is, "\r\n\r") may be transmitted.
            */
            if (*netp->hw.sp != ussDialXcmdExpectE) {
                netp->hw.st |= ussDialStateBWaitE;
                netp->hw.idle_time = 24000 / (unsigned int)netp->bps + 1;
                netp->hw.idle_time += TimeMS() + 1000 / clocks_per_sec;
            }
        }
       /* Data not found and time expired.  Turn status bad and proceed. */
        else if (netp->hw.st == ussDialStateRecvE) {
            netp->hw.opt1 = 0;
            netp->hw.st = ussDialStateNextE;
        }
       /* Data not found.  Keep waiting until timeout */
        else
            netp->hw.st = ussDialStateRecvE|ussDialStateBWaitE;
        break;
    }
    if (netp->hw.st == ussDialStateNextE)
        goto next_command;                          /* Do another command */

    return 0;                   /* Still working */
}


/*
** * * * * * *
** ussScriptInit()  Set a script up to execute
**
** int ussScriptTimeout(int netno);
**
** PARAMETERS:
**  (in) netno                  a yfnet network number
**  (in) *fs                    a pointer to a formatted script
**
** DESCRIPTION:
**  This function will set up the script passed to it as the one
**  to execute.
*/
void ussScriptInit(int netno, const unsigned char *fs)
{
    struct NET *netp;
    int i1;

    netp = &nets[netno];

   /* If the current script is not fs */
    if (netp->hw.script != fs) {
        if (netp->hw.st > ussDialStateNoneE && netp->hw.st != ussDialStateDoneE)
            dialDown(netno);
        netp->hw.st = ussDialStateNoneE;    /* Stop current script */
    }

   /* If current script is stopped... */
    if (netp->hw.st == ussDialStateNoneE) {
       /* Get a buffer for send/expect */
        WAITFOR((_sv[netno].mp = Ngetbuf()) != 0, SIG_WN(netno), netp->tout, i1);
        if (!i1) {
            netp->hw.script = (unsigned char *)fs;  /* Set script */
            netp->hw.sp = netp->hw.script;          /* Set pointer */
            netp->hw.st = ussDialStateNextE;        /* Start script */
            dialUp(netno);
#if NTRACE >= 5
            Nprintf("DIALD: Starting new dial script\n");
#endif
        }
#if NTRACE
        else {
            Nprintf("DIALD: Could not get a buffer for dialer!\n");
            Nprintf("DIALD: Terminating script\n");
        }
#endif
    }
}




/*
** * * * * * *
** format()    Put send/expect data in a buffer
**
** static void format(struct NET *netp, MESS *mess);
**
** PARAMETERS:
**  (in/out) struct NET *netp   link-layer structure pointer
**  (in/out) MESS *mess         Message buffer for data received
**
** DESCRIPTION:
**  Formats send/expect data field into a buffer.
*/
static void format(struct NET *netp, MESS *mess)
{
    char *cp;

   /* Assign buflim, bufout and bufin to buffer for send/expect data */
    netp->hw.bufout = netp->hw.bufin = (char *)mess + MESSH_SZ + LHDRSZ;

   /* Put data and variables in buffer */
    while (*netp->hw.sp) {
       /* If the data is a variable */
        if (*netp->hw.sp == USS_DIAL_RCMD_VAR) {
            cp = (char *)*ussDialVarTable[*++netp->hw.sp];
            strcpy(netp->hw.bufin, cp);
            netp->hw.bufin += strlen(cp);
            netp->hw.sp++;
        }
       /* If the data is an integer */
        else if (*netp->hw.sp == USS_DIAL_RCMD_INT) {
            Nsscanf(netp->hw.bufin, "%u", ussDialIntTable[*++netp->hw.sp]);
            netp->hw.bufin += strlen(netp->hw.bufin);
            netp->hw.sp++;
        }
       /* If the data is just data */
        else
            *netp->hw.bufin++ = *netp->hw.sp++;
    }

    *netp->hw.bufin++ = 0;              /* Null terminate data */
    netp->hw.buflim = netp->hw.bufin;   /* Save location of free space */
}


/*
** * * * * * *
** getDialInt()     Get an integer for a dial command
**
** static int getDialInt(unsigned char **sp)
**
** PARAMETERS:
**  (in) char **sp              A value/result pointer to a char array
**
** RETURNS:
**  #                           The number given by the array
**
** DESCRIPTION:
**  This function will examine the contents of the array at the pointer
**  value to see if it contains a variable integer.  If so, the value
**  is extracted from the integer table and the value is returned.  If
**  the value is direct, the value in the array is returned.
**  In either case, the pointer to the array is incremented.
*/
static int getDialInt(unsigned char **sp)
{
    int i1;
    unsigned char *cp = *sp;

    if (*cp == USS_DIAL_RCMD_INT)
        i1 = ussDialIntTable[*++cp];
    else {
        i1 = (*cp++ << 8) & 0xff00; /* High byte of integer */
        i1 += *cp & 0xff;           /* Low byte of integer */
    }
    *sp = ++cp;
    return i1;
}


/*
** * * * * * *
** expect()  Start expecting data received
**
** static void expect(struct NET *netp, MESS *mess);
**
** PARAMETERS:
**  (in/out) struct NET *netp   link-layer structure pointer
**  (in/out) MESS *mess         Message buffer for data received
**
** DESCRIPTION:
**  Sets up the software to expect data received.
*/
static void expect(struct NET *netp, MESS *mess)
{
    unsigned long ul1;
    char *cp;

    mess->netno = netp->netno;

   /* Parse the expect time */
    ul1 = getDialInt(&netp->hw.sp);

   /* Parse the expect data */
    format(netp, mess);

   /* Set the time to wait (seconds -> milliseconds) */
    netp->hw.idle_time = 1000 * ul1 + TimeMS();

   /* Set the wait state */
    netp->hw.st = ussDialStateRecvE|ussDialStateBWaitE;
}


/*
** * * * * * *
** isIgnore()  Test a character to see if it is in the ignore array
**
** static int isIgnore(char c);
**
** PARAMETERS:
**  (in) char c                 A character to compare
**
** RETURNS:
**  0                           Not an ignore character
**  1                           Is an ignore character
*/
static const char ignore[] = {' ','\r','\n'};   /* Characters to ignore */
static int isIgnore(char c)
{
    int i=0;
    while (i < sizeof(ignore))
        if (ignore[i++] == c)
            return 1;
    return 0;
}


/*
** * * * * * *
** isSubString()  See if the second string is in the first
**
** static int isSubString(char *a, char *b);
**
** PARAMETERS:
**  (in) char *a                The first string
**  (in) char *b                The second string
**
** RETURNS:
**  0                           String b is in string a
**  #                           String b is not in string a
**
** DESCRIPTION:
**  This function will test if string b is a sub-string of string a.  It
**  will ignore the characters in the ignore array above.
**
**      "xxx"      is a sub-string of       "abcxxxdef"
**      "abcdef"   is not a sub-string of   "abcxxxdef"
**      ""         is a sub-string of       <anything>
**      <anything> is not a sub-string of   ""
*/
static int isSubString(char *a, char *b)
{
    char c1, *a2, *b2;

    c1 = 0;
    do {
        while (*b && isIgnore(*b))
            b++;
        while (*a && *a != *b)
            a++;
        for (a2 = a, b2 = b; *a2 && *b2 && !(c1 = (*a2 ^ *b2));) {
            a2++, b2++;
            while (*a && isIgnore(*a))
                a++;
            while (*b && isIgnore(*b))
                b++;
        }
        if (!c1 && !*b2)
            return 1;
    } while (*a++);

    return 0;
}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩一区二区免费高清| 久久人人97超碰com| 国产美女av一区二区三区| 亚洲最大成人综合| 亚洲欧洲美洲综合色网| 国产精品久久久久婷婷二区次| 中文乱码免费一区二区| 国产精品色呦呦| 国产精品日日摸夜夜摸av| 亚洲国产精品精华液ab| 91在线云播放| 国产亚洲精品免费| 久久不见久久见免费视频7| 国产精品美女久久久久久久久| 久久精品人人做人人爽97 | 天天综合日日夜夜精品| 亚洲蜜臀av乱码久久精品蜜桃| 一区二区三区在线观看动漫| 夜夜精品视频一区二区| 男女激情视频一区| 国产福利一区二区三区视频| 色综合天天综合网国产成人综合天 | 国产精品1024| 99久久免费视频.com| 欧美性一二三区| 极品少妇xxxx精品少妇| 不卡视频一二三| 欧美巨大另类极品videosbest| 日韩一区二区三区四区五区六区| 91福利精品视频| 精品国产一区二区三区四区四| 国产精品美女久久久久av爽李琼| 亚洲一级不卡视频| 国产精品一区二区不卡| 欧美日韩综合一区| 国产欧美一二三区| 天堂成人免费av电影一区| 国产 欧美在线| 欧美一区二区日韩| **欧美大码日韩| 美女脱光内衣内裤视频久久网站| av午夜精品一区二区三区| 欧美一区二区精品久久911| 国产精品久久久久久久岛一牛影视| 日本一不卡视频| 91污片在线观看| 久久精品视频网| 青青草视频一区| 在线精品视频一区二区三四| 久久免费电影网| 免费观看30秒视频久久| 欧美专区日韩专区| 国产精品视频九色porn| 久久99精品久久久久久动态图| 日本国产一区二区| 1区2区3区国产精品| 国产精品一二一区| 精品对白一区国产伦| 婷婷一区二区三区| 欧美三级资源在线| 亚洲专区一二三| 色999日韩国产欧美一区二区| 亚洲国产精品高清| 国产盗摄一区二区三区| 久久一二三国产| 精品一区二区三区免费| 欧美不卡一区二区三区| 蜜臀av性久久久久av蜜臀妖精| 欧美系列亚洲系列| 亚洲影视在线观看| 欧美日韩国产另类一区| 亚洲成a人v欧美综合天堂下载| 欧美色综合天天久久综合精品| 一区二区三区国产豹纹内裤在线 | 中文字幕在线视频一区| 成人免费毛片aaaaa**| 国产午夜精品一区二区三区四区| 国产一区二区精品久久91| 精品国产免费视频| 国产91精品一区二区麻豆网站| 国产亚洲成aⅴ人片在线观看| 国产精品1区2区3区| 国产精品久久久爽爽爽麻豆色哟哟 | 久久久久久久久久久久久女国产乱| 蜜臀国产一区二区三区在线播放| 91精品国产91热久久久做人人| 丝袜美腿一区二区三区| 欧美一卡二卡在线| 国产毛片精品国产一区二区三区| 久久婷婷成人综合色| 国产河南妇女毛片精品久久久| 久久精品水蜜桃av综合天堂| www.在线成人| 亚洲国产美女搞黄色| 91精品久久久久久久99蜜桃| 精品无码三级在线观看视频| 国产欧美一区二区三区鸳鸯浴 | 麻豆91精品视频| 久久久精品免费观看| 91网站最新地址| 日韩国产欧美在线播放| 国产视频亚洲色图| 色天天综合久久久久综合片| 免费日韩伦理电影| 国产精品久久久久9999吃药| 欧美日韩国产小视频| 韩国精品主播一区二区在线观看 | 视频一区中文字幕国产| 久久影院视频免费| 欧美影院一区二区三区| 国产一区二区三区国产| 一区二区三区日韩在线观看| 久久亚洲私人国产精品va媚药| 北条麻妃一区二区三区| 91美女精品福利| 国产精品全国免费观看高清| 日韩女优电影在线观看| 成人一区二区三区| 亚洲mv在线观看| 国产精品婷婷午夜在线观看| 欧美一区二区在线播放| 99热99精品| 激情五月播播久久久精品| 一个色妞综合视频在线观看| 久久久久综合网| 337p亚洲精品色噜噜狠狠| 成人伦理片在线| 久久99精品一区二区三区| 一区二区三区中文免费| 欧美国产乱子伦| 精品av久久707| 91精品国产一区二区三区| 91麻豆福利精品推荐| 色哦色哦哦色天天综合| 国产成a人亚洲精| 国产一区二区三区香蕉| 日韩电影在线看| 亚洲成国产人片在线观看| 一区二区三区四区亚洲| 国产精品久久久久一区二区三区| 久久无码av三级| 欧美成人精品福利| 欧美成人官网二区| 欧美一区二区三区视频在线观看| 在线观看网站黄不卡| 色先锋久久av资源部| caoporen国产精品视频| 不卡av免费在线观看| jlzzjlzz欧美大全| 国产91丝袜在线18| 成人久久视频在线观看| 丁香另类激情小说| 成人国产精品免费观看视频| 国产成人av一区二区| 国产电影精品久久禁18| 成人中文字幕合集| 不卡欧美aaaaa| 色婷婷综合久久久久中文一区二区| 97超碰欧美中文字幕| 色94色欧美sute亚洲线路一ni| 在线亚洲一区观看| 欧美精品日日鲁夜夜添| 91精品国产欧美一区二区18| 日韩精品一区二区三区在线播放| 日韩一区二区三区电影| 久久香蕉国产线看观看99| 亚洲国产成人一区二区三区| 中文字幕一区三区| 亚洲成人综合视频| 麻豆精品视频在线观看视频| 韩国在线一区二区| 99久久久国产精品免费蜜臀| 欧美性做爰猛烈叫床潮| 日韩精品一区二| 国产精品色噜噜| 亚洲一区视频在线| 精品亚洲成a人| 91老师国产黑色丝袜在线| 欧美日韩精品欧美日韩精品一| 精品少妇一区二区三区免费观看| 国产肉丝袜一区二区| 一区二区三区国产| 精品一区二区影视| 91麻豆产精品久久久久久| 欧美一区二区三区影视| 日本一区二区久久| 亚洲成在人线免费| 成人综合婷婷国产精品久久蜜臀| 欧美在线一二三四区| 精品国产凹凸成av人导航| 亚洲卡通欧美制服中文| 国产真实乱偷精品视频免| 色综合色狠狠天天综合色| 日韩精品专区在线影院重磅| 亚洲欧美成人一区二区三区| 日本va欧美va欧美va精品| 91免费在线看| 久久久久久黄色| 强制捆绑调教一区二区| 色88888久久久久久影院按摩|