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

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

?? dhcpcstate2.c

?? VxWorks下DHCP的源代碼!
?? C
?? 第 1 頁 / 共 5 頁
字號:
/* dhcpcState2.c - DHCP client runtime state machine (lease maintenance) *//* Copyright 1984 - 2002 Wind River Systems, Inc. */#include "copyright_wrs.h"/*modification history--------------------01t,25apr02,wap  correct timeout calculations for RENEWING & REBINDING states                 (SPR #69069)01s,23apr02,wap  use dhcpTime() instead of time() (SPR #68900)01r,07mar02,wap  Remember to re-enable the BPF filter and set a watchdog                 timeout when we enter the REBINDING state in bound()                 (SPR #73243)01q,06dec01,wap  Fix reboot_verify() so that it properly constructs retransmit                 request (make_request() called with wrong type) (SPR #70938)01p,12oct01,rae  merge from truestack (SPRs 67822, 27426, 30344)01o,24oct00,spm  fixed modification history after tor3_x merge01n,23oct00,niq  merged from version 01r of tor3_x branch (base version 01m)01m,04dec97,spm  added code review modifications01l,06oct97,spm  removed reference to deleted endDriver global01k,03sep97,spm  added specified minimum timeouts to lease reacquisition01j,02sep97,spm  removed excess IMPORT statement and extra event hook parameter01i,26aug97,spm  major overhaul: reorganized code and changed user interface                 to support multiple leases at runtime01h,06aug97,spm  removed parameters linked list to reduce memory required01g,15jul97,spm  replaced floating point to prevent ss5 exception (SPR #8738);                 removed unneeded checkpoint messages01f,10jun97,spm  isolated incoming messages in state machine from input hooks01e,02jun97,spm  changed DHCP option tags to prevent name conflicts (SPR #8667)                 and updated man pages01d,06may97,spm  changed memory access to align IP header on four byte boundary01c,18apr97,spm  added conditional include DHCPC_DEBUG for displayed output01b,07apr97,spm  added code to use Host Requirements defaults and cleanup                 memory on exit, rewrote documentation01a,29jan97,spm  extracted from dhcpc.c to reduce object size*//*DESCRIPTIONThis library contains a portion of the finite state machine for the WIDE project DHCP client, modified for vxWorks compatibility.INTERNALThis module contains the functions used during and after the BOUND state. It was created to reduce the size of the boot ROM image so that the DHCP clientcan be used with targets like the MV147 which have limited ROM capacity. When executing at boot time, the DHCP client does not use any of the routines defined in this module.INCLUDE_FILES: dhcpcLib.h*//* * WIDE Project DHCP Implementation * Copyright (c) 1995 Akihiro Tominaga * Copyright (c) 1995 WIDE Project * All rights reserved. * * Permission to use, copy, modify and distribute this software and its * documentation is hereby granted, provided only with the following * conditions are satisfied: * * 1. Both the copyright notice and this permission notice appear in *    all copies of the software, derivative works or modified versions, *    and any portions thereof, and that both notices appear in *    supporting documentation. * 2. All advertising materials mentioning features or use of this software *    must display the following acknowledgement: *      This product includes software developed by WIDE Project and *      its contributors. * 3. Neither the name of WIDE Project nor the names of its contributors *    may be used to endorse or promote products derived from this software *    without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE DEVELOPER ``AS IS'' AND WIDE * PROJECT DISCLAIMS ANY LIABILITY OF ANY KIND FOR ANY DAMAGES * WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. ALSO, THERE * IS NO WARRANTY IMPLIED OR OTHERWISE, NOR IS SUPPORT PROVIDED. * * Feedback of the results generated from any improvements or * extensions made to this software would be much appreciated. * Any such feedback should be sent to: *  *  Akihiro Tominaga *  WIDE Project *  Keio University, Endo 5322, Kanagawa, Japan *  (E-mail: dhcp-dist@wide.ad.jp) * * WIDE project has the rights to redistribute these changes. *//* includes */#include <stdio.h>#include <stdlib.h>#include <unistd.h>#include <string.h>#include <signal.h>#include <fcntl.h>#include <sys/types.h>#include <sys/socket.h>#include <sys/ioctl.h>#include <net/if.h>#include <netinet/in.h>#include <netinet/in_systm.h>#include <netinet/if_ether.h>#include <netinet/ip.h>#include <netinet/udp.h>#include <arpa/inet.h>#include "vxWorks.h"#include "ioLib.h"              /* ioctl declaration */#include "rngLib.h"#include "wdLib.h"#include "time.h"#include "inetLib.h"#include "logLib.h"#include "taskLib.h"#include "sysLib.h"#include "vxLib.h"#include "netLib.h"#include "sys/ioctl.h"#include "net/bpf.h"#include "dhcp/dhcpcCommonLib.h"#include "dhcp/dhcpcStateLib.h"#include "dhcp/dhcpcInternal.h"/* defines *//* Retransmission delay is timer value plus/minus one second (RFC 1541). */#define	SLEEP_RANDOM(timer) ( (timer - 1) + (rand () % 2) )#define REQUEST_RETRANS   4     /* Max number of retransmissions. (RFC 1541). *//* globals */IMPORT SEM_ID dhcpcMutexSem;    /* Protects status indicator */IMPORT struct dhcpLeaseData dhcpBootLease;  /* Boot lease time / address *//********************************************************************************* use_parameter - reset the network according to the parameters provided** If no event hook is present for the lease described by <pLeaseData>, this * routine sets the network address, broadcast address and subnet mask for * a network interface to the values chosen by the DHCP client and acknowledged * by the offering DHCP server. The configuration of the network interface is* also changed automatically for any lease established during system startup,* whether or not an event hook is present. This routine calls any installed * event notification hook to indicate that new lease parameters are available.** RETURNS: 0 if setup completed, or 1 if error occurs.** ERRNO: N/A* * NOMANUAL*/int use_parameter (struct dhcp_param *paramp,   /* Current DHCP parameters */                   LEASE_DATA * pLeaseData  /* lease-specific status information */    ){    struct in_addr addr;    struct in_addr mask;    struct in_addr brdaddr;    int status = 0;    int length;    char *bufp;    void *pCookie;    /*     * For now, use the address of the lease-specific data structure as the     * internal lease identifier. This could be replaced with a more      * sophisticated mapping if necessary.     */    pCookie = (void *) pLeaseData;    if (pLeaseData->cacheHookRtn != NULL) {#ifdef DHCPC_DEBUG        logMsg ("Saving lease data.\n", 0, 0, 0, 0, 0, 0);#endif#if BSD<44        length = ntohs (dhcpcMsgIn.udp->uh_ulen) + (dhcpcMsgIn.ip->ip_v_hl & 0xff) * WORD;#else        length = ntohs (dhcpcMsgIn.udp->uh_ulen) + dhcpcMsgIn.ip->ip_hl * WORD;#endif        bufp = (char *) dhcpcMsgIn.ip;        (*pLeaseData->cacheHookRtn) (DHCP_CACHE_WRITE,                                     &pLeaseData->dhcpcParam->lease_origin, &length, bufp);    }    if (pLeaseData->autoConfig || pLeaseData->leaseType == DHCP_AUTOMATIC) {        /*          * If automatic configuration was requested or the lease was          * established during system startup, the client library will          * reconfigure the transmit/receive interface to use the retrieved          * addressing information. Fetch the values for the interface address,          * subnet mask, and broadcast address, if available.         */        bzero ((char *) &addr, sizeof (struct in_addr));        bzero ((char *) &mask, sizeof (struct in_addr));        bzero ((char *) &brdaddr, sizeof (struct in_addr));        addr.s_addr = paramp->yiaddr.s_addr;        /* Set subnet mask, if available. */        if (paramp->subnet_mask != NULL)            mask.s_addr = paramp->subnet_mask->s_addr;        else            mask.s_addr = 0;        /* Set broadcast address, if available. */        if (paramp->brdcast_addr != NULL)            brdaddr.s_addr = paramp->brdcast_addr->s_addr;        else            brdaddr.s_addr = 0;    }    /*      * Set the transmit/receive interface to use the new parameters.     */    if (pLeaseData->autoConfig || pLeaseData->leaseType == DHCP_AUTOMATIC) {        /* Set new address info. Returns 1 if address unchanged.  */        status = config_if (&pLeaseData->ifData, &addr,                            ((mask.s_addr != 0) ? &mask : NULL),                            ((brdaddr.s_addr != 0) ? &brdaddr : NULL));        if (status == 0)            set_route (paramp);        else if (status == -1)  /* Error. */            return (1);        /* Send an ARP reply to update the ARP cache on other hosts. */        arp_reply (&paramp->yiaddr, &pLeaseData->ifData);    }    /*     * If an event notification hook is present, send an     * indication that a new set of parameters is available.     */    if (pLeaseData->eventHookRtn != NULL)        (*pLeaseData->eventHookRtn) (DHCPC_LEASE_NEW, pCookie);    return (0);}/********************************************************************************* release - relinquish a DHCP lease** This routine sends a message to the DHCP server relinquishing the active* lease contained in the <pEvent> event descriptor. If <shutdownFlag> is TRUE,* the routine cleans up all lease-specific data structures because the user* issued a dhcpcRelease() or dhcpcShutdown() call. Otherwise, the routine is* handling a fatal error in the state machine and the lease-specific data is* retained to allow retries of the dhcpcBind() or dhcpcInformGet() operation.** RETURNS: N/A** ERRNO: N/A** NOMANUAL*/void release (LEASE_DATA * pLeaseData,  /* lease-specific status information */              BOOL shutdownFlag /* remove lease-specific data? */    ){    char errmsg[255];    struct dhcp_reqspec tmp_reqspec;    int boundstat;    bzero ((char *) &tmp_reqspec, sizeof (tmp_reqspec));    bzero ((char *) &errmsg, sizeof (errmsg));    semTake (dhcpcMutexSem, WAIT_FOREVER);  /* Reset status indicator. */    if (pLeaseData->leaseGood) {        boundstat = 1;        pLeaseData->leaseGood = FALSE;    } else                      /* Not bound - don't send release message. */        boundstat = 0;    semGive (dhcpcMutexSem);    if (boundstat) {        switch (pLeaseData->currState) {        case BOUND:            /* fall-through */        case RENEWING:         /* fall-through */        case REBINDING:        /* fall-through */        case VERIFY:           /* fall-through */        case VERIFYING:        /* fall-through */            if (pLeaseData->dhcpcParam != NULL) {                set_relinfo (&tmp_reqspec, pLeaseData, errmsg);                dhcp_release (&tmp_reqspec, &pLeaseData->ifData, pLeaseData->oldFlag);                /*                  * Disable the underlying network interface if                 * it used the (soon-to-be) relinquished lease.                  */                if (pLeaseData->autoConfig || pLeaseData->leaseType == DHCP_AUTOMATIC)                    down_if (&pLeaseData->ifData);                if (pLeaseData->cacheHookRtn != NULL) {                    (*pLeaseData->cacheHookRtn) (DHCP_CACHE_ERASE, NULL, NULL, NULL);                }                clean_param (pLeaseData->dhcpcParam);                free (pLeaseData->dhcpcParam);                pLeaseData->dhcpcParam = NULL;            }            break;        default:            break;        }    }    /* Remove lease information if appropriate. */    if (shutdownFlag)        dhcpcLeaseCleanup (pLeaseData);    return;}/********************************************************************************* alarm_bound - timeout during bound state** This routine sends a timeout notification to the client monitor task when * a lease timer expires. It is called at interrupt level by a watchdog timer.* The monitor task will eventually advance the lease from the BOUND state to* the RENEWING or the REBINDING state, depending on which interval elapsed.** RETURNS: N/A** ERRNO: N/A** NOMANUAL*/void alarm_bound (LEASE_DATA * pLeaseData   /* lease-specific status information */    ){    /*     * Ignore the timeout if a state transition occurred     * before processing completed.     */    if (pLeaseData->currState != BOUND)        return;    /* Construct and send a timeout message to the lease monitor task. */    dhcpcEventAdd (DHCP_AUTO_EVENT, DHCP_TIMEOUT, pLeaseData, TRUE);    return;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲欧美日韩综合aⅴ视频| 亚洲成人资源在线| 久久精品在线免费观看| 91精品国产综合久久久久| 亚洲欧美一区二区三区国产精品 | 精品一区精品二区高清| 亚洲成人激情自拍| 亚洲第一福利一区| 亚洲国产一区二区视频| 亚洲第一久久影院| 午夜日韩在线电影| 琪琪一区二区三区| 麻豆国产精品777777在线| 久久精品国产秦先生| 国产在线一区观看| 国产精品一区二区x88av| 国产一区二区精品久久99| 国产一区二区h| 成人毛片视频在线观看| 99久久精品免费看| 欧美中文一区二区三区| 欧美情侣在线播放| 欧美不卡一区二区三区| 国产喂奶挤奶一区二区三区| 国产三级一区二区| 亚洲天堂网中文字| 亚洲国产成人va在线观看天堂| 五月综合激情日本mⅴ| 奇米777欧美一区二区| 国产精品99久久久久久久女警 | 一本一道波多野结衣一区二区| 91精品福利在线| 91精品一区二区三区久久久久久| 日韩精品一区二| 国产精品久久久久久久久快鸭 | 麻豆国产精品官网| 不卡av在线免费观看| 欧美最新大片在线看| 欧美一区二区三区免费在线看 | 久久精品男人天堂av| 中文字幕一区视频| 天天影视网天天综合色在线播放| 久久国产欧美日韩精品| 91美女视频网站| 欧美一二三四在线| 亚洲欧洲一区二区在线播放| 亚洲va国产天堂va久久en| 久久精品久久99精品久久| 成人av影院在线| 欧美一区二区精品| 国产精品久久久久久久久免费桃花 | 久久久亚洲国产美女国产盗摄| 中文字幕中文乱码欧美一区二区| 天天亚洲美女在线视频| 成人高清免费观看| 日韩一区二区在线观看视频| 国产精品久久久久9999吃药| 香蕉加勒比综合久久| 成人午夜av在线| 欧美一区二区三区色| 亚洲女子a中天字幕| 国产在线精品一区在线观看麻豆| 色噜噜夜夜夜综合网| 国产香蕉久久精品综合网| 丝袜美腿高跟呻吟高潮一区| 成人一区二区三区视频在线观看| 欧美美女黄视频| 最好看的中文字幕久久| 经典三级在线一区| 欧美日韩亚洲综合| 亚洲丝袜美腿综合| 国产成人亚洲精品狼色在线| 欧美精品tushy高清| 亚洲美女免费在线| 成人午夜免费电影| 久久精品夜色噜噜亚洲aⅴ| 日韩高清不卡在线| 欧美亚洲国产一区二区三区va| 国产午夜精品久久久久久久| 久久国产视频网| 欧美巨大另类极品videosbest | 精品一区二区成人精品| 欧美三级蜜桃2在线观看| ...av二区三区久久精品| 久色婷婷小香蕉久久| 91精品国产91综合久久蜜臀| 一区二区三区国产| 色综合一个色综合| 国产精品久久网站| 岛国一区二区三区| 久久精品视频网| 国产福利一区二区| 久久久久久9999| 精品午夜一区二区三区在线观看 | 亚洲激情一二三区| 91在线免费播放| 国产精品国产三级国产aⅴ原创| 国产毛片精品一区| 久久久久久久久久久久久夜| 激情欧美一区二区三区在线观看| 欧美一区二区大片| 日本一区中文字幕| 日韩欧美国产午夜精品| 免费观看日韩电影| 日韩美女视频在线| 黄色成人免费在线| 26uuu国产日韩综合| 韩国视频一区二区| 久久尤物电影视频在线观看| 国产中文一区二区三区| 久久午夜色播影院免费高清| 国产乱对白刺激视频不卡| 2020国产成人综合网| 国产激情视频一区二区三区欧美| 国产午夜精品久久久久久久| 成人美女在线视频| 一区二区三区欧美亚洲| 欧美视频在线播放| 男男视频亚洲欧美| 久久久精品欧美丰满| 成人免费毛片嘿嘿连载视频| 亚洲欧美激情视频在线观看一区二区三区 | 久久久99免费| 成人免费毛片a| 亚洲欧美国产三级| 制服丝袜中文字幕一区| 久久99精品国产麻豆不卡| 久久精品亚洲国产奇米99| 成人av电影免费观看| 亚洲人妖av一区二区| 欧美日韩亚洲综合| 国产一区999| 综合久久一区二区三区| 欧美日韩国产一级| 国内精品久久久久影院一蜜桃| 中文字幕欧美日韩一区| 在线精品国精品国产尤物884a| 三级欧美韩日大片在线看| 精品精品欲导航| www.66久久| 日韩精品电影一区亚洲| 久久精品一区蜜桃臀影院| 91小视频在线免费看| 日日摸夜夜添夜夜添亚洲女人| 精品国产乱码久久久久久久| av网站一区二区三区| 婷婷久久综合九色国产成人| 久久精品日产第一区二区三区高清版 | 亚洲午夜激情网页| 精品理论电影在线| 91理论电影在线观看| 日韩电影在线一区| 国产精品美日韩| 91精品啪在线观看国产60岁| 国产成人在线电影| 日韩影院免费视频| 国产精品国产三级国产普通话三级| 51久久夜色精品国产麻豆| 大陆成人av片| 日本aⅴ亚洲精品中文乱码| 日本一二三不卡| 91精品国产色综合久久不卡蜜臀| 丁香啪啪综合成人亚洲小说| 天天综合网 天天综合色| 中文字幕在线不卡一区二区三区| 在线不卡欧美精品一区二区三区| 成人黄色片在线观看| 免费成人在线观看| 一级日本不卡的影视| 久久精品人人做人人综合 | 欧美午夜理伦三级在线观看| 国内精品视频一区二区三区八戒| 亚洲一区二区三区精品在线| 久久久www成人免费毛片麻豆| 欧美二区乱c少妇| 色94色欧美sute亚洲线路一久| 久久99久久久久久久久久久| 一区二区成人在线| 久久久电影一区二区三区| 欧美一级二级三级蜜桃| 欧美日韩一区二区三区四区| 成人福利电影精品一区二区在线观看| 麻豆极品一区二区三区| 亚洲成人一区在线| 一级特黄大欧美久久久| 亚洲人妖av一区二区| 中文字幕一区二区三区不卡在线| 精品国产伦一区二区三区观看体验 | 国产在线视频一区二区三区| 日韩和欧美一区二区| 亚洲亚洲精品在线观看| 亚洲女爱视频在线| 亚洲欧洲色图综合| 亚洲国产成人一区二区三区| 久久久久成人黄色影片| 欧美精品一区男女天堂| 精品久久久久久久人人人人传媒 | 欧美自拍偷拍一区| 99久久婷婷国产| eeuss影院一区二区三区|