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

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

?? bootplib.c

?? vxwork源代碼
?? C
?? 第 1 頁 / 共 5 頁
字號:
/* bootpLib.c - Bootstrap Protocol (BOOTP) client library *//* Copyright 1984 - 2001 Wind River Systems, Inc. */#include "copyright_wrs.h"/*modification history--------------------01x,07dec01,wap  Use htons() to set ip_len and ip_id fields in IP header,                 and htonl() to set the XID field in the packet body/BPF filter                 so that BOOTP works on little-endian targets (SPR #72059)01w,15oct01,rae  merge from truestack ver 01z, base 01v01v,17mar99,spm  added support for identical unit numbers (SPR #20913)01u,04sep98,ham  corrected lack of params for etherInputHookAdd(),SPR#2190901t,28aug98,n_s  corrected MAC address comparison in bootpInputHook. spr #2090201s,17jul97,dgp  doc: correct unsupported interfaces per SPR 894002c,14dec97,jdi  doc: cleanup.02b,10dec97,gnn  making man page fixes02a,08dec97,gnn  END code review fixes01z,03dec97,spm  corrected parameter description for bootpMsgSend (SPR #9401);                 minor changes to man pages and code spacing01y,03oct97,gnn  removed references to endDriver global.01x,25sep97,gnn  SENS beta feedback fixes01w,26aug97,spm  fixed bootpParamsGet - gateway not retrieved (SPR #9137)01v,12aug97,gnn  changes necessitated by MUX/END update.01u,30apr97,jag  man page edit for function bootParamsGet()01t,07apr97,spm  changed BOOTP interface to DHCP style: all options supported01s,17dec96,gnn  added code to handle the new etherHooks and END stuff.01r,08nov96,spm  Updated example of bootpParamsGet() for SPR 712001q,22sep96,spm  Fixed SPR 7120: added support for gateways to bootpParamsGet()01p,01feb96,gnn	 added the end of vendor data (0xff) to the request packet		 we send01o,16jan94,rhp  fix typo in library man page01n,17oct94,rhp  remove docn reference to bootpdLib (SPR#2351)01n,22sep92,jdi  documentation cleanup.01m,14aug92,elh  documentation changes.01l,11jun92,elh  modified parameters to bootpParamsGet.01k,26may92,rrr  the tree shuffle		  -changed includes to have absolute path from h/01j,16apr92,elh	 moved routines shared by icmp to icmpLib.01i,28feb92,elh  ansified.01h,27aug91,elh  rewritten to use standard bootp protocol,		 redesigned to be more modular, rewrote documentation.01g,15aug90,dnw  added slot parameter to bootpParamsGet()	   +hjb  fixed bug in bootpForwarder() not setting hw addr in arp ioctl01f,12aug90,dnw  changed bootpParamsGet() to check every tick for reply message                 instead of every 4 seconds, for faster response.		 changed bootpParamsGet() to print '.' every time it broadcasts                 request.01e,12aug90,hjb  major redesign and implementation of the protocol01d,07may90,hjb  made bootp IP checksum portable; modifications to the protocol		 for better forwarding service.01c,19apr90,hjb  minor fixups bootpRequestSend(), added protocol extension		 to solve the routing problem when bootp forwarder is used.01b,11apr90,hjb  de-linted.01a,11mar90,hjb  written.*//*DESCRIPTIONThis library implements the client side of the Bootstrap Protocol(BOOTP).  This protocol allows a host to initialize automatically by obtaining its IP address, boot file name, and boot host's IP address overa network. The bootpLibInit() routine links this library into theVxWorks image. This happens automatically if INCLUDE_BOOTP is definedat the time the image is built.CONFIGURATION INTERFACEWhen used during boot time, the BOOTP library attempts to retrievethe required configuration information from a BOOTP server usingthe interface described below. If it is successful, the remainderof the boot process continues as if the information were entered manually.HIGH-LEVEL INTERFACEThe bootpParamsGet() routine retrieves a set of configuration parametersaccording to the client-server interaction described in RFC 951 andclarified in RFC 1542. The parameter descriptor structure it accepts asan argument allows the retrieval of any combination of the options describedin RFC 1533 (if supported by the BOOTP server and specified in the database).During the default system boot process, the routine obtains the boot file, theInternet address, and the host Internet address.  It also obtains the subnetmask and the Internet address of an IP router, if available.LOW-LEVEL INTERFACEThe bootpMsgGet() routine transmits an arbitrary BOOTP request message andprovides direct access to any reply. This interface provides a method forsupporting alternate BOOTP implementations which may not fully comply withthe recommended behavior in RFC 1542. For example, it allows transmissionof BOOTP messages to an arbitrary UDP port and provides access to thevendor-specific field to handle custom formats which differ from the RFC 1533implementation. The bootpParamsGet() routine already extracts all options which that document defines.EXAMPLEThe following code fragment demonstrates use of the BOOTP library: .CS    #include "bootpLib.h"    #define _MAX_BOOTP_RETRIES 	1    struct bootpParams 	bootParams;    struct in_addr 	clntAddr;    struct in_addr 	hostAddr;    char 		bootFile [SIZE_FILE];    int 		subnetMask;    struct in_addr_list routerList;    struct in_addr 	gateway;    struct ifnet * 	pIf;    /@ Retrieve the interface descriptor of the transmitting device. @/    pIf = ifunit ("ln0");    if (pIf == NULL)        {        printf ("Device not found.\n");        return (ERROR);        }    /@ Setup buffers for information from BOOTP server. @/    bzero ( (char *)&clntAddr, sizeof (struct in_addr));    bzero ( (char *)&hostAddr, sizeof (struct in_addr));    bzero (bootFile, SIZE_FILE);    subnetMask  = 0;    bzero ( (char *)&gateway, sizeof (struct in_addr));    /@ Set all pointers in parameter descriptor to NULL. @/    bzero ((char *)&bootParams, sizeof (struct bootpParams));    /@ Set pointers corresponding to desired options. @/    bootParams.netmask = (struct in_addr *)&subnetMask;    routerlist.addr = &gateway;    routerlist.num = 1;    bootParams.routers = &routerlist;    /@     @ Send request and wait for reply, retransmitting as necessary up to     @ given limit. Copy supplied entries into buffers if reply received.     @/    result = bootpParamsGet (pIf, _MAX_BOOTP_RETRIES,                          &clntAddr, &hostAddr, NULL, bootFile, &bootParams);    if (result != OK)        return (ERROR);.CEINCLUDE FILES: bootpLib.hSEE ALSO: RFC 951, RFC 1542, RFC 1533,INTERNALThe diagram below defines the structure chart of bootpLib.                                      |             |                  v             v                bootpLibInit bootpParamsGet		     / 		\	    |	 	 |	    v		 v	           bootpMsgGet   bootpParamsFill*//* includes */#include "vxWorks.h"#include "ioLib.h"#include "bootpLib.h"#include "m2Lib.h"      /* M2_blah  */#include "bpfDrv.h"#include "vxLib.h" 	/* checksum() declaration */#include "netinet/ip.h"#include "netinet/udp.h"#include "netinet/if_ether.h"#include "stdio.h" 	/* sprintf() declaration */#include "stdlib.h" 	/* rand() declaration */#include "end.h"#include "muxLib.h"/* defines */#define _BOOTP_MAX_DEVNAME 	13 		/* "/bpf/bootpc0" *//* locals */LOCAL int       bootpConvert (int);LOCAL BOOL 	bootpInitialized;LOCAL struct    {    struct ip           ih;             /* IP header            */    struct udphdr       uh;             /* UDP header           */    BOOTP_MSG           bp;             /* Bootp message        */    } bootpMsg;LOCAL char * pMsgBuffer; 	/* Storage for BOOTP replies from BPF. */LOCAL int bootpBufSize; 	/* Size of storage buffer. */    /* Berkeley Packet Filter instructions for catching BOOTP messages. */LOCAL struct bpf_insn bootpfilter[] = {  BPF_STMT(BPF_LD+BPF_TYPE,0),                /* Save lltype in accumulator */  BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, ETHERTYPE_IP, 0, 22),  /* IP packet? */  /*   * The remaining statements use the (new) BPF_HLEN alias to avoid any   * link-layer dependencies. The expected destination port and transaction   * ID values are altered when necessary by the BOOTP routines to match the   * actual settings.   */  BPF_STMT(BPF_LD+BPF_H+BPF_ABS+BPF_HLEN, 6),    /* A <- IP FRAGMENT field */  BPF_JUMP(BPF_JMP+BPF_JSET+BPF_K, 0x1fff, 20, 0),         /* OFFSET == 0 ? */  BPF_STMT(BPF_LDX+BPF_HLEN, 0),          /* X <- frame data offset */  BPF_STMT(BPF_LD+BPF_B+BPF_IND, 9),      /* A <- IP_PROTO field */  BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, IPPROTO_UDP, 0, 17),     /* UDP ? */  BPF_STMT(BPF_LD+BPF_HLEN, 0),           /* A <- frame data offset */  BPF_STMT(BPF_LDX+BPF_B+BPF_MSH+BPF_HLEN, 0), /* X <- IPHDR LEN field */  BPF_STMT(BPF_ALU+BPF_ADD+BPF_X, 0),     /* A <- start of UDP datagram */  BPF_STMT(BPF_MISC+BPF_TAX, 0),          /* X <- start of UDP datagram */  BPF_STMT(BPF_LD+BPF_H+BPF_IND, 2),      /* A <- UDP DSTPORT */  BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, 68, 0, 11), /* check DSTPORT */  BPF_STMT(BPF_LD+BPF_H+BPF_ABS+BPF_HLEN, 2),  /* A <- IP LEN field */  BPF_JUMP(BPF_JMP+BPF_JGE+BPF_K, BOOTPLEN + UDPHL + IPHL, 0, 9),                                                 /* Correct IP length? */  BPF_STMT(BPF_LD+BPF_H+BPF_IND, 4),      /* A <- UDP LEN field */  BPF_JUMP(BPF_JMP+BPF_JGE+BPF_K, BOOTPLEN + UDPHL, 0, 7),                                                 /* Correct UDP length? */  BPF_STMT(BPF_LD+BPF_B+BPF_IND, 8),      /* A <- BOOTP op field */  BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, BOOTREPLY, 0, 5),  BPF_STMT(BPF_LD+BPF_W+BPF_IND, 12),      /* A <- BOOTP xid field */  BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, -1, 0, 3),   /* -1 replaced with real xid */  BPF_STMT(BPF_LD+BPF_W+BPF_IND, 244),    /* A <- BOOTP options */  BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, 0x63825363, 0, 1),                                                 /* Matches magic cookie? */  BPF_STMT(BPF_RET+BPF_K+BPF_HLEN, BOOTPLEN + UDPHL + IPHL),                                           /*                                            * ignore data beyond expected                                            * size (some drivers add padding).                                            */  BPF_STMT(BPF_RET+BPF_K, 0)          /* unrecognized message: ignore frame */  };LOCAL struct bpf_program bootpread = {    sizeof (bootpfilter) / sizeof (struct bpf_insn),    bootpfilter    };LOCAL u_char		magicCookie1048 [4] = VM_RFC1048;							/* 1048 cookie type  */#define VEOF_RFC1048 {255}LOCAL u_char		endOfVend[1] = VEOF_RFC1048;LOCAL void bootpParamsFill (struct in_addr *, struct in_addr *, char *,                            char *, struct bootpParams *, BOOTP_MSG *);LOCAL u_char * bootpTagFind (u_char *, int, int *);/********************************************************************************* bootpLibInit - BOOTP client library initialization** This routine creates and initializes the global data structures used by* the BOOTP client library to obtain configuration parameters. The <maxSize>* parameter specifies the largest link level header for all supported devices.* This value determines the maximum length of the outgoing IP packet containing* a BOOTP message.** This routine must be called before using any other library routines. The* routine is called automatically if INCLUDE_BOOTP is defined at the time* the system is built and uses the BOOTP_MAXSIZE configuration setting* for the <maxSize> parameter.** RETURNS: OK, or ERROR if initialization fails.** ERRNO: S_bootpLib_MEM_ERROR;**/STATUS bootpLibInit    (    int 	maxSize 	/* largest link-level header, in bytes */    )    {    int bufSize; 	/* Size of receive buffer (BOOTP msg + BPF header) */    if (bootpInitialized)        return (OK);    if (bpfDrv () == ERROR)        {        return (ERROR);        }    bufSize = maxSize + BOOTPLEN + UDPHL + IPHL + sizeof (struct bpf_hdr);    if (bpfDevCreate ("/bpf/bootpc", 1, bufSize) == ERROR)        {        bpfDrvRemove ();        return (ERROR);        }    /* Allocate receive buffer based on maximum message size. */    pMsgBuffer = memalign (4, bufSize);    if (pMsgBuffer == NULL)        {        bpfDevDelete ("/bpf/bootpc");        bpfDrvRemove ();        errno = S_bootpLib_MEM_ERROR;        return (ERROR);        }    bootpBufSize = bufSize;    bootpInitialized = TRUE;    return (OK);    }/******************************************************************************** bootpParamsGet - retrieve boot parameters using BOOTP** This routine performs a BOOTP message exchange according to the process* described in RFC 1542, so the server and client UDP ports are always* equal to the defined values of 67 and 68.** The <pIf> argument indicates the network device which will be used to send* and receive BOOTP messages. The BOOTP client only supports devices attached* to the IP protocol with the MUX/END interface. The MTU size must be large* enough to receive an IP packet of 328 bytes (corresponding to the BOOTP* message length of 300 bytes). The specified device also must be capable of* sending broadcast messages, unless this routine sends the request messages* directly to the IP address of a specific server.** The <maxSends> parameter specifies the total number of requests before* before this routine stops waiting for a reply. After the final request,* this routine will wait for the current interval before returning error.* The timeout interval following each request follows RFC 1542, beginning* at 4 seconds and doubling until a maximum limit of 64 seconds.** The <pClientAddr> parameter provides optional storage for the assigned* IP address from the `yiaddr' field of a BOOTP reply. Since this routine* can execute before the system is capable of accepting unicast datagrams* or responding to ARP requests for a specific IP address, the corresponding* `ciaddr' field in the BOOTP request message is equal to zero.** The <pServerAddr> parameter provides optional storage for the IP address* of the responding server (from the `siaddr' field of a BOOTP reply).* This routine broadcasts the BOOTP request message unless this buffer* is available (i.e. not NULL) and contains the explicit IP address of a* BOOTP server as a non-zero value.** The <pHostName> parameter provides optional storage for the server's* host name (from the `sname' field of a BOOTP reply). This routine also* copies any initial string in that buffer into the `sname' field of the* BOOTP request (which restricts booting to a specified host).** The <pBootFile> parameter provides optional storage for the boot file* name (from the `file' field of a BOOTP reply). This routine also copies* any initial string in that buffer into the `file' field of the BOOTP* request message, which typically supplies a generic name to the server.** The remaining fields in the BOOTP request message use the values which* RFC 1542 defines. In particular, the `giaddr' field is set to zero and* the suggested "magic cookie" is always inserted in the (otherwise empty)* `vend' field.* The <pBootpParams> argument provides access to any options defined in

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美亚洲国产一区二区三区va| 免费成人小视频| 91在线观看地址| 1024成人网| 欧美三级韩国三级日本三斤| 五月天精品一区二区三区| 国产免费久久精品| 国产成人在线观看| 亚洲免费电影在线| 91精品综合久久久久久| 另类的小说在线视频另类成人小视频在线 | 日本中文一区二区三区| 555夜色666亚洲国产免| 国产一区二区三区免费看| 国产日本一区二区| 91麻豆产精品久久久久久| 亚洲久草在线视频| 69精品人人人人| 国产一区二区三区在线看麻豆| 久久久久国产精品人| 成人精品一区二区三区四区| 亚洲高清在线精品| 久久久久久电影| 成人18视频日本| 午夜精品福利在线| 国产午夜亚洲精品羞羞网站| 成人黄色国产精品网站大全在线免费观看 | 国产日韩欧美制服另类| 91麻豆蜜桃一区二区三区| 免费成人美女在线观看| 成人欧美一区二区三区在线播放| 91精品综合久久久久久| 成人av网站免费观看| 日韩成人一级片| 亚洲欧洲精品天堂一级| 欧美一区二区三区免费观看视频 | 97国产一区二区| 久久精品999| 亚洲精品综合在线| 久久先锋资源网| 91 com成人网| 色综合天天综合色综合av| 国产在线播放一区| 亚洲国产裸拍裸体视频在线观看乱了 | 国产精品美女久久久久高潮| 欧美日韩aaaaaa| 成人高清av在线| 精品一区中文字幕| 午夜精品久久久久久| 亚洲欧美一区二区三区孕妇| 日韩精品专区在线| 欧美日韩一区二区三区四区| 99久久精品国产一区二区三区| 美女在线观看视频一区二区| 一区二区三区在线高清| 国产精品伦理一区二区| 日韩欧美一级特黄在线播放| 欧美日本视频在线| 在线视频一区二区免费| 99久久夜色精品国产网站| 久久精品国产77777蜜臀| 亚洲国产视频一区二区| 一区二区三区四区高清精品免费观看| 国产精品全国免费观看高清 | 最新高清无码专区| 国产蜜臀av在线一区二区三区| 欧美va日韩va| 日韩一区二区三区三四区视频在线观看| 色婷婷av久久久久久久| 99久久综合狠狠综合久久| 国产成人午夜精品影院观看视频| 久久99精品国产麻豆婷婷 | 欧美一区二区女人| 欧美精品 国产精品| 欧美日韩大陆一区二区| 欧美肥妇bbw| 欧美剧情电影在线观看完整版免费励志电影| 99久久精品国产麻豆演员表| 99久久久久免费精品国产| 97国产一区二区| 在线视频你懂得一区| 欧美日韩国产综合草草| 欧美片网站yy| 欧美一区二区在线免费观看| 91麻豆精品国产综合久久久久久| 制服.丝袜.亚洲.中文.综合 | 久久青草欧美一区二区三区| 精品国产sm最大网站免费看| 精品福利视频一区二区三区| 久久久91精品国产一区二区三区| 久久久久国产精品厨房| 国产精品视频九色porn| 日韩一区中文字幕| 午夜精品久久久久久久久| 蜜臀精品一区二区三区在线观看| 国产综合成人久久大片91| 国产ts人妖一区二区| proumb性欧美在线观看| 色88888久久久久久影院野外| 欧美日韩国产一二三| 日韩精品专区在线影院观看| 国产三级精品在线| 亚洲欧美激情插| 欧美aaaaa成人免费观看视频| 久国产精品韩国三级视频| 成人国产精品免费观看动漫| 在线免费观看日本一区| 日韩午夜在线播放| 国产精品激情偷乱一区二区∴| 亚洲在线成人精品| 男女男精品视频| 成人性色生活片| 欧美三级资源在线| 久久久久久久综合| 亚洲精品网站在线观看| 日韩电影一二三区| 成人免费看黄yyy456| 91精品久久久久久久99蜜桃| 中文字幕欧美日韩一区| 午夜欧美一区二区三区在线播放| 精品一区二区久久| 色综合中文字幕国产| 欧美人狂配大交3d怪物一区| 久久亚洲影视婷婷| 亚洲大片免费看| 懂色av一区二区三区蜜臀| 欧美日韩国产经典色站一区二区三区| 精品99一区二区| 亚洲已满18点击进入久久| 国产精品一区二区无线| 6080日韩午夜伦伦午夜伦| 国产精品毛片久久久久久| 男男成人高潮片免费网站| 96av麻豆蜜桃一区二区| xf在线a精品一区二区视频网站| 亚洲国产精品精华液网站| 国产成人精品免费网站| 欧美一区二区三区系列电影| 亚洲人成在线观看一区二区| 国产真实乱子伦精品视频| 欧美日韩精品一区二区三区 | 亚洲午夜久久久久| 成人av电影在线| 国产亚洲婷婷免费| 免费在线观看成人| 欧美日韩激情在线| 一区二区欧美精品| 99久久久精品| 中国色在线观看另类| 精品无码三级在线观看视频| 欧美美女一区二区在线观看| 亚洲与欧洲av电影| 一本大道久久a久久综合婷婷| 中文字幕高清一区| 国产剧情一区二区| 久久久久久久免费视频了| 久久精品国产亚洲高清剧情介绍 | 成人免费视频国产在线观看| 精品国产91亚洲一区二区三区婷婷| 亚洲成人先锋电影| 在线观看免费亚洲| 一区二区三区鲁丝不卡| 91在线看国产| 成人欧美一区二区三区视频网页 | 91色在线porny| 中文字幕亚洲电影| 99精品国产一区二区三区不卡| 国产亚洲精品7777| 丁香六月综合激情| 国产精品热久久久久夜色精品三区| 成人综合在线网站| 国产精品不卡在线| 色8久久人人97超碰香蕉987| 亚洲一区二区av电影| 欧美日韩美女一区二区| 日本网站在线观看一区二区三区| 欧美一区二区三区在线| 久久精品国产亚洲aⅴ| 2024国产精品| 成人av免费网站| 亚洲一区中文日韩| 欧美精品色一区二区三区| 另类调教123区| 国产精品视频你懂的| 91丨porny丨户外露出| 亚洲成精国产精品女| 日韩视频一区在线观看| 国产主播一区二区三区| 国产欧美日韩视频一区二区 | 欧美日韩在线播放| 老司机精品视频在线| 中文天堂在线一区| 欧美在线不卡视频| 久久精品国产澳门| 国产精品国产自产拍在线| 欧美人成免费网站| 国产乱码一区二区三区| 亚洲伦在线观看| 欧美一区二区二区| 成人看片黄a免费看在线|