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

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

?? dhcpcstate1.c

?? VxWorks下DHCP的源代碼!
?? C
?? 第 1 頁 / 共 4 頁
字號:
/* dhcpcState1.c - DHCP client runtime state machine (lease acquisition) *//* Copyright 1984 - 2002 Wind River Systems, Inc. */#include "copyright_wrs.h"/*modification history--------------------01r,25apr02,wap  Only do arp_check() once so DHCPDECLINE messages are sent                 (SPR #76315)01q,23apr02,wap  use dhcpTime() instead of time() (SPR #68900)01p,05nov01,wap  Fix memory leak in selecting() (SPR #68981)01o,12oct01,rae  merge from truestack (modhist update)                 note: SPRs 29555 30344 fixed here01n,24oct00,spm  fixed modification history after tor3_x merge01m,23oct00,niq  merged from version 01p of tor3_x branch (base version 01l);                 upgrade to BPF replaces tagged frame support01l,04dec97,spm  added code review modifications01k,06oct97,spm  removed reference to deleted endDriver global01j,02sep97,spm  moved data retrieval to prevent dereferenced NULL (SPR #9243);                 removed excess IMPORT statement01i,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,10jun97,spm  isolated incoming messages in state machine from input hooks01f,02jun97,spm  changed DHCP option tags to prevent name conflicts (SPR #8667)01e,06may97,spm  changed memory access to align IP header on four byte boundary01d,28apr97,spm  corrected placement of conditional include to prevent failure01c,18apr97,spm  added conditional include DHCPC_DEBUG for displayed output01b,07apr97,spm  added code to use Host Requirements defaults, rewrote docs01a,27jan97,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 prior to the BOUND state. It wascreated to isolate those functions and reduce the size of the boot ROM image so that the DHCP client could be used with targets like the MV147 which have limited ROM capacity. When executing at boot time, the DHCP client's statemachine only used the states defined in this module. After the initial port was completed, the WIDE project implementation was greatly modified to allow the DHCP client library to establish and maintain multiple leases unassociated with the network interface used for message transfer. That capability iscompletely unnecessary for the boot time client, so it no longer shares any code with 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 "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 "dhcp/dhcpcStateLib.h"#include "dhcp/dhcpcInternal.h"#include "dhcp/dhcpcCommonLib.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 int dhcpcMinLease;       /* Minimum accepted lease length. */IMPORT SEM_ID dhcpcMutexSem;    /* Protects status indicator */unsigned char dhcpCookie[MAGIC_LEN] = RFC1048_MAGIC;struct buffer sbuf;int (*fsm[MAX_STATES]) ();int (*handle_param[MAXTAGNUM]) () ={    NULL,                       /* PAD */        handle_ip,              /* SUBNET_MASK */        handle_num,             /* TIME_OFFSET */        handle_ips,             /* ROUTER */        handle_ips,             /* TIME_SERVER */        handle_ips,             /* NAME_SERVER */        handle_ips,             /* DNS_SERVER */        handle_ips,             /* LOG_SERVER */        handle_ips,             /* COOKIE_SERVER */        handle_ips,             /* LPR_SERVER */        handle_ips,             /* IMPRESS_SERVER */        handle_ips,             /* RLS_SERVER */        handle_str,             /* HOSTNAME */        handle_num,             /* BOOTSIZE */        handle_str,             /* MERIT_DUMP */        handle_str,             /* DNS_DOMAIN */        handle_ip,              /* SWAP_SERVER */        handle_str,             /* ROOT_PATH */        handle_str,             /* EXTENSIONS_PATH */        handle_bool,            /* IP_FORWARD */        handle_bool,            /* NONLOCAL_SRCROUTE */        handle_ippairs,         /* POLICY_FILTER */        handle_num,             /* MAX_DGRAM_SIZE */        handle_num,             /* DEFAULT_IP_TTL */        handle_num,             /* MTU_AGING_TIMEOUT */        handle_nums,            /* MTU_PLATEAU_TABLE */        handle_num,             /* IF_MTU */        handle_bool,            /* ALL_SUBNET_LOCAL */        handle_ip,              /* BRDCAST_ADDR */        handle_bool,            /* MASK_DISCOVER */        handle_bool,            /* MASK_SUPPLIER */        handle_bool,            /* ROUTER_DISCOVER */        handle_ip,              /* ROUTER_SOLICIT */        handle_ippairs,         /* STATIC_ROUTE */        handle_bool,            /* TRAILER */        handle_num,             /* ARP_CACHE_TIMEOUT */        handle_bool,            /* ETHER_ENCAP */        handle_num,             /* DEFAULT_TCP_TTL */        handle_num,             /* KEEPALIVE_INTER */        handle_bool,            /* KEEPALIVE_GARBA */        handle_str,             /* NIS_DOMAIN */        handle_ips,             /* NIS_SERVER */        handle_ips,             /* NTP_SERVER */        handle_list,            /* VENDOR_SPEC */        handle_ips,             /* NBN_SERVER */        handle_ips,             /* NBDD_SERVER */        handle_num,             /* NB_NODETYPE */        handle_str,             /* NB_SCOPE */        handle_ips,             /* XFONT_SERVER */        handle_ips,             /* XDISPLAY_MANAGER */        NULL,                   /* REQUEST_IPADDR */        handle_num,             /* LEASE_TIME */        NULL,                   /* OPT_OVERLOAD */        NULL,                   /* DHCP_MSGTYPE */        handle_ip,              /* SERVER_ID */        NULL,                   /* REQ_LIST */        handle_str,             /* DHCP_ERRMSG */        NULL,                   /* DHCP_MAXMSGSIZE */        handle_num,             /* DHCP_T1 */        handle_num,             /* DHCP_T2  */        NULL,                   /* CLASS_ID */        NULL,                   /* CLIENT_ID */        NULL, NULL, handle_str, /* NISP_DOMAIN */        handle_ips,             /* NISP_SERVER */        handle_str,             /* TFTP_SERVERNAME */        handle_str,             /* BOOTFILE */        handle_ips,             /* MOBILEIP_HA */        handle_ips,             /* SMTP_SERVER */        handle_ips,             /* POP3_SERVER */        handle_ips,             /* NNTP_SERVER */        handle_ips,             /* DFLT_WWW_SERVER */        handle_ips,             /* DFLT_FINGER_SERVER */        handle_ips,             /* DFLT_IRC_SERVER */        handle_ips,             /* STREETTALK_SERVER */        handle_ips              /* STDA_SERVER */};/********************************************************************************* gen_retransmit - generic retransmission after timeout** This routine retransmits the current DHCP client message (a discover or* a request message) after the appropriate timeout interval expires.* It is called from multiple locations in the finite state machine.** RETURNS: 0 if transmission completed, or negative value on error.** ERRNO: N/A** NOMANUAL*/int gen_retransmit (LEASE_DATA * pLeaseData,    /* lease-specific data structures */                    int length  /* length of DHCP message */    ){    time_t curr_epoch = 0;    struct ifnet *pIf;          /* interface used for retransmission */    struct sockaddr_in dest;    BOOL bcastFlag;    pIf = pLeaseData->ifData.iface;    if (dhcpTime (&curr_epoch) == -1)        return (-1);    /* Update the appropriate fields in the current DHCP message. */    if (pLeaseData->currState != REQUESTING)        dhcpcMsgOut.dhcp->secs = htons (curr_epoch - pLeaseData->initEpoch);    dhcpcMsgOut.udp->uh_sum = 0;    dhcpcMsgOut.udp->uh_sum = udp_cksum (&spudph, (char *) dhcpcMsgOut.udp, ntohs (spudph.ulen));    /*     * Retransmit the message. Set the flag to use a link-level broadcast     * address if needed (prevents ARP messages if using Ethernet devices).     */    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;    if (dest.sin_addr.s_addr == 0xffffffff)        bcastFlag = TRUE;    else        bcastFlag = FALSE;    pIf = pLeaseData->ifData.iface;    if (dhcpSend (pIf, &dest, sbuf.buf, length, bcastFlag) == ERROR)        return (-2);    return (0);}/********************************************************************************* retrans_wait_offer - signal reception interval for initial offer expires** This routine sends a timeout notification to the client monitor task when* the interval for receiving an initial lease offer expires. It is called at * interrupt level by a watchdog timer. The monitor task will eventually execute* the WAIT_OFFER state to process the timeout event and retransmit the* DHCP discover message.** RETURNS: N/A** ERRNO: N/A** NOMANUAL*/void retrans_wait_offer (LEASE_DATA * pLeaseData    /* lease-specific status information */    ){    /*      * Ignore the timeout if a state transition occurred during      * the scheduled timer interval.     */    if (pLeaseData->currState != WAIT_OFFER)        return;    /* Construct and send a timeout message to the lease monitor task. */    dhcpcEventAdd (DHCP_AUTO_EVENT, DHCP_TIMEOUT, pLeaseData, TRUE);    return;}/********************************************************************************* alarm_selecting - signal when collection time expires ** This routine sends a timeout notification to the client monitor task so* that the corresponding lease will stop collecting DHCP offers. It is called * at interrupt level by a watchdog timer. The monitor task will eventually * advance the lease from the SELECTING to the REQUESTING state.** RETURNS: N/A** ERRNO: N/A** NOMANUAL*/void alarm_selecting (LEASE_DATA * pLeaseData   /* lease-specific status information */    ){    STATUS result;    /*      * Ignore the timeout if a state transition occurred during      * the scheduled timer interval.     */    if (pLeaseData->currState != SELECTING)        return;    /* Construct and send a timeout message to the lease monitor task. */    result = dhcpcEventAdd (DHCP_AUTO_EVENT, DHCP_TIMEOUT, pLeaseData, TRUE);#ifdef DHCPC_DEBUG    if (result == ERROR)        logMsg ("Warning: couldn't add timeout event for SELECTING state.\n", 0, 0, 0, 0, 0, 0);

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
精品国产91乱码一区二区三区| 91免费国产视频网站| 国产河南妇女毛片精品久久久| www.亚洲人| 精品999在线播放| 亚洲成人自拍网| 成人综合日日夜夜| 欧美videos中文字幕| 一二三四社区欧美黄| 国产精品一区二区三区四区| 欧美日韩一区二区三区免费看| 欧美国产日本韩| 久久草av在线| 欧美色视频在线| 最近中文字幕一区二区三区| 精品一区二区三区免费毛片爱 | 日韩精品一级二级| 99国产一区二区三精品乱码| 26uuu国产在线精品一区二区| 亚洲国产综合91精品麻豆| 成人爽a毛片一区二区免费| 日韩欧美一二三| 视频一区二区国产| 欧美日韩一区小说| 亚洲综合色成人| 色综合色狠狠天天综合色| 国产精品麻豆视频| 成人高清在线视频| 久久嫩草精品久久久精品| 久久国产麻豆精品| 精品日韩欧美在线| 激情久久久久久久久久久久久久久久| 91精品国产欧美一区二区18 | 中文字幕免费不卡在线| 国产精品亚洲专一区二区三区| 日韩精品一区二区三区四区 | 亚洲激情在线激情| 色综合天天综合色综合av| 亚洲日本在线看| 91成人在线免费观看| 亚洲色图制服诱惑| 欧美亚洲一区二区在线观看| 亚洲妇女屁股眼交7| 制服丝袜一区二区三区| 麻豆成人免费电影| 国产拍揄自揄精品视频麻豆| 成人aa视频在线观看| 亚洲蜜臀av乱码久久精品 | 欧美大尺度电影在线| 国内外精品视频| 国产日韩av一区二区| 99视频在线精品| 亚洲成a人片综合在线| 欧美一区永久视频免费观看| 韩国v欧美v亚洲v日本v| 国产精品丝袜久久久久久app| 色伊人久久综合中文字幕| 亚洲成人av一区二区| 久久影院视频免费| 91视频在线观看| 日韩电影在线一区二区三区| 国产视频一区二区在线| 91在线高清观看| 奇米888四色在线精品| 日本一区二区三区电影| 欧美性一二三区| 国产一区二区电影| 亚洲人123区| 欧美tk—视频vk| 琪琪一区二区三区| 18涩涩午夜精品.www| 欧美精品aⅴ在线视频| 国产91丝袜在线播放0| 亚洲一级片在线观看| 日本一区二区成人| 欧美日韩黄视频| 懂色av一区二区在线播放| 性欧美疯狂xxxxbbbb| 中文无字幕一区二区三区| 欧美婷婷六月丁香综合色| 国产一区二区中文字幕| 亚洲第一激情av| 中文成人av在线| 7777女厕盗摄久久久| 99国内精品久久| 国产成人午夜视频| 日本不卡免费在线视频| 亚洲欧洲性图库| 久久久精品国产免大香伊| 欧美日韩国产高清一区二区三区| 国产电影一区二区三区| 免费成人你懂的| 午夜亚洲国产au精品一区二区| 国产精品卡一卡二卡三| 久久午夜色播影院免费高清| 欧美丰满一区二区免费视频| 色成年激情久久综合| 成人免费精品视频| 国产精品一区二区三区99| 久久精品国产亚洲高清剧情介绍| 亚洲福利电影网| 一区二区三区四区高清精品免费观看 | 国产午夜精品美女毛片视频| 在线播放亚洲一区| 在线免费观看成人短视频| av成人免费在线| 成人动漫一区二区三区| 精品中文av资源站在线观看| 日本欧美加勒比视频| 午夜精品在线视频一区| 亚洲成人免费观看| 亚洲成va人在线观看| 五月激情六月综合| 亚洲第一综合色| 日韩av中文在线观看| 婷婷六月综合亚洲| 日日摸夜夜添夜夜添亚洲女人| 亚洲第一狼人社区| 日本午夜精品一区二区三区电影| 日韩和欧美的一区| 免费高清在线一区| 狠狠色狠狠色综合| 国产福利一区二区三区视频| 国产成人久久精品77777最新版本 国产成人鲁色资源国产91色综 | 欧美伊人久久大香线蕉综合69| 欧美影院一区二区三区| 欧美浪妇xxxx高跟鞋交| 欧美久久久久久久久| 日韩欧美一级二级三级久久久| 精品少妇一区二区三区日产乱码| 精品国产乱码久久久久久蜜臀| 久久伊人中文字幕| 中文字幕亚洲电影| 亚洲综合激情小说| 蜜桃av一区二区| 国产一区二区三区蝌蚪| 成人在线视频首页| 在线精品视频小说1| 欧美理论在线播放| 久久综合九色综合97婷婷| 久久精品一区二区| 亚洲免费成人av| 青青国产91久久久久久| 国产成人精品免费一区二区| 91在线精品一区二区| 在线播放中文一区| 中文字幕第一区二区| 亚洲成人1区2区| 豆国产96在线|亚洲| 欧美三级三级三级| 久久嫩草精品久久久精品一| 一区二区三区在线观看网站| 日本不卡1234视频| www.亚洲国产| 欧美一区二区三区免费观看视频| 久久久久久久久久久久久女国产乱| 亚洲视频在线一区二区| 奇米综合一区二区三区精品视频 | 亚洲欧美综合网| 日韩av中文在线观看| 91在线精品秘密一区二区| 7777精品伊人久久久大香线蕉最新版| 国产亚洲va综合人人澡精品| 亚洲成人综合网站| 成人黄色一级视频| 日韩区在线观看| 国产一区二区三区精品视频| 国产农村妇女精品| 99久久伊人精品| 日韩美一区二区三区| 亚洲乱码国产乱码精品精小说| 毛片不卡一区二区| 欧洲av在线精品| 国产精品护士白丝一区av| 久久精品久久综合| 欧美日韩小视频| 中文字幕一区二区三区蜜月| 激情综合色综合久久综合| 欧美日韩一区二区电影| 中文字幕永久在线不卡| 国产成人综合在线播放| 日韩女优av电影| 日韩成人dvd| 欧美日韩在线综合| 一区二区三区四区不卡视频| 成人性生交大合| 国产亚洲欧美在线| 久久er99精品| 日韩午夜激情av| 丝袜亚洲另类欧美综合| 欧美日韩在线电影| 亚洲精品免费在线观看| av不卡在线播放| 国产精品久久久爽爽爽麻豆色哟哟| 国产在线视频一区二区| 精品噜噜噜噜久久久久久久久试看 | www国产成人免费观看视频 深夜成人网 | 奇米一区二区三区| 日韩一级黄色大片| 91久久线看在观草草青青|