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

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

?? dhcpcbootlib.c

?? vxwork源代碼
?? C
?? 第 1 頁 / 共 2 頁
字號:
/* dhcpcBootLib.c - DHCP boot-time client library *//* Copyright 1984 - 2000 Wind River Systems, Inc. */#include "copyright_wrs.h"/*modification history--------------------01x,27mar02,wap  make dhcpcBootParamsGet() return error if dhcpcBootParam                 hasn't been initialized (SPR #73147)01w,04dec01,wap  initialize dhcpcLeaseList correctly to avoid writing                 to page 0 (NULL pointer dereference) (SPR #69523)01v,17nov00,spm  added support for BSD Ethernet devices01u,15nov00,spm  fixed incorrect pointer assignment in lease list (SPR #62274)01t,24oct00,spm  fixed modification history after merge from tor3_0_x branch01s,23oct00,niq  merged from version 01t of tor3_0_x branch (base version 01r);                 upgrade to BPF replaces tagged frames support01r,16mar99,spm  recovered orphaned code from tor2_0_x branch (SPR #25770)01q,16mar99,spm  recovered orphaned code from tor1_0_1.sens1_1 (SPR #25770)01p,01dec98,spm  added missing memory allocation (SPR #22881)01p,06oct98,spm  fixed copying of parameters with IP address pairs (SPR #22416)01o,14dec97,jdi  doc: cleanup.01n,dec1097,kbw  fiddled manpage format01m,04dec97,spm  added code review modifications01l,06oct97,spm  removed reference to deleted endDriver global; replaced with                 support for dynamic driver type detection01k,25sep97,spm  restored man page for dhcpcBootOptionSet() routine01j,25sep97,gnn  SENS beta feedback fixes01i,02sep97,spm  removed name conflicts with runtime DHCP client (SPR #9241)01h,26aug97,spm  major overhaul: included version 01j of dhcpcCommonLib.c                 to retain single-lease library for boot time use01g,12aug97,gnn  changes necessitated by MUX/END update.01f,02jun97,spm  changed DHCP option tags to prevent name conflicts (SPR #8667)                 and updated man pages01e,18apr97,spm  added call to dhcp_boot_client to reduce boot ROM size01d,15apr97,kbw  fixed manpage format01c,07apr97,spm  altered to use current value of configAll.h defines,                 rewrote documentation01b,29jan97,spm  added END driver support and modified to fit coding standards01a,14nov96,spm  created by removing unneeded functions from dhcpcLib.c*//*DESCRIPTIONThis library contains the interface for the client side of the Dynamic HostConfiguration Protocol (DHCP) used during system boot. DHCP is an extensionof BOOTP, the bootstrap protocol.  Like BOOTP, the protocol allows automaticsystem startup by providing an IP address, boot file name, and boot host'sIP address over a network.  Additionally, DHCP provides the complete set ofconfiguration parameters defined in the Host Requirements RFCs and allowsautomatic reuse of network addresses by specifying a lease duration for aset of configuration parameters.  This library is linked into the boot ROM image automatically if INCLUDE_DHCPC is defined at the time that image is constructed.HIGH-LEVEL INTERFACEThe VxWorks boot program uses this library to obtain configuration parameters with DHCP according to the client-server interaction detailed in RFC 2131 usingthe boot device specified in the boot parameters.  The DHCP client supportsdevices attached to the IP protocol with the MUX/END interface. It alsosupports BSD Ethernet devices attached to the IP protocol.To use DHCP, first build a boot ROM image with INCLUDE_DHCPC defined and set the appropriate flag in the boot parameters before initiating booting withthe "@" command.  The DHCP client will attempt to retrieve entries for theboot file name, and host IP address, as well as a subnet mask and broadcastaddress for the boot device.  If a target IP address is not available, theclient will retrieve those parameters in the context of a lease. Otherwise,it will search for permanent assignments using a simpler message exchange.Any entries retrieved with either method will only be used if the correspondingfields in the boot parameters are blank.NOTEAfter DHCP retrieves the boot parameters, the specified boot file is loadedand the system restarts. As a result, the boot-time DHCP client cannot renewany lease which may be associated with the assigned IP address.  To avoidpotential IP address conflicts while loading the boot file, the DHCPC_MIN_LEASEvalue should be set to exceed the file transfer time.  In addition, the bootfile must also contain the DHCP client library so that the lease obtainedbefore the restart can be renewed. Otherwise, the network initialization usingthe boot parameters will fail.  These restrictions do not apply if the targetIP address is entered manually since the boot parameters do not involve alease in that case.INTERNALThis module was created to reduce the size of the boot ROM image so thatthe DHCP client could be used with target architectures such as the MV147which have limited ROM capacity. The routines in this library are a modifiedversion of similar routines available to the user in the dhcpcLib library. These routines are only intended for use during boot time by the VxWorks system. Among other differences, they do not support multiple leases and they always apply configuration parameters to the underlying network device. They should only be called by the boot program.INCLUDE FILES: dhcpcBootLib.hSEE ALSO: dhcpcLib, RFC 1541, RFC 1533*//* includes */#include "dhcp/copyright_dhcp.h"#include "vxWorks.h"#include "wdLib.h"#include "semLib.h"#include "ioLib.h" 	/* ioctl() declaration */#include "taskLib.h" 	/* taskSpawn() declaration */#include "muxLib.h"#include <stdio.h>#include <stdlib.h>#include <unistd.h>#include <string.h>#include <errno.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 "dhcp/dhcpcCommonLib.h"#include "dhcpcBootLib.h"#include "bpfDrv.h"#include "end.h"#include "ipProto.h"/* defines */#define _BYTESPERWORD 		4 	/* Conversion factor for IP header */#define _DHCP_MAX_OPTLEN 	255 	/* Max. number of bytes in an option */#define _IPADDRLEN 		4 	/* Length of address in an ARP reply */#define _ETHER 			1 	/* Hardware type for Ethernet */                                        /* from assigned numbers RFC */#define _ETHERADDRLEN 		6 	/* Length of an Ethernet address */     /* Host requirements documents default values. */#define _HRD_MAX_DGRAM 	576 	/* Default maximum datagram size. */#define _HRD_IP_TTL 	64 	/* Default IP time-to-live (seconds) */#define _HRD_MTU 	576 	/* Default interface MTU */#define _HRD_ROUTER 	0xffffffff /* Default router solication */                                   /* address - 255.255.255.255 */#define _HRD_ARP_TIME 	60 	/* Default ARP cache timeout (seconds) */#define _HRD_TCP_TTL 	64 	/* Default TCP time-to-live (seconds) */#define _HRD_TCP_TIME 	7200 	/* Default TCP keepalive interval (seconds) */#define _DHCPC_MAX_DEVNAME      21      /* "/bpf/dhcpc" + max unit number */IMPORT struct bpf_insn dhcpfilter[];    /* Needed to update client port. */IMPORT struct bpf_program dhcpread;     /* Installs filter for DHCP messages */IMPORT int dhcpcBufSize;IMPORT BOOL _dhcpcBootFlag;/* globals */LEASE_DATA      dhcpcBootLeaseData;LEASE_DATA * 	pDhcpcBootLeaseData;int 		dhcpcBindType; 		/* Type of DHCP lease, if any. *//* locals */LOCAL int dhcpcOfferTimeout; 	/* Set externally when building image */LOCAL int dhcpcDefaultLease; 	/* Set externally when building image */LOCAL int dhcpcClientPort; 	/* Set externally when building image */LOCAL int dhcpcServerPort; 	/* Set externally when building image *//* forward declarations */IMPORT void dhcpcRead (void); 	/* Retrieve incoming DHCP messages */LOCAL void dhcpcBootCleanup (void);/********************************************************************************* dhcpcBootInit - set up the DHCP client parameters and data structures** This routine creates any necessary data structures and sets the client's * option request list to retrieve a subnet mask and broadcast address for the * network interface indicated by <pIf>.  The routine is executed automatically * by the boot program when INCLUDE_DHCPC is defined and the automatic * configuration option is set in the boot flags.  The network interface * specified by <pIf> is used to transmit and receive all DHCP messages during * the lease negotiation.  The DHCP client supports interfaces attached to the* IP protocol using the MUX/END interface and BSD Ethernet devices attached* to that protocol. The interface must be capable of sending broadcast* messages. The <maxSize> parameter specifies the maximum length supported for* any DHCP message, including the UDP and IP headers and the link level header.* The maximum length of the DHCP options field is based on this value or the* MTU size for the given interface, whichever is less. The smallest valid value* for the <maxSize> parameter is 576 bytes, corresponding to the minimum IP* datagram a host must accept. The MTU size of the network interface must be* large enough to handle those datagrams.** ERRNO: N/A* * RETURNS: Lease handle for later use, or NULL if lease startup fails.*/void * dhcpcBootInit    (    struct ifnet * pIf, 	/* network device used by client */    int 	serverPort,     /* port used by DHCP servers (default 67) */    int 	clientPort,     /* port used by DHCP clients (default 68) */    int 	maxSize, 	/* largest DHCP message supported, in bytes */    int 	offerTimeout,   /* interval to get additional DHCP offers */    int 	defaultLease,   /* default value for requested lease length */    int 	minLease        /* minimum accepted lease length */    )    {    struct dhcp_reqspec * 	pReqSpec;    LEASE_DATA * 		pBootLeaseData;    BOOL bsdFlag = FALSE;    int loop;    int offset = 0;    int bufSize; 	/* Receive buffer size (maxSize or MTU + BPF header) */    char bpfDevName [_DHCPC_MAX_DEVNAME];  /* "/bpf/dhcpc" + max unit number */    int bpfDev;    int result;    dhcpcServerPort = serverPort;    dhcpcClientPort = clientPort;    if (pIf == NULL)        {        printf ("Error: network device not specified.\n");        return (NULL);        }    if (muxDevExists (pIf->if_name, pIf->if_unit) == FALSE)        {        bsdFlag = TRUE;         }    /* Verify interface data sizes are appropriate for message. */    bufSize = pIf->if_mtu;    if (bufSize == 0)        {        printf ("Error: unusable network device.\n");        return (NULL);        }    if (bufSize < DHCP_MSG_SIZE)        {        /*         * Devices must accept messages equal to the minimum IP datagram         * of 576 bytes, which corresponds to a DHCP message with up to         * 312 bytes of options.         */        printf ("Error: unusable network device.\n");        return (NULL);        }    if (maxSize < DFLTDHCPLEN + UDPHL + IPHL)        {        /* The buffer size must also allow the minimum IP datagram. */        return (NULL);        }    if (bpfDrv () == ERROR)        {        return (NULL);        }    /* Select buffer size for BPF device less than or equal to the MTU size. */    bufSize += pIf->if_hdrlen;    if (bufSize > maxSize)        bufSize = maxSize;    bufSize += sizeof (struct bpf_hdr);    if (bpfDevCreate ("/bpf/dhcpc", 1, bufSize) == ERROR)        {        bpfDrvRemove ();        return (NULL);        }    /* Create and initialize storage for boot lease. */    pBootLeaseData = &dhcpcBootLeaseData;    pDhcpcBootLeaseData = pBootLeaseData;    dhcpcLeaseList = &pDhcpcBootLeaseData;    dhcpcMaxLeases = 1;      /* Only one DHCP session, for boot device. */    dhcpcDefaultLease = defaultLease;    dhcpcOfferTimeout = offerTimeout;    dhcpcMinLease = minLease;    /* Create signalling semaphore for event notification ring. */    dhcpcEventSem = semCCreate (SEM_Q_FIFO, 0);    if (dhcpcEventSem == NULL)        {        bpfDevDelete ("/bpf/dhcpc");        bpfDrvRemove ();        return (NULL);        }    /* Create event storage. */    dhcpcEventRing = rngCreate (EVENT_RING_SIZE);    if (dhcpcEventRing == NULL)        {        bpfDevDelete ("/bpf/dhcpc");        bpfDrvRemove ();        semDelete (dhcpcEventSem);        return (NULL);        }    /* Create message storage (matches number of elements in event ring). */    dhcpcMessageList = malloc (10 * sizeof (MESSAGE_DATA));    if (dhcpcMessageList == NULL)        {        bpfDevDelete ("/bpf/dhcpc");        bpfDrvRemove ();        semDelete (dhcpcEventSem);        rngDelete (dhcpcEventRing);        return (NULL);        }    /* Allocate (aligned) receive buffers based on maximum message size. */    for (loop = 0; loop < 10; loop++)        {        dhcpcMessageList [loop].msgBuffer = memalign (4, bufSize);        if (dhcpcMessageList [loop].msgBuffer == NULL)            break;        dhcpcMessageList [loop].writeFlag = TRUE;        }    if (loop < 10)        {        for (offset = 0; offset < loop; offset++)            free (dhcpcMessageList [offset].msgBuffer);        bpfDevDelete ("/bpf/dhcpc");        bpfDrvRemove ();        semDelete (dhcpcEventSem);        rngDelete (dhcpcEventRing);        free (dhcpcMessageList);        return (NULL);        }    /* Reset the message filter to use the specified client port. */    dhcpfilter [12].k = clientPort;    /* Get a BPF file descriptor to read/write DHCP messages. */    sprintf (bpfDevName, "/bpf/dhcpc%d", offset);    bpfDev = open (bpfDevName, 0, 0);    if (bpfDev < 0)        {        bpfDevDelete ("/bpf/dhcpc");        bpfDrvRemove ();        semDelete (dhcpcEventSem);        rngDelete (dhcpcEventRing);

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
午夜电影一区二区| 亚洲免费伊人电影| 色先锋资源久久综合| 免费在线观看视频一区| 中文字幕日本不卡| 精品少妇一区二区三区在线播放| 国产福利一区二区| 亚洲成av人片一区二区梦乃| 精品福利一二区| 日本道色综合久久| 国产成人午夜精品5599 | 日韩欧美国产综合在线一区二区三区| 国产福利精品导航| 另类小说一区二区三区| 一区二区三区在线观看欧美| 欧美国产乱子伦| 精品福利视频一区二区三区| 欧美肥妇bbw| 欧洲精品在线观看| 91在线视频官网| 东方aⅴ免费观看久久av| 香蕉久久一区二区不卡无毒影院| 日韩伦理电影网| 国产精品色婷婷| 久久网站最新地址| 欧美精品一区二区三区在线播放| 色噜噜狠狠色综合欧洲selulu | 欧美电影在线免费观看| 色屁屁一区二区| 色欧美乱欧美15图片| 99re亚洲国产精品| 99久久精品情趣| 99这里只有久久精品视频| 国产suv精品一区二区6| 日本成人超碰在线观看| 一区二区三区美女| 伊人一区二区三区| 亚洲永久免费视频| 洋洋av久久久久久久一区| 亚洲欧美国产毛片在线| 亚洲三级电影全部在线观看高清| 亚洲天堂2016| 亚洲自拍与偷拍| 视频一区免费在线观看| 婷婷综合久久一区二区三区| 三级不卡在线观看| 首页亚洲欧美制服丝腿| 日本视频一区二区| 久久综合综合久久综合| 日本一道高清亚洲日美韩| 日本欧美肥老太交大片| 国内外成人在线| 国产精品一区二区久久不卡| www.亚洲免费av| 欧美三日本三级三级在线播放| 色婷婷综合久久久| 69精品人人人人| 精品国产乱码久久久久久图片| 国产视频一区不卡| 亚洲欧美一区二区久久| 亚洲第一电影网| 激情小说亚洲一区| 国产成人免费视频网站高清观看视频| 国产福利精品导航| 欧美亚洲图片小说| 精品国产乱码久久久久久影片| 久久久久99精品一区| 亚洲精品一区二区三区精华液| 国产色综合一区| 亚洲主播在线观看| 久久99精品久久久久久国产越南 | 欧美性xxxxxxxx| 在线精品视频一区二区三四| 欧美日韩国产综合久久| 欧美精品一区二区三区久久久| 亚洲欧美一区二区在线观看| 亚洲午夜久久久久久久久电影网| 视频一区视频二区中文字幕| 国产福利一区在线| 欧美日韩精品欧美日韩精品| 久久亚洲私人国产精品va媚药| 亚洲欧美经典视频| 精品在线免费视频| 日本久久一区二区三区| 亚洲精品一区二区精华| 亚洲综合久久久久| 国产不卡免费视频| 911精品国产一区二区在线| 久久久欧美精品sm网站| 一级日本不卡的影视| 国产一区二区剧情av在线| 欧美丝袜丝交足nylons图片| 久久久久久久久蜜桃| 日韩成人一区二区三区在线观看| 国产成人免费视频精品含羞草妖精| 欧美日韩在线播放三区四区| 亚洲国产精品二十页| 日本欧美久久久久免费播放网| aaa欧美日韩| 久久免费看少妇高潮| 亚洲6080在线| 97国产精品videossex| 久久久精品国产99久久精品芒果| 香蕉影视欧美成人| 在线免费精品视频| 日本一区二区三区高清不卡| 手机精品视频在线观看| 在线视频亚洲一区| 欧美激情一区二区三区| 看片的网站亚洲| 在线播放中文一区| 亚洲最大的成人av| 99热99精品| 国产精品全国免费观看高清| 久久国产乱子精品免费女| 9191精品国产综合久久久久久 | 成人亚洲一区二区一| 欧美肥妇毛茸茸| 亚洲精品高清在线观看| 成人自拍视频在线| 久久久777精品电影网影网 | 亚洲免费在线观看视频| www.日韩av| 国产精品传媒入口麻豆| 国产成人精品www牛牛影视| 欧美成人精品福利| 喷水一区二区三区| 欧美浪妇xxxx高跟鞋交| 亚洲黄色免费电影| 欧美亚洲日本国产| 亚洲成人福利片| 欧美日韩一区二区三区在线| 亚洲成a人片综合在线| 在线精品亚洲一区二区不卡| 亚洲欧美偷拍另类a∨色屁股| av色综合久久天堂av综合| 中文字幕一区在线观看| 97久久久精品综合88久久| 亚洲人成在线观看一区二区| 91久久一区二区| 亚洲午夜国产一区99re久久| 欧美日韩免费在线视频| 午夜成人免费视频| 91精品国产综合久久精品图片 | 尤物视频一区二区| 欧美日韩中文另类| 男女视频一区二区| 日韩欧美亚洲一区二区| 国产一区二区精品久久99| 中文字幕av一区 二区| a级精品国产片在线观看| 亚洲欧美日韩小说| 欧美三级电影精品| 麻豆精品在线看| 欧美国产激情一区二区三区蜜月| 成人免费视频caoporn| 亚洲精品欧美激情| 91精品黄色片免费大全| 极品少妇xxxx精品少妇偷拍| 中文在线资源观看网站视频免费不卡 | 美女看a上一区| 日产国产高清一区二区三区| 色94色欧美sute亚洲线路二| 福利一区二区在线观看| 91精品国产aⅴ一区二区| 日本亚洲视频在线| 久久久国产精品午夜一区ai换脸| caoporn国产一区二区| 午夜日韩在线电影| 国产无遮挡一区二区三区毛片日本| 不卡视频在线观看| 亚洲一区二区三区视频在线播放 | 亚洲日本在线视频观看| 欧美三级一区二区| 国产精品主播直播| 亚洲一区二区成人在线观看| 日韩免费在线观看| www.久久精品| 久久精品国产精品亚洲红杏| 国产精品美女久久久久久久网站| 欧美精品乱人伦久久久久久| 国产成人精品在线看| 亚洲成人av一区二区| 国产亚洲欧洲997久久综合 | 欧美一二三在线| 成人h版在线观看| 日韩av在线发布| 综合亚洲深深色噜噜狠狠网站| 日韩视频国产视频| 一本色道a无线码一区v| 国产曰批免费观看久久久| 夜夜爽夜夜爽精品视频| 国产清纯美女被跳蛋高潮一区二区久久w | 国产精品一区二区三区网站| 一区二区不卡在线视频 午夜欧美不卡在| 日韩三级伦理片妻子的秘密按摩| 99精品视频一区二区| 激情六月婷婷久久| 天涯成人国产亚洲精品一区av| 国产精品久久99|