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

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

?? bootplib.c

?? vxworks的完整的源代碼
?? C
?? 第 1 頁(yè) / 共 5 頁(yè)
字號(hào):
/* 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

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美精品粉嫩高潮一区二区| 亚洲午夜电影在线观看| 日韩欧美成人激情| 91麻豆精品国产91久久久使用方法| 日本福利一区二区| 欧美色图12p| 欧美日韩中字一区| 欧美高清性hdvideosex| 91精品国产综合久久久久久久| 欧美日韩在线播放三区| 欧美精品久久一区| 精品国产凹凸成av人导航| 久久―日本道色综合久久| 国产亚洲精久久久久久| 中文字幕av免费专区久久| 亚洲欧洲精品一区二区三区不卡| 亚洲男同性恋视频| 亚洲一区影音先锋| 日日夜夜免费精品| 国内一区二区在线| 国产成人精品免费网站| 99国产麻豆精品| 欧美日韩你懂得| 欧美成人精品高清在线播放 | 久久久久久亚洲综合| 国产人成一区二区三区影院| 亚洲欧洲精品天堂一级| 亚洲高清中文字幕| 久久se精品一区二区| 从欧美一区二区三区| 91久久精品一区二区| 91精品国产色综合久久不卡电影| 亚洲精品一区二区三区精华液 | 亚洲一二三四久久| 日韩av一区二区在线影视| 国内精品不卡在线| 一本大道久久a久久综合| 欧美久久久久久久久久| 国产视频一区在线播放| 亚洲国产精品久久一线不卡| 国内精品久久久久影院薰衣草| 97精品久久久久中文字幕 | 2014亚洲片线观看视频免费| 国产精品情趣视频| 偷拍日韩校园综合在线| 国产91在线观看丝袜| 欧美色视频一区| 中文字幕精品—区二区四季| 亚洲国产sm捆绑调教视频 | 91福利区一区二区三区| 欧美哺乳videos| 亚洲裸体xxx| 经典一区二区三区| 欧洲在线/亚洲| 亚洲国产电影在线观看| 午夜激情一区二区| 成人av网址在线观看| 欧美精品一卡两卡| 亚洲色图视频网| 国产麻豆欧美日韩一区| 欧美日韩一区二区三区四区五区| 久久夜色精品国产欧美乱极品| 亚洲美腿欧美偷拍| 国产成人免费视频网站| 欧美一区二区日韩一区二区| 亚洲欧洲成人自拍| 激情小说亚洲一区| 精品视频色一区| 国产精品久久久久一区二区三区| 奇米一区二区三区| 欧美图区在线视频| 亚洲欧美韩国综合色| 国产精品一区二区x88av| 91精品国产色综合久久ai换脸| 亚洲男同性视频| 成人av资源在线| 久久综合网色—综合色88| 日本网站在线观看一区二区三区| 色欧美片视频在线观看 | 精品一区二区三区av| 欧美日韩一区三区四区| 亚洲黄色录像片| av在线不卡电影| 中文字幕av不卡| 国产主播一区二区三区| 日韩欧美综合在线| 日韩精品高清不卡| 欧洲av一区二区嗯嗯嗯啊| 亚洲三级小视频| 99麻豆久久久国产精品免费 | 午夜免费久久看| 欧美在线免费观看视频| 亚洲男人天堂av| 色综合一区二区| 综合久久久久久| 不卡在线视频中文字幕| 国产农村妇女精品| 国产精品主播直播| 久久久国产综合精品女国产盗摄| 毛片基地黄久久久久久天堂| 欧美午夜一区二区三区免费大片| 国产精品三级视频| 成人av动漫在线| 中国色在线观看另类| 国产麻豆成人传媒免费观看| 久久综合久色欧美综合狠狠| 久久国产精品99精品国产| 日韩美女视频一区二区在线观看| 日韩av在线免费观看不卡| 欧美一区二区三区日韩| 日韩黄色小视频| 欧美一级夜夜爽| 久久成人精品无人区| 精品国产1区2区3区| 国产一区二区三区免费在线观看| 26uuu亚洲综合色欧美| 国产精品一二三四| 国产精品久久久久一区| 91啦中文在线观看| 一区二区三区在线免费观看| 欧美性猛交xxxxxx富婆| 日产欧产美韩系列久久99| 精品成人在线观看| 国产成人精品一区二区三区四区| 亚洲欧洲av色图| 欧美自拍偷拍一区| 日日夜夜免费精品| 欧美大片一区二区三区| 国产中文一区二区三区| 中文字幕人成不卡一区| 欧美色精品天天在线观看视频| 麻豆成人免费电影| 精品国产一区二区三区忘忧草| 国产裸体歌舞团一区二区| 亚洲色图视频网站| 这里只有精品99re| 国产高清久久久久| 亚洲免费观看高清完整| 制服丝袜亚洲网站| 国产在线视频不卡二| 综合av第一页| 欧美二区三区的天堂| 国产成人精品一区二| 亚洲国产精品尤物yw在线观看| 精品国产一区二区三区不卡 | 精品视频一区二区三区免费| 极品少妇一区二区三区精品视频| 亚洲国产经典视频| 欧美人狂配大交3d怪物一区| 国产另类ts人妖一区二区| 亚洲欧美另类久久久精品2019| 91麻豆精品国产91久久久久久 | 在线精品视频免费播放| 久久99国产精品尤物| 亚洲人一二三区| 日韩网站在线看片你懂的| 成人午夜在线视频| 日韩精品三区四区| 中文字幕在线播放不卡一区| 欧美精品日韩一区| 风间由美中文字幕在线看视频国产欧美| 一区二区在线观看免费视频播放 | 五月天久久比比资源色| 国产三级精品视频| 欧美日韩激情在线| voyeur盗摄精品| 麻豆精品视频在线观看免费| 亚洲日本中文字幕区| 精品国产伦一区二区三区观看体验 | 国产精品久久久久久妇女6080| 欧美日本一区二区在线观看| 成人自拍视频在线观看| 九色综合狠狠综合久久| 亚洲一区在线视频观看| 中文字幕在线视频一区| 欧美变态tickling挠脚心| 欧美色图在线观看| 成人三级伦理片| 久久99精品久久久久久久久久久久| 亚洲最大的成人av| 国产精品高潮呻吟久久| 久久久蜜臀国产一区二区| 91精品国产91热久久久做人人 | 久久综合久久综合久久| 欧美福利视频导航| 色94色欧美sute亚洲13| 成人av在线观| 高清beeg欧美| 国产一区二区三区在线观看精品| 天天射综合影视| 亚洲国产人成综合网站| 亚洲一区中文在线| 一区二区三区欧美日韩| 国产精品国产三级国产有无不卡| 久久婷婷色综合| 欧美mv和日韩mv国产网站| 欧美一级xxx| 91精品国产丝袜白色高跟鞋| 欧美日韩国产美女| 欧美久久一二三四区|