亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
成人av免费在线播放| 欧美男生操女生| 欧美中文一区二区三区| 日韩欧美高清dvd碟片| 亚洲四区在线观看| 久久成人综合网| 欧洲精品中文字幕| 亚洲国产精品精华液2区45| 亚洲福利视频三区| 色综合中文字幕| 久久蜜臀精品av| 麻豆91精品91久久久的内涵| 色综合咪咪久久| 欧美韩国一区二区| 极品少妇xxxx精品少妇偷拍 | 亚洲国产精品成人综合| 蜜臀精品一区二区三区在线观看 | 日韩一区二区在线看片| ㊣最新国产の精品bt伙计久久| 九九热在线视频观看这里只有精品| 欧美日韩国产一二三| 亚洲日本在线观看| 本田岬高潮一区二区三区| ww久久中文字幕| 久久精品国产77777蜜臀| 制服丝袜中文字幕亚洲| 艳妇臀荡乳欲伦亚洲一区| 丁香激情综合五月| 欧美激情艳妇裸体舞| 成人午夜免费电影| 国产精品每日更新| av成人免费在线观看| 亚洲男人天堂av| 在线视频一区二区免费| 亚洲午夜久久久久久久久久久| 色综合 综合色| 夜夜亚洲天天久久| 在线观看区一区二| 肉色丝袜一区二区| 日韩一区二区三区在线| 免费观看在线综合色| 日韩美女一区二区三区四区| 蜜芽一区二区三区| 久久久久久9999| caoporm超碰国产精品| 亚洲精品免费看| 欧美久久婷婷综合色| 老鸭窝一区二区久久精品| 精品日韩在线观看| 国产jizzjizz一区二区| 亚洲毛片av在线| 欧美日韩亚洲不卡| 蜜臀国产一区二区三区在线播放 | 欧美一级片免费看| 九九九久久久精品| 中文字幕一区二区5566日韩| 在线精品视频免费观看| 偷窥国产亚洲免费视频| 久久免费午夜影院| 97久久超碰精品国产| 婷婷激情综合网| 国产人成一区二区三区影院| 精品国产免费一区二区三区香蕉 | 一本色道久久综合亚洲aⅴ蜜桃 | 日韩免费在线观看| 成熟亚洲日本毛茸茸凸凹| 亚洲欧美视频在线观看视频| 欧美乱妇一区二区三区不卡视频| 久久99国产精品免费| 18涩涩午夜精品.www| 69堂国产成人免费视频| www.日韩在线| 久久精品国产秦先生| 亚洲欧洲韩国日本视频| 日韩欧美一级二级三级| 99麻豆久久久国产精品免费优播| 肉肉av福利一精品导航| 最新国产成人在线观看| 26uuu国产电影一区二区| 色素色在线综合| 狠狠色丁香久久婷婷综合_中| 亚洲日本在线观看| 日本一区免费视频| 91精品国产一区二区三区蜜臀 | 亚洲成人av中文| 国产三级精品视频| 欧美日韩夫妻久久| 99久久99久久精品免费看蜜桃| 看电影不卡的网站| 亚洲国产精品久久人人爱| 国产欧美日韩久久| 欧美一区二区三区视频免费| 91网站视频在线观看| 国产成人亚洲精品青草天美| 日本人妖一区二区| 亚洲国产成人高清精品| 成人欧美一区二区三区1314| 久久综合色天天久久综合图片| 欧美久久高跟鞋激| 欧美在线你懂得| 色综合久久88色综合天天免费| 国产精品综合视频| 国产一区美女在线| 麻豆成人av在线| 麻豆精品蜜桃视频网站| 秋霞午夜av一区二区三区| 亚洲国产精品久久久男人的天堂| 亚洲欧洲成人自拍| 国产精品福利一区| 中文字幕日本乱码精品影院| 国产精品久久久久三级| 中文字幕免费不卡| 欧美国产精品v| 国产人成一区二区三区影院| 国产午夜精品福利| 国产精品色哟哟| 欧美国产日韩一二三区| 欧美高清一级片在线观看| 国产精品久久久久久亚洲伦| 国产精品国产馆在线真实露脸| 国产精品每日更新| 一区二区在线观看免费| 一区二区三区四区中文字幕| 一个色妞综合视频在线观看| 一区二区欧美视频| 成人免费看的视频| 成人av先锋影音| 91视频免费播放| 欧美性猛交xxxx乱大交退制版| 欧美日韩一区二区三区在线看| 精品视频在线免费观看| 欧美一区二区啪啪| 久久久一区二区三区捆绑**| 欧美激情艳妇裸体舞| 亚洲免费伊人电影| 日韩国产精品久久| 国产在线看一区| 高清不卡一区二区| 欧美综合在线视频| 欧美一级日韩一级| 国产精品剧情在线亚洲| 亚洲午夜电影网| 久国产精品韩国三级视频| 高清日韩电视剧大全免费| 91在线云播放| 欧美精品三级日韩久久| 久久综合色8888| 亚洲精品日韩专区silk| 美女www一区二区| 成人av午夜电影| 3d成人动漫网站| 国产精品免费视频观看| 一二三四区精品视频| 国产一区二区三区四| 色哟哟欧美精品| 精品三级av在线| 亚洲一级在线观看| 国产一区在线精品| 欧美高清激情brazzers| 国产精品丝袜黑色高跟| 日韩成人一区二区| 91美女视频网站| 久久久久久久免费视频了| 一区二区三区鲁丝不卡| 国产精品一二二区| 欧美日韩黄色一区二区| 国产精品污www在线观看| 日韩黄色免费网站| 一本色道久久综合亚洲91 | 欧美一区二区视频在线观看2022| 日本一区免费视频| 精一区二区三区| 欧美日韩一区二区在线观看| 中文字幕中文字幕在线一区 | 天堂一区二区在线免费观看| 国产高清在线精品| 欧美一级在线视频| 亚洲图片欧美视频| 91麻豆swag| 国产精品午夜电影| 福利视频网站一区二区三区| 日韩精品一区二区三区中文精品| 成人欧美一区二区三区白人 | 国产精品初高中害羞小美女文| 国产一区二区三区日韩 | 久久国产精品99久久久久久老狼| 欧美综合亚洲图片综合区| 一区免费观看视频| 成人毛片老司机大片| 国产亚洲欧洲一区高清在线观看| 日本女人一区二区三区| 欧美男生操女生| 日韩福利电影在线观看| 欧美揉bbbbb揉bbbbb| 亚洲一区二区四区蜜桃| 91婷婷韩国欧美一区二区| 国产精品欧美久久久久无广告| 国产一区二三区| 久久久欧美精品sm网站| 国产成人一级电影|