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

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

?? dhcpcstate1.c

?? VxWorks下DHCP的源代碼!
?? C
?? 第 1 頁(yè) / 共 4 頁(yè)
字號(hào):
/* 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);

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
一本大道久久a久久精品综合| 日韩美女在线视频| 99视频超级精品| 成人成人成人在线视频| 成人免费视频一区| voyeur盗摄精品| 色综合天天综合在线视频| 97se狠狠狠综合亚洲狠狠| 91美女片黄在线观看91美女| 91蜜桃在线免费视频| 欧美无砖砖区免费| 欧美久久久久久久久| 日韩一区二区三| 精品对白一区国产伦| 国产日韩欧美电影| 中文字幕一区二区三区精华液 | 亚洲国产成人在线| ...xxx性欧美| 亚洲永久免费视频| 五月天丁香久久| 久久av资源站| 国产盗摄一区二区三区| jlzzjlzz亚洲日本少妇| 91久久精品一区二区三| 欧美精三区欧美精三区| 精品美女在线观看| 久久久99精品久久| 综合电影一区二区三区| 亚洲成人7777| 国产乱理伦片在线观看夜一区| 岛国精品一区二区| 欧美在线一二三四区| 日韩欧美中文字幕一区| 欧美国产成人在线| 亚洲国产综合人成综合网站| 卡一卡二国产精品| youjizz国产精品| 欧美日韩国产高清一区二区三区 | 色婷婷激情一区二区三区| 欧美日韩美少妇| 久久精品视频免费| 亚洲一区二区影院| 久久精品国内一区二区三区| 91在线播放网址| 欧美一级艳片视频免费观看| 国产欧美日韩麻豆91| 亚洲激情第一区| 久久超碰97中文字幕| 91无套直看片红桃| 日韩欧美一级二级| 亚洲美女免费视频| 激情国产一区二区| 欧美专区亚洲专区| 久久久久国产精品人| 亚洲国产精品久久艾草纯爱| 国产乱人伦偷精品视频免下载| 欧美中文字幕一区二区三区亚洲| 久久久美女艺术照精彩视频福利播放| 亚洲欧美欧美一区二区三区| 久久99久久99精品免视看婷婷| 94色蜜桃网一区二区三区| 欧美精品v国产精品v日韩精品| 国产欧美久久久精品影院| 三级成人在线视频| 91麻豆蜜桃一区二区三区| 欧美精品一区二区蜜臀亚洲| 亚洲妇女屁股眼交7| 成人美女在线观看| 日韩视频免费观看高清在线视频| 亚洲丝袜制服诱惑| 国产精品亚洲午夜一区二区三区| 91精品国产品国语在线不卡| 一区二区三区四区亚洲| 懂色av中文一区二区三区| 欧美羞羞免费网站| 国产精品色哟哟| 精品一区二区免费| 在线播放欧美女士性生活| 亚洲精品视频在线看| 懂色av一区二区夜夜嗨| 精品国产人成亚洲区| 日韩精品久久久久久| 欧美色精品在线视频| 国产精品福利av| 粉嫩一区二区三区在线看| 欧美精品一区二区三区蜜桃| 日韩av中文字幕一区二区三区| 欧美在线看片a免费观看| 国产精品国产自产拍高清av王其| 国产一区二区三区四区在线观看| 3atv一区二区三区| 亚洲mv在线观看| 欧美日韩午夜影院| 亚洲一区二区高清| 99久久综合国产精品| 久久精品夜色噜噜亚洲a∨| 老司机免费视频一区二区三区| 日韩一区二区三区视频在线观看| 性欧美大战久久久久久久久| 在线观看日韩一区| 亚洲欧美国产三级| 欧美自拍丝袜亚洲| 亚洲成av人在线观看| 欧美福利视频一区| 日韩电影网1区2区| 欧美一级国产精品| 激情综合色丁香一区二区| 精品久久久久久久一区二区蜜臀| 麻豆91在线播放免费| 亚洲精品一区二区三区精华液| 国产精品一区二区久久精品爱涩| 久久亚洲一级片| 成人免费看的视频| 自拍av一区二区三区| 色综合天天性综合| 午夜精品视频在线观看| 91精品国产色综合久久| 久久99国产精品久久99果冻传媒| 欧美成人激情免费网| 国产毛片精品视频| 综合激情网...| 欧美人与禽zozo性伦| 麻豆成人av在线| 国产欧美日韩三级| 91亚洲精品乱码久久久久久蜜桃 | 成人激情开心网| 亚洲精品高清在线| 欧美精品成人一区二区三区四区| 精品伊人久久久久7777人| 国产日韩欧美高清| 欧洲中文字幕精品| 久久er99热精品一区二区| 国产精品麻豆网站| 欧美三级中文字幕| 国产在线不卡一区| 一区二区三区在线观看国产| 日韩一区二区三区视频| 国产999精品久久| 亚洲香肠在线观看| 久久精品人人爽人人爽| 一本一道综合狠狠老| 免费欧美日韩国产三级电影| 中文一区二区在线观看| 欧美午夜电影一区| 国产精品18久久久久久久久| 一区二区三区毛片| 欧美刺激午夜性久久久久久久| 成人精品一区二区三区中文字幕 | 色噜噜久久综合| 美国三级日本三级久久99 | 激情综合色播激情啊| 亚洲日穴在线视频| 日韩精品一区二区三区四区视频| 99vv1com这只有精品| 免费高清视频精品| 亚洲乱码精品一二三四区日韩在线| 欧美一级欧美三级在线观看| 成人网在线播放| 青娱乐精品视频在线| 国产精品国产三级国产aⅴ无密码 国产精品国产三级国产aⅴ原创 | 国产在线不卡一区| 午夜精品久久久久久久蜜桃app| 久久久久久电影| 欧美精品v日韩精品v韩国精品v| 色婷婷精品大视频在线蜜桃视频 | 日韩一卡二卡三卡四卡| 成人福利在线看| 理论电影国产精品| 亚洲综合一二区| 国产精品国产三级国产有无不卡 | 精品成人一区二区三区| 欧洲精品在线观看| 成人午夜电影小说| 九九九精品视频| 日韩中文欧美在线| 亚洲视频 欧洲视频| 国产偷国产偷精品高清尤物| 91精品国产入口| 欧美视频三区在线播放| 波多野结衣中文字幕一区二区三区| 久久国产乱子精品免费女| 亚洲一区二区三区美女| 国产精品女同一区二区三区| 精品久久久久久最新网址| 欧美精品1区2区| 欧美优质美女网站| 91一区一区三区| av中文字幕亚洲| 成人看片黄a免费看在线| 国产精品一区二区在线播放 | 日韩美女主播在线视频一区二区三区 | 一本到三区不卡视频| 国产成人小视频| 国产老女人精品毛片久久| 美脚の诱脚舐め脚责91| 美女精品一区二区| 日本三级韩国三级欧美三级| 亚洲成人激情综合网| 亚洲成人中文在线| 亚洲成av人片在线|