亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
91精品国产综合久久久久久久 | 一本久久精品一区二区| 亚洲男同1069视频| 欧美精品久久99| av电影天堂一区二区在线| 日韩综合一区二区| 亚洲天天做日日做天天谢日日欢 | 国产综合色视频| 亚洲视频中文字幕| 精品国产一区久久| 欧美在线高清视频| thepron国产精品| 韩国精品主播一区二区在线观看 | 亚洲自拍都市欧美小说| 国产欧美一区二区精品久导航 | 在线亚洲免费视频| 成人毛片老司机大片| 国产一区二区女| 日韩女优制服丝袜电影| 欧美日韩成人综合| 欧美这里有精品| 91视频在线看| 91女神在线视频| 99久久亚洲一区二区三区青草| 日韩一级片网站| 精品一区二区在线看| 男女视频一区二区| 婷婷夜色潮精品综合在线| 亚洲三级理论片| 亚洲欧美日韩国产一区二区三区 | 亚洲精品成人精品456| 中文字幕在线观看一区| 国产精品免费久久| 欧美国产日韩亚洲一区| 欧美国产禁国产网站cc| 欧美国产日韩精品免费观看| 中文字幕av一区二区三区高| 国产欧美一区二区精品秋霞影院 | 精品国产乱码久久久久久蜜臀| 免费人成在线不卡| 美女视频一区在线观看| 男人的天堂久久精品| 日本午夜精品一区二区三区电影| 欧美aaaaaa午夜精品| 久久99精品久久久久久国产越南| 国产永久精品大片wwwapp| 国产三级精品三级| 欧美日韩视频在线第一区| 欧美日韩亚洲综合在线| 欧美老肥妇做.爰bbww视频| 69堂亚洲精品首页| 日韩欧美亚洲一区二区| 久久综合色8888| 国产精品日日摸夜夜摸av| 国产精品毛片久久久久久| 亚洲精品国产第一综合99久久 | 91视频国产资源| 在线亚洲精品福利网址导航| 欧美日韩一级视频| 精品国产髙清在线看国产毛片| 久久久久久久久久看片| 亚洲欧美在线观看| 欧美日韩国产成人在线91| 欧美大片一区二区| 国产欧美一区二区精品性色| 亚洲精品国久久99热| 青青草原综合久久大伊人精品| 国产一区二区三区四区五区美女| 成人的网站免费观看| 亚洲已满18点击进入久久| 久久综合五月天婷婷伊人| 中文字幕一区二区三区色视频| 亚洲综合一区在线| 精品亚洲成a人在线观看| av午夜精品一区二区三区| 欧美日韩高清不卡| 国产三级欧美三级日产三级99| 亚洲免费电影在线| 麻豆成人av在线| 91亚洲午夜精品久久久久久| 欧美一区二区黄色| 亚洲欧美综合在线精品| 美女国产一区二区| 色偷偷成人一区二区三区91| 欧美成人三级在线| 一区二区三区在线免费观看 | 国产精品自拍在线| 欧美写真视频网站| 欧美激情综合五月色丁香小说| 亚洲国产欧美在线人成| 国产欧美日韩综合| 日本不卡一二三| 色婷婷综合久久久久中文一区二区 | 国产精品丝袜久久久久久app| 日韩一区日韩二区| 久久国产生活片100| 欧洲中文字幕精品| 亚洲国产成人午夜在线一区| 日韩不卡手机在线v区| 色综合久久88色综合天天6| 精品福利av导航| 日韩中文字幕麻豆| 日本道在线观看一区二区| 国产视频视频一区| 久久精品国产久精国产| 精品婷婷伊人一区三区三| 国产精品久久毛片a| 国内欧美视频一区二区| 69精品人人人人| 亚洲线精品一区二区三区| 97精品国产露脸对白| 国产喂奶挤奶一区二区三区| 美女视频免费一区| 亚洲va韩国va欧美va| 色综合视频一区二区三区高清| 久久久久成人黄色影片| 看电视剧不卡顿的网站| 欧美精品三级日韩久久| 亚洲一区二区在线观看视频| 99久久99久久精品国产片果冻| 日本一区二区电影| 色吊一区二区三区| 国产调教视频一区| 中文字幕成人av| 成人综合在线观看| 国产色产综合色产在线视频| 久久99久久99小草精品免视看| 欧美一区二区三级| 日韩精品色哟哟| 欧美精品日韩精品| 亚洲成人免费视频| 欧美精品99久久久**| 亚洲.国产.中文慕字在线| 欧美性色aⅴ视频一区日韩精品| 亚洲欧美另类图片小说| 色诱亚洲精品久久久久久| 亚洲免费三区一区二区| 色狠狠一区二区| 亚洲国产毛片aaaaa无费看 | 色国产综合视频| 亚洲精品视频自拍| 亚洲综合成人网| 欧美日本在线观看| 青草国产精品久久久久久| 精品裸体舞一区二区三区| 国产一区二区剧情av在线| 国产日产欧美一区| 99re66热这里只有精品3直播 | 717成人午夜免费福利电影| 亚洲一区二区欧美| 欧美色视频一区| 老汉av免费一区二区三区| 久久久亚洲精品石原莉奈| 成人av高清在线| 亚洲成人自拍一区| 欧美一区二区福利在线| 国产成人高清视频| 亚洲欧美一区二区久久| 欧美乱熟臀69xxxxxx| 激情文学综合插| 中文字幕亚洲在| 欧美男人的天堂一二区| 极品美女销魂一区二区三区 | 久久精品国产99久久6| 欧美激情一区在线观看| 91久久精品一区二区| 蜜臀91精品一区二区三区| 国产亚洲人成网站| 一区二区成人在线视频| 日韩欧美一区二区在线视频| 丰满亚洲少妇av| 亚洲h在线观看| 国产女主播在线一区二区| 在线观看不卡视频| 极品美女销魂一区二区三区| 亚洲日本丝袜连裤袜办公室| 69精品人人人人| 欧美精品一卡二卡| 精品伊人久久久久7777人| 亚洲四区在线观看| 日韩女同互慰一区二区| 91在线国产福利| 久久国产精品一区二区| 亚洲精品伦理在线| 久久久99精品久久| 欧美日本在线观看| www.欧美色图| 久久精品国产77777蜜臀| 一区二区三区免费观看| 久久久99精品免费观看| 欧美日韩国产精选| kk眼镜猥琐国模调教系列一区二区 | 成人小视频在线| 全部av―极品视觉盛宴亚洲| 国产精品福利在线播放| 日韩欧美成人激情| 欧美日韩国产首页| 91尤物视频在线观看| 国产+成+人+亚洲欧洲自线| 日韩免费看的电影|