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

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

?? dhcpcstate2.c

?? VxWorks下DHCP的源代碼!
?? C
?? 第 1 頁 / 共 5 頁
字號:
                /* DHCP request sent. Set lease data to execute next state. */                pLeaseData->prevState = BOUND;                pLeaseData->currState = RENEWING;                pLeaseData->initEpoch = curr_epoch;                /*                 * Set the retransmission timer to wait for one-half of the                  * remaining time before T2 expires, or 60 seconds if T2                  * expires in less than one minute.                 */                timeout = limit - curr_epoch;                timeout /= 2;                if (timeout < 60)                    timeout = 60;                /* Set timer for retransmission of request message. */                wdStart (pLeaseData->timer, sysClkRateGet () * timeout,                         (FUNCPTR) retrans_renewing, (int) pLeaseData);                return (OK);            }        }                       /* End of timeout processing. */    } /* End of automatic events. */    else {        /* Process user requests. */        if (pEvent->type == DHCP_USER_RELEASE) {    /* Relinquish lease. */            release (pLeaseData, TRUE);            return (DHCPC_DONE);        }        if (pEvent->type == DHCP_USER_VERIFY) { /* Verify lease */            /* Set the lease data to execute verify() routine. */            pLeaseData->prevState = BOUND;            pLeaseData->currState = VERIFY;            return (DHCPC_MORE);        }    }    return (OK);}/********************************************************************************* renewing - Specific lease renewal state of client finite state machine** This routine contains the fifth state of the client finite state machine.* During this state, a DHCP lease is active. The routine handles all * processing after the first lease timer has expired. If the server which * issued the corresponding lease acknowledges the request for renewal, * processing returns to the bound() routine. If the request is denied, the * negotiation process restarts with the init() routine. If a timeout occurs* before the second lease timer has expired, the DHCP request message is * retransmitted. Otherwise, processing continues with the rebinding() routine.* .IP* This routine is invoked by the event handler of the client monitor task,* and should only be called internally. Any arriving DHCP messages containing* stale offers from earlier states are discarded. User requests generated* by calls to the dhcpcRelease() and dhcpcVerify() routines are accepted.** RETURNS: OK (processing complete), DHCPC_DONE (remove lease),*          DHCPC_MORE (continue), or ERROR.** ERRNO: N/A** NOMANUAL*/int renewing (EVENT_DATA * pEvent   /* pointer to event descriptor */    ){    char *option = NULL;    char errmsg[255];    time_t curr_epoch = 0;    int timeout = 0;    int limit;    int length;    struct dhcp_param tmpparam;    int msgtype;#ifdef DHCPC_DEBUG    char newAddr[INET_ADDR_LEN];#endif    LEASE_DATA *pLeaseData;    char *pMsgData;    struct sockaddr_in dest;    struct ifnet *pIf;    bzero (errmsg, sizeof (errmsg));    if (dhcpTime (&curr_epoch) == -1) {#ifdef DHCPC_DEBUG        logMsg ("time() error in renewing()\n", 0, 0, 0, 0, 0, 0);#endif        return (ERROR);    }    /*     * Use the cookie to access the lease-specific data structures. For now,     * just typecast the cookie. This translation could be replaced with a more     * sophisticated lookup at some point.     */    pLeaseData = (LEASE_DATA *) pEvent->leaseId;    if (pEvent->source == DHCP_AUTO_EVENT) {        if (pEvent->type == DHCP_TIMEOUT) {            /*             * The interval between a timeout event and the entry to the              * renewing() routine depends on the workload of the client              * monitor task and is completely unpredictable. Either the              * entire lease or the second lease timer may have expired              * during that time. Also, the final (60 second) retransmission              * timeout will always end after timer T2 has expired. If T2             * has expired but the lease has not, set the lease data to              * continue with the rebinding() routine. If the lease has             * expired, return to the initial state. Otherwise (the most             * likely case), retransmit the request message since T2 has             * not expired.             */            limit = pLeaseData->dhcpcParam->lease_origin + pLeaseData->dhcpcParam->lease_duration;            if (curr_epoch >= limit) {                /* Lease expired before processing started. */                pLeaseData->prevState = RENEWING;                pLeaseData->currState = INIT;                return (DHCPC_MORE);            }            limit = pLeaseData->dhcpcParam->lease_origin + pLeaseData->dhcpcParam->dhcp_t2;            if (limit <= curr_epoch) {                /*                  * Second timer expired:                  *     request configuration data from any server.                  */                length = make_request (pLeaseData, REBINDING, TRUE);                if (length < 0) {#ifdef DHCPC_DEBUG                    logMsg ("Error making rebind request. Entering INIT state.\n",                            0, 0, 0, 0, 0, 0);#endif                    pLeaseData->prevState = RENEWING;                    pLeaseData->currState = INIT;                    return (DHCPC_MORE);                }                dhcpcMsgOut.udp->uh_sum = 0;                dhcpcMsgOut.udp->uh_sum = udp_cksum (&spudph,                                                     (char *) dhcpcMsgOut.udp, ntohs (spudph.ulen));                bzero ((char *) &dest, sizeof (struct sockaddr_in));                dest.sin_len = sizeof (struct sockaddr_in);                dest.sin_family = AF_INET;                dest.sin_addr.s_addr = dhcpcMsgOut.ip->ip_dst.s_addr;                pIf = pLeaseData->ifData.iface;                if (dhcpSend (pIf, &dest, sbuf.buf, length, TRUE) == ERROR) {#ifdef DHCPC_DEBUG                    logMsg ("Can't send DHCPREQUEST(REBINDING)\n", 0, 0, 0, 0, 0, 0);#endif                    pLeaseData->prevState = RENEWING;                    pLeaseData->currState = INIT;                    return (DHCPC_MORE);                }                /* DHCP request sent. Set lease data to execute next state. */                pLeaseData->prevState = RENEWING;                pLeaseData->currState = REBINDING;                pLeaseData->initEpoch = curr_epoch;                /*                 * Set the retransmission timer to wait for one-half of the                 * remaining time before the lease expires, or 60 seconds if                 * it expires in less than one minute.                 */                timeout = pLeaseData->dhcpcParam->lease_origin +                    pLeaseData->dhcpcParam->lease_duration - curr_epoch;                timeout /= 2;                if (timeout < 60)                    timeout = 60;                /* Set timer for retransmission of request message. */                wdStart (pLeaseData->timer, sysClkRateGet () * timeout,                         (FUNCPTR) retrans_rebinding, (int) pLeaseData);            } else {                /* Transmit lease renewal request to issuing server. */                length = make_request (pLeaseData, RENEWING, FALSE);                if (send_unicast (&pLeaseData->dhcpcParam->server_id, dhcpcMsgOut.dhcp, length)                    < 0) {#ifdef DHCPC_DEBUG                    logMsg ("Can't send DHCPREQUEST(RENEWING)\n", 0, 0, 0, 0, 0, 0);#endif                    pLeaseData->prevState = RENEWING;                    pLeaseData->currState = INIT;                    return (DHCPC_MORE);                }                pLeaseData->prevState = RENEWING;                pLeaseData->currState = RENEWING;                pLeaseData->initEpoch = curr_epoch;                /*                 * Set the retransmission timer to wait for one-half of the                 * remaining time before T2 expires, or 60 seconds if T2                 * expires in less than one minute.                 */                timeout = limit - curr_epoch;                timeout /= 2;                if (timeout < 60)                    timeout = 60;                /* Set timer for retransmission of request message. */                wdStart (pLeaseData->timer, sysClkRateGet () * timeout,                         (FUNCPTR) retrans_renewing, (int) pLeaseData);            }        } /* End of timeout processing. */        else {            bzero ((char *) &tmpparam, sizeof (tmpparam));            /*             * Process DHCP message stored in receive buffer by monitor task.             * The 4-byte alignment of the IP header needed by Sun BSP's is             * guaranteed by the Berkeley Packet Filter during input.             */            pMsgData = pLeaseData->msgBuffer;            align_msg (&dhcpcMsgIn, pMsgData);            /* Examine type of message. Accept DHCPACK or DHCPNAK replies. */            option = (char *) pickup_opt (dhcpcMsgIn.dhcp,                                          DHCPLEN (dhcpcMsgIn.udp), _DHCP_MSGTYPE_TAG);            if (option == NULL) {                /*                 * Message type not found -  ignore untyped DHCP messages, and                 * any BOOTP replies.                 */                return (OK);            } else {                msgtype = *OPTBODY (option);                if (msgtype == DHCPNAK) {#ifdef DHCPC_DEBUG                    logMsg ("Got DHCPNAK in renewing()\n", 0, 0, 0, 0, 0, 0);                    option = (char *) pickup_opt (dhcpcMsgIn.dhcp,                                                  DHCPLEN (dhcpcMsgIn.udp), _DHCP_ERRMSG_TAG);                    if (option != NULL &&                        nvttostr (OPTBODY (option), errmsg, (int) DHCPOPTLEN (option)) == 0)                        logMsg ("DHCPNAK contains the error message \"%s\"\n",                                (int) errmsg, 0, 0, 0, 0, 0);#endif                    clean_param (pLeaseData->dhcpcParam);                    free (pLeaseData->dhcpcParam);                    pLeaseData->dhcpcParam = NULL;                    pLeaseData->prevState = RENEWING;                    pLeaseData->currState = INIT;                    return (DHCPC_MORE);                } else if (msgtype == DHCPACK) {                    /* Fill in host requirements defaults. */                    dhcpcDefaultsSet (&tmpparam);                    if (dhcp_msgtoparam (dhcpcMsgIn.dhcp,                                         DHCPLEN (dhcpcMsgIn.udp), &tmpparam) == OK) {                        merge_param (pLeaseData->dhcpcParam, &tmpparam);                        *(pLeaseData->dhcpcParam) = tmpparam;                        pLeaseData->dhcpcParam->lease_origin = pLeaseData->initEpoch;#ifdef DHCPC_DEBUG                        inet_ntoa_b (pLeaseData->dhcpcParam->yiaddr, newAddr);                        logMsg ("Got DHCPACK (IP = %s, duration = %d secs)\n",                                (int) newAddr, pLeaseData->dhcpcParam->lease_duration, 0, 0, 0, 0);#endif                        /*                          * Send an ARP reply to update the ARP cache on other                         * hosts if the assigned IP address was applied to                         * the underlying network interface.                         */                        if (pLeaseData->autoConfig || pLeaseData->leaseType == DHCP_AUTOMATIC)                            arp_reply (&pLeaseData->dhcpcParam->yiaddr, &pLeaseData->ifData);                        pLeaseData->prevState = RENEWING;                        pLeaseData->currState = BOUND;                    }                    return (DHCPC_MORE);                }            }                   /* End of processing for typed DHCP message. */        }                       /* End of DHCP message processing. */    } else {        /* Process user requests. */        if (pEvent->type == DHCP_USER_RELEASE) {    /* Relinquish lease. */            release (pLeaseData, TRUE);            return (DHCPC_DONE);        }        if (pEvent->type == DHCP_USER_VERIFY) { /* Verify lease. */            /* Set the lease data to execute verify() routine. */            pLeaseData->prevState = RENEWING;            pLeaseData->currState = VERIFY;            return (DHCPC_MORE);        }    }    return (OK);}/********************************************************************************* rebinding - Promiscuous lease renewal state of client finite state machine** This routine contains the sixth state of the client finite state machine.* During this state, a DHCP lease is active. The routine handles all* processing after the second lease timer has expired. It accepts* lease acknowledgements from any DHCP server in response to an earlier* subnet local broadcast of a lease request. If an acknowlegement is received,* processing returns to the bound() routine. If a DHCP server explicitly * denies the request, the negotiation restarts with the init() routine.* Otherwise, the broadcast is repeated periodically until the lease expires.* .IP* This routine is invoked by the event handler of the client monitor task,* and should only be called internally. Any arriving DHCP messages containing* stale offers from earlier states are discarded. User requests generated* by calls to the dhcpcRelease() and dhcpcVerify() routines are accepted.** RETURNS: OK (processing complete), DHCPC_DONE (remove lease),*          DHCPC_MORE (continue), or ERROR.** ERRNO: N/A** NOMANUAL*/int rebinding (EVENT_DATA * pEvent  /* pointer to event descriptor */    ){    char *option = NULL;    char errmsg[255];    time_t curr_epoch = 0;    int timeout;    int limit;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲色图视频免费播放| 色哟哟国产精品| 蜜桃一区二区三区四区| 亚洲午夜久久久| 亚洲成人av免费| 天天爽夜夜爽夜夜爽精品视频| 一区二区在线观看视频在线观看| 国产精品久久久久久久久久免费看| 欧美经典三级视频一区二区三区| 日本一区二区免费在线观看视频| 国产精品久久久久久久久图文区| 欧美高清一级片在线观看| 国产精品网站在线播放| 最好看的中文字幕久久| 亚洲最新在线观看| 日本午夜精品视频在线观看| 精品在线一区二区| 国产91精品免费| 欧洲精品视频在线观看| 5858s免费视频成人| 精品美女一区二区| 国产精品国产三级国产有无不卡| 一区二区三区久久| 蜜臀久久99精品久久久久宅男| 国产乱码精品一区二区三| 99国产精品久久久久久久久久久| 99久久精品国产观看| 日本一区二区三区视频视频| 久久精工是国产品牌吗| 亚洲特级片在线| 丝袜美腿亚洲综合| 国产91露脸合集magnet| 欧美日韩电影一区| 国产精品伦理在线| 日本不卡一区二区| 91色九色蝌蚪| 精品国产成人系列| 亚洲成av人片一区二区梦乃| 国产成人精品在线看| 欧美人xxxx| 国产精品久久久久一区二区三区 | 中文字幕不卡三区| 亚洲国产精品一区二区www在线| 精品一区二区免费| 91成人在线观看喷潮| 久久精品视频网| 五月综合激情网| jizz一区二区| 久久精品这里都是精品| 奇米精品一区二区三区在线观看 | 欧美中文一区二区三区| 精品成人免费观看| 五月天视频一区| 91女人视频在线观看| 久久久精品国产免费观看同学| 亚洲v日本v欧美v久久精品| a4yy欧美一区二区三区| 国产亚洲综合在线| 激情偷乱视频一区二区三区| 欧美日韩国产高清一区二区三区| 亚洲精品视频在线观看网站| 成人av电影在线网| 国产免费成人在线视频| 国产老肥熟一区二区三区| 91精品国产一区二区三区香蕉| 一区二区三区四区蜜桃| 色婷婷精品大在线视频| 亚洲天堂网中文字| 91免费在线播放| 亚洲人成人一区二区在线观看| 91在线高清观看| 亚洲欧美国产毛片在线| 91麻豆国产香蕉久久精品| 亚洲欧美激情小说另类| 一本大道久久精品懂色aⅴ| 亚洲精品国久久99热| 日本精品裸体写真集在线观看| 亚洲欧美日韩小说| 欧美性猛交xxxxxxxx| 亚洲国产精品自拍| 91精品免费观看| 精品系列免费在线观看| 国产亚洲一区二区三区四区| 国产一区二区网址| 国产精品视频免费| 色欧美片视频在线观看| 性久久久久久久久| 久久奇米777| 99精品欧美一区二区蜜桃免费 | 亚洲精品国久久99热| 色久综合一二码| 亚洲国产精品一区二区久久恐怖片| 777a∨成人精品桃花网| 久久99国产精品久久| 亚洲国产精品t66y| 欧美日韩国产成人在线免费| 美女视频网站黄色亚洲| 国产欧美日本一区二区三区| 99精品国产99久久久久久白柏 | 日韩精品中文字幕一区二区三区| 国产一区三区三区| 亚洲欧美视频一区| 欧美日韩国产成人在线免费| 国产在线日韩欧美| 亚洲色图欧美在线| 日韩精品一区二区三区四区视频| 成人免费精品视频| 视频一区欧美精品| 欧美国产激情一区二区三区蜜月| 91福利在线观看| 狠狠色2019综合网| 洋洋成人永久网站入口| 久久午夜老司机| 欧美视频中文一区二区三区在线观看 | 久久99精品久久久久久久久久久久| 久久奇米777| 欧美精品v国产精品v日韩精品| 成人一区二区视频| 蜜桃视频在线一区| 亚洲精品一二三| 久久久777精品电影网影网 | 国产日韩v精品一区二区| 欧美三级资源在线| 91丨九色丨黑人外教| 狠狠色丁香婷婷综合久久片| 亚洲国产综合人成综合网站| 国产精品国产三级国产a| 精品国产乱码久久久久久图片| 欧美写真视频网站| 97久久超碰国产精品| 国产精品一二三四| 久久99国产精品久久| 日韩成人一级大片| 五月婷婷色综合| 一区二区在线免费观看| 亚洲欧洲日产国码二区| 久久久99精品免费观看不卡| 日韩三级伦理片妻子的秘密按摩| 欧美网站一区二区| 欧洲精品在线观看| 欧美在线免费观看视频| 一本大道av伊人久久综合| 成人黄页在线观看| 成人精品国产免费网站| 床上的激情91.| 高清beeg欧美| 成人免费看黄yyy456| 国产乱码精品1区2区3区| 国产真实乱偷精品视频免| 蜜桃av一区二区三区电影| 三级一区在线视频先锋 | 国内一区二区在线| 国精品**一区二区三区在线蜜桃| 美女国产一区二区三区| 麻豆视频观看网址久久| 麻豆精品新av中文字幕| 国内精品视频666| 国产在线播放一区| 不卡一区二区在线| 91亚洲精华国产精华精华液| 91免费观看视频在线| 在线中文字幕一区| 91精品国产日韩91久久久久久| 日韩欧美久久久| 国产丝袜美腿一区二区三区| 国产精品免费av| 亚洲精品中文在线观看| 同产精品九九九| 国内精品国产成人国产三级粉色| 国产精品一二三区在线| 91日韩在线专区| 日韩一区二区三区四区| 欧美电视剧在线看免费| 国产精品午夜在线观看| 亚洲制服丝袜在线| 久久精品国产精品亚洲精品| 国产传媒欧美日韩成人| 色婷婷av一区二区三区软件 | 日本在线观看不卡视频| 国产精品18久久久久久久久 | 日产欧产美韩系列久久99| 九色porny丨国产精品| 99久免费精品视频在线观看 | 久久99精品久久久久| 成人开心网精品视频| 欧美久久免费观看| 国产午夜精品美女毛片视频| 亚洲精品高清视频在线观看| 麻豆91在线观看| 色综合天天做天天爱| 欧美大胆人体bbbb| 一区二区三区精品在线| 国内国产精品久久| 欧美精品第一页| 亚洲欧美在线视频观看| 精品一区二区三区av| 欧美性受xxxx黑人xyx性爽| 国产视频一区不卡| 日韩av高清在线观看| 99riav久久精品riav|