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

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

?? dhcpcboot.c

?? vxworks的完整的源代碼
?? C
?? 第 1 頁 / 共 5 頁
字號:
/* dhcpcBoot.c - DHCP client finite state machine definition (boot time) *//* Copyright 1984 - 2002 Wind River Systems, Inc. */#include "copyright_wrs.h"/*modification history--------------------01m,25apr02,wap  transmit DHCPDECLINEs as broadcasts, not unicasts (SPR                 #75119)01l,23apr02,wap  use dhcpTime() instead of time() (SPR #68900) and initialize                 dhcpcBootStates correctly (SPR #75042)01k,12oct01,rae  merge from truestack ver 01q, base 01g                 SPRs 65264, 70116, 27426, 6973101j,26oct00,spm  fixed byte order of transaction identifier; removed reset code01i,26oct00,spm  fixed modification history after tor3_x merge01h,23oct00,niq  merged from version 01j of tor3_x branch (base version 01f)01g,04dec97,spm  added code review modifications01f,06oct97,spm  removed reference to deleted endDriver global; replaced with                 support for dynamic driver type detection01e,02sep97,spm  removed name conflicts with runtime DHCP client (SPR #9241)01d,26aug97,spm  major overhaul: included version 01h of dhcpcState1.c and                 version 01i of dhcpc_subr.c to retain single-lease library                 for boot time use01c,06aug97,spm  removed parameters linked list to reduce memory required01b,07apr97,spm  rewrote documentation01a,29jan97,spm  created by modifying dhcpc.c module*//*DESCRIPTIONThis library contains the boot-time DHCP client implementation. The librarycontains routines to obtain a set of boot parameters using DHCP. Because the bootstrap loader handles all the system configuration, the boot-time client will not apply any configuration parameters received to the underlying networkinterface.INTERNAL This module contains a modified version of the DHCP client finite statemachine which eliminates all states from BOUND onwards. Provided that the obtained lease exceeds the download time for the runtime image, these routinesare not needed by the ROM-resident bootstrap loader. Their removal reduces the size of the boot ROM image so that the DHCP client can be used with targets like the MV147 which have limited ROM capacity. The code size is further reduced by eliminating the routines which change the network interface settingsand maintain the correct routing table entries. Although necessary to prevent access to an unconfigured interface during runtime, it is overkill at boot time, since the system will not start if an error occurs. Finally, the runtime DHCP client supports the retrieval and maintenance of multiple leases and allows users to renew or release the corresponding parameters. Those capabilities are not necessary at boot time.INCLUDE_FILES: dhcpcBootLib.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 "vxWorks.h"#include "vxLib.h"             /* checksum() declaration. */#include "netLib.h"#include "inetLib.h"#include "taskLib.h"#include "sysLib.h"#include "ioLib.h"#include "sockLib.h"#include "wdLib.h"#include "rngLib.h"#include "logLib.h"#include "muxLib.h"#include "stdio.h"#include "stdlib.h"#include "sys/ioctl.h"#include "time.h"#include "netinet/in.h"#include "netinet/ip.h"#include "netinet/udp.h"#include "dhcpcBootLib.h"#include "dhcp/dhcpcCommonLib.h"#include "bpfDrv.h"/* defines */#define MAX_BOOT_STATES (INFORMING + 1) /* Function pointers for all states. */#define	SLEEP_RANDOM(timer) ( (timer - 1) + (rand () % 2) )#define REQUEST_RETRANS   4  /* Number of retries, maximum of 5. (RFC 1541). */    /* Berkeley Packet Filter instructions for catching ARP messages. */LOCAL struct bpf_insn arpfilter[] = {  BPF_STMT(BPF_LD+BPF_TYPE, 0),    /* Save lltype in accumulator */  BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, ETHERTYPE_ARP, 0, 9),  /* ARP in frame? */  /*   * The remaining statements use the (new) BPF_HLEN alias to avoid   * any link-layer dependencies.   */  BPF_STMT(BPF_LD+BPF_H+BPF_ABS+BPF_HLEN, 6),    /* A <- ARP OP field */  BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, ARPOP_REPLY, 0, 7),    /* ARP reply ? */  BPF_STMT(BPF_LDX+BPF_HLEN, 0),           /* X <- frame data offset */  BPF_STMT(BPF_LD+BPF_B+BPF_IND, 4),       /* A <- hardware size */  BPF_STMT(BPF_ALU+BPF_ADD+BPF_X, 0),      /* A <- sum of variable offsets */  BPF_STMT(BPF_MISC+BPF_TAX, 0),           /* X <- sum of variable offsets */  BPF_STMT(BPF_LD+BPF_W+BPF_IND, 8),       /* A <- sender IP address */  BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, -1, 0, 1),   /* -1 replaced with real IP */  BPF_STMT(BPF_RET+BPF_K, -1),                     /* copy entire frame */  BPF_STMT(BPF_RET+BPF_K, 0)          /* unrecognized message: ignore frame */  };LOCAL struct bpf_program arpread = {    sizeof (arpfilter) / sizeof (struct bpf_insn),    arpfilter    };LOCAL int bpfArpDev; 	/* Gets any replies to ARP probes. */LOCAL u_short dhcps_port;              /* Server port, in network byte order. */LOCAL u_short dhcpc_port;              /* Client port, in network byte order. */IMPORT struct bpf_insn dhcpfilter[];    /* For updating xid test */IMPORT struct bpf_program dhcpread;/* globals */struct dhcp_param * 	dhcpcBootParam = NULL; /* Configuration parameters */IMPORT LEASE_DATA dhcpcBootLeaseData;IMPORT int 	dhcpcBindType; 	/* DHCP or BOOTP reply selected? *//* locals */LOCAL BOOL 			dhcpcOldFlag; /* Use old (padded) messages? */LOCAL int			dhcpcCurrState;   /* Current state */LOCAL int			dhcpcPrevState;   /* Previous state */LOCAL int 			dhcpcMsgLength;   /* Current message size. */LOCAL struct if_info		dhcpcIntface;     /* Network interface */LOCAL struct buffer		sbuf; 	/* Buffer for outgoing messages */LOCAL struct msg 		dhcpcMsgIn;  /* Incoming message components */LOCAL struct msg 		dhcpcMsgOut; /* Outgoing message components */LOCAL unsigned char		dhcpCookie [MAGIC_LEN] = RFC1048_MAGIC;LOCAL struct ps_udph 		spudph;LOCAL int (*dhcpcBootStates [MAX_BOOT_STATES]) ();LOCAL int handle_ip();LOCAL int handle_num();LOCAL int handle_ips();LOCAL int handle_str();LOCAL int handle_bool();LOCAL int handle_ippairs();LOCAL int handle_nums();LOCAL int handle_list();LOCAL 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 */    };/* forward declarations */int dhcp_boot_client (struct if_info *, int, int, BOOL);LOCAL void msgAlign (struct msg *, char *);LOCAL int arp_check (struct in_addr *, struct if_info *);LOCAL int initialize (int, int);LOCAL void set_declinfo (struct dhcp_reqspec *, char *);LOCAL int make_discover (void);LOCAL int make_request (struct dhcp_param *, int);LOCAL int dhcp_decline (struct dhcp_reqspec *);LOCAL int dhcp_msgtoparam (struct dhcp *, int, struct dhcp_param *);LOCAL int merge_param (struct dhcp_param *, struct dhcp_param *);LOCAL long generate_xid ();LOCAL int clean_param (struct dhcp_param *);LOCAL int dhcpcBootInitState();LOCAL int dhcpcBootWaitOffer();LOCAL int dhcpcBootSelecting();LOCAL int dhcpcBootRequesting();LOCAL int dhcpcBootInforming();#ifdef DHCPC_DEBUGLOCAL int nvttostr (char *, char *, int);#endif/********************************************************************************* dhcp_boot_client - Exercise client finite state machine** This routine uses the finite state machine to obtain a set of configuration* parameters. When the ROM-resident bootstrap loader issues a dhcpcBootBind()* call, this routine executes the state machine up until the BOUND state.* The states from BOUND onward are omitted to reduce the size of the boot ROM* images. If an address is already present, the routine executes the isolated* portion of the state machine which sends a DHCP INFORM message and waits for* an acknowledgement containing any additional parameters. The <bindFlag>* argument selects between these alternatives. In the first case, the boot* file downloaded by the bootstrap loader must spawn a task containing the* full state machine defined in the DHCP client runtime library to monitor* the established lease. ** RETURNS: OK if message exchange completed, or value of failed state on error.** ERRNO: N/A** SEE ALSO: dhcpcLib** NOMANUAL*/int dhcp_boot_client    (    struct if_info *ifp,    int         serverPort,     /* port used by DHCP servers */    int         clientPort,     /* port used by DHCP clients */    BOOL 	bindFlag 	/* establish new lease? */    )    {    int next_state = 0;    int retval = 0;    dhcpcBootStates [INIT] = dhcpcBootInitState;    dhcpcBootStates [WAIT_OFFER] = dhcpcBootWaitOffer;    dhcpcBootStates [SELECTING] = dhcpcBootSelecting;    dhcpcBootStates [REQUESTING] = dhcpcBootRequesting;    dhcpcBootStates [INFORMING] = dhcpcBootInforming;    dhcpcIntface = *ifp;    if ( (retval = initialize (serverPort, clientPort)) < 0)        return (retval);    if (bindFlag)        {        /*          * Full lease negotiation process. Use the state machine to         * obtain configuration parameters, including an address.         */        dhcpcPrevState = dhcpcCurrState = INIT;         }    else        {        /*         * Partial message exchange for known (externally assigned) address.         * Send an INFORM message and wait for an acknowledgement containing         * additional parameters.         */        dhcpcPrevState = dhcpcCurrState = INFORMING;        }    while (next_state != BOUND)        {        if ( (next_state = (*dhcpcBootStates [dhcpcCurrState]) ()) < 0)             {#ifdef DHCPC_DEBUG            logMsg ("Error in finite state machine.\n", 0, 0, 0, 0, 0, 0);#endif            if (dhcpcBootParam != NULL)                {                clean_param (dhcpcBootParam);                free (dhcpcBootParam);                dhcpcBootParam = NULL;                }            close (bpfArpDev);            bpfDevDelete ("/bpf/dhcpc-arp");            free (sbuf.buf);            return (ERROR);            }       /* If not a full lease negotiation, keep indication of known address. */        if (dhcpcPrevState != INFORMING)            dhcpcPrevState = dhcpcCurrState;        dhcpcCurrState = next_state;#ifdef DHCPC_DEBUG        logMsg ("next state= %d\n", next_state, 0, 0, 0, 0, 0);#endif        }    close (bpfArpDev);    bpfDevDelete ("/bpf/dhcpc-arp");    free (sbuf.buf);    return (OK);   /* Bind successful. */    } /********************************************************************************* gen_retransmit - generic retransmission after timeout** This routine retransmits the current DHCP client message (a discover or* a request message) when 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*/LOCAL int gen_retransmit

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲欧美日韩小说| 欧美羞羞免费网站| 蜜桃视频第一区免费观看| 亚洲免费毛片网站| 亚洲欧美国产77777| 亚洲精品视频在线看| 18欧美乱大交hd1984| 亚洲视频一区在线观看| 亚洲免费视频成人| 天天影视涩香欲综合网| 青娱乐精品视频在线| 麻豆精品久久精品色综合| 韩国女主播一区二区三区| 国产不卡视频一区| 91美女在线看| 欧美日韩一本到| 日韩欧美不卡在线观看视频| 精品久久久久久久久久久久包黑料 | 美女精品自拍一二三四| 美腿丝袜在线亚洲一区| 国产精品1区二区.| 99久久久精品免费观看国产蜜| 色综合天天天天做夜夜夜夜做| 欧美日韩一区二区在线观看视频| 91麻豆精品国产91久久久使用方法 | 欧美日韩亚洲国产综合| 欧美一区欧美二区| 欧美激情一区二区三区| 一区二区三区欧美视频| 久久91精品久久久久久秒播| 成人免费视频免费观看| 欧美欧美午夜aⅴ在线观看| 欧美成人伊人久久综合网| 亚洲欧美自拍偷拍色图| 蜜臀av性久久久久蜜臀aⅴ四虎 | 午夜一区二区三区视频| 激情深爱一区二区| 色综合久久久久网| 久久免费美女视频| 午夜精品成人在线| 99久久伊人网影院| 精品乱人伦一区二区三区| 亚洲精品国久久99热| 国产在线不卡视频| 欧美日韩大陆在线| 国产精品女上位| 麻豆精品国产91久久久久久| 色先锋aa成人| 欧美激情自拍偷拍| 久久精品国产久精国产| 欧美性大战久久久久久久| 欧美经典一区二区| 美国十次综合导航| 欧美日韩一区二区三区视频| 国产精品久久久久久一区二区三区 | 国产精品久久午夜| 国产精品一卡二卡| 欧美伦理视频网站| 尤物视频一区二区| 91丨porny丨蝌蚪视频| 国产欧美一区二区精品忘忧草| 奇米888四色在线精品| 欧美喷潮久久久xxxxx| 一区二区三区在线视频免费 | 日本韩国一区二区三区| 欧美国产成人在线| 国产美女一区二区| 久久综合久久综合久久| 激情综合五月婷婷| 日韩欧美国产综合| 毛片一区二区三区| 精品久久久三级丝袜| 精品在线播放免费| 欧美成va人片在线观看| 狠狠色丁香婷婷综合| 精品日韩成人av| 国产真实乱子伦精品视频| 精品久久久久久久久久久院品网| 麻豆专区一区二区三区四区五区| 日韩欧美中文一区| 国模大尺度一区二区三区| 精品国产乱码久久久久久蜜臀 | 精品国产伦一区二区三区观看体验| 奇米综合一区二区三区精品视频| 欧美一级片在线看| 国产一区二区免费看| 久久网站热最新地址| 国产风韵犹存在线视精品| 国产精品福利在线播放| 91国产丝袜在线播放| 日韩精品久久久久久| 欧美tk—视频vk| 高清不卡在线观看| 亚洲一二三四久久| 欧美一卡二卡在线观看| 国产在线精品免费| 亚洲欧美另类小说| 欧美另类一区二区三区| 国产一区999| 亚洲精品菠萝久久久久久久| 91精品国产高清一区二区三区 | 亚洲精品乱码久久久久| 69精品人人人人| 丁香一区二区三区| 亚洲123区在线观看| 久久久久久一级片| 91传媒视频在线播放| 久久国产欧美日韩精品| 中文字幕一区二区三区四区不卡| 欧美人妖巨大在线| 成人午夜视频网站| 视频在线观看一区| 国产精品理伦片| 日韩欧美国产一区在线观看| 91丨九色丨黑人外教| 国模娜娜一区二区三区| 亚洲一区影音先锋| 久久精品人人做人人综合| 欧美无人高清视频在线观看| 国产成人亚洲综合a∨婷婷| 亚洲成人精品一区二区| 中文字幕欧美国产| 日韩一本二本av| 在线观看三级视频欧美| 成人av一区二区三区| 美女www一区二区| 视频一区在线播放| 亚洲精品精品亚洲| 中文字幕中文字幕一区二区| 日韩欧美国产高清| 91精品在线麻豆| 欧美在线高清视频| 99久久精品国产网站| 国产久卡久卡久卡久卡视频精品| 午夜伦理一区二区| 亚洲最色的网站| 亚洲三级免费观看| 中文字幕制服丝袜成人av| 精品国产免费视频| 精品国产亚洲在线| 精品国产乱码久久久久久牛牛| 91精品国产色综合久久ai换脸| 欧美性色黄大片手机版| 91香蕉国产在线观看软件| 成人黄页在线观看| 成人理论电影网| 成人深夜福利app| 波多野结衣欧美| 成人午夜电影久久影院| 国产91丝袜在线18| 成人激情电影免费在线观看| 国产传媒欧美日韩成人| 国产激情视频一区二区三区欧美 | 国产精品激情偷乱一区二区∴| 久久麻豆一区二区| 2024国产精品视频| 国产欧美综合在线| 中文av字幕一区| 亚洲免费在线视频一区 二区| 综合久久给合久久狠狠狠97色| 亚洲欧洲一区二区在线播放| 亚洲精品国产无天堂网2021| 亚洲欧美激情一区二区| 亚洲成人免费在线| 免费观看成人鲁鲁鲁鲁鲁视频| 久久99国产精品免费| 国产高清无密码一区二区三区| 成人一区二区三区视频在线观看| 99re免费视频精品全部| 色天天综合久久久久综合片| 在线91免费看| 国产亚洲1区2区3区| 中文字幕一区二区在线播放| 亚洲永久免费av| 久久99最新地址| www.日韩av| 日韩区在线观看| 亚洲欧洲三级电影| 久久精品国产精品亚洲精品| 国产精品一区二区x88av| 91色|porny| 日韩一区二区中文字幕| 国产女同互慰高潮91漫画| 一区二区激情视频| 精品一区二区久久| 色老汉一区二区三区| 欧美一区二区不卡视频| 国产精品成人网| 日本不卡一区二区三区| av不卡一区二区三区| 日韩一区二区精品葵司在线| 国产精品美女久久久久久久网站| 亚洲国产日韩a在线播放性色| 国产一区二区三区在线看麻豆| 色女孩综合影院| 久久久久久久久伊人| 五月天激情小说综合| 99国产精品久久| 国产亚洲一区二区三区| 日本亚洲三级在线|