⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 bootplib.html

📁 Vxworks API操作系统和驱动程序设计API。压缩的HTML文件
💻 HTML
📖 第 1 页 / 共 2 页
字号:
<html><head><!-- /vobs/wpwr/docs/vxworks/ref/bootpLib.html - generated by refgen from bootpLib.c --> <title> bootpLib </title></head><body bgcolor="#FFFFFF"> <hr><a name="top"></a><p align=right><a href="libIndex.htm"><i>VxWorks API Reference :  OS Libraries</i></a></p></blockquote><h1>bootpLib</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong>bootpLib</strong> - Bootstrap Protocol (BOOTP) client library </p></blockquote><h4>ROUTINES</h4><blockquote><p><p><b><a href="./bootpLib.html#bootpLibInit">bootpLibInit</a>(&nbsp;)</b>  -  BOOTP client library initialization<br><b><a href="./bootpLib.html#bootpParamsGet">bootpParamsGet</a>(&nbsp;)</b>  -  retrieve boot parameters using BOOTP<br><b><a href="./bootpLib.html#bootpMsgGet">bootpMsgGet</a>(&nbsp;)</b>  -  send a BOOTP request message and retrieve reply<br><p></blockquote><h4>DESCRIPTION</h4><blockquote><p>This library implements the client side of the Bootstrap Protocol(BOOTP).  This protocol allows a host to initialize automatically by<br>&nbsp;obtaining&nbsp;its&nbsp;IP&nbsp;address,&nbsp;boot&nbsp;file&nbsp;name,&nbsp;and&nbsp;boot&nbsp;host's&nbsp;IP&nbsp;address&nbsp;overa network. The <b><a href="./bootpLib.html#bootpLibInit">bootpLibInit</a>(&nbsp;)</b> routine links this library into theVxWorks image. This happens automatically if <b>INCLUDE_BOOTP</b> is definedat the time the image is built.<p></blockquote><h4>CONFIGURATION INTERFACE</h4><blockquote><p>When 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.<p></blockquote><h4>HIGH-LEVEL INTERFACE</h4><blockquote><p>The <b><a href="./bootpLib.html#bootpParamsGet">bootpParamsGet</a>(&nbsp;)</b> 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.<p></blockquote><h4>LOW-LEVEL INTERFACE</h4><blockquote><p>The <b><a href="./bootpLib.html#bootpMsgGet">bootpMsgGet</a>(&nbsp;)</b> 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 <b><a href="./bootpLib.html#bootpParamsGet">bootpParamsGet</a>(&nbsp;)</b> routine already extracts all options<br>&nbsp;which&nbsp;that&nbsp;document&nbsp;defines.<p></blockquote><h4>EXAMPLE</h4><blockquote><p>The following code fragment demonstrates use of the BOOTP library: <pre>    #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 *)&amp;clntAddr, sizeof (struct in_addr));    bzero ( (char *)&amp;hostAddr, sizeof (struct in_addr));    bzero (bootFile, SIZE_FILE);    subnetMask  = 0;    bzero ( (char *)&amp;gateway, sizeof (struct in_addr));    /* Set all pointers in parameter descriptor to NULL. */    bzero ((char *)&amp;bootParams, sizeof (struct bootpParams));    /* Set pointers corresponding to desired options. */    bootParams.netmask = (struct in_addr *)&amp;subnetMask;    routerlist.addr = &amp;gateway;    routerlist.num = 1;    bootParams.routers = &amp;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,                          &amp;clntAddr, &amp;hostAddr, NULL, bootFile, &amp;bootParams);    if (result != OK)        return (ERROR);</pre></blockquote><h4>INCLUDE FILES</h4><blockquote><p><b>bootpLib.h</b><p></blockquote><h4>SEE ALSO</h4><blockquote><p>RFC 951, RFC 1542, RFC 1533,<p><hr><a name="bootpLibInit"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries :  Routines</i></a></p></blockquote><h1>bootpLibInit(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong>bootpLibInit(&nbsp;)</strong> - BOOTP client library initialization</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS bootpLibInit    (    int maxSize               /* largest link-level header, in bytes */    )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine creates and initializes the global data structures used bythe BOOTP client library to obtain configuration parameters. The <i>maxSize</i>parameter specifies the largest link level header for all supported devices.This value determines the maximum length of the outgoing IP packet containinga BOOTP message.<p>This routine must be called before using any other library routines. Theroutine is called automatically if <b>INCLUDE_BOOTP</b> is defined at the timethe system is built and uses the <b>BOOTP_MAXSIZE</b> configuration settingfor the <i>maxSize</i> parameter.<p></blockquote><h4>RETURNS</h4><blockquote><p>OK, or ERROR if initialization fails.<p></blockquote><h4>ERRNO</h4><blockquote><p><b>S_bootpLib_MEM_ERROR</b>;</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./bootpLib.html#top">bootpLib</a></b><hr><a name="bootpParamsGet"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries :  Routines</i></a></p></blockquote><h1>bootpParamsGet(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong>bootpParamsGet(&nbsp;)</strong> - retrieve boot parameters using BOOTP</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS bootpParamsGet    (    struct ifnet *       pIf,         /* network device used by client */    u_int                maxSends,    /* maximum transmit attempts */    struct in_addr *     pClientAddr, /* retrieved client address buffer */    struct in_addr *     pServerAddr, /* buffer for server's IP address */    char *               pHostName,   /* 64 byte (max) host name buffer */    char *               pBootFile,   /* 128 byte (max) file name buffer */    struct bootpParams * pBootpParams /* parameters descriptor */    )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine performs a BOOTP message exchange according to the processdescribed in RFC 1542, so the server and client UDP ports are alwaysequal to the defined values of 67 and 68.<p>The <i>pIf</i> argument indicates the network device which will be used to sendand receive BOOTP messages. The BOOTP client only supports devices attachedto the IP protocol with the MUX/END interface. The MTU size must be largeenough to receive an IP packet of 328 bytes (corresponding to the BOOTPmessage length of 300 bytes). The specified device also must be capable ofsending broadcast messages, unless this routine sends the request messagesdirectly to the IP address of a specific server.<p>The <i>maxSends</i> parameter specifies the total number of requests beforebefore 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, beginningat 4 seconds and doubling until a maximum limit of 64 seconds.<p>The <i>pClientAddr</i> parameter provides optional storage for the assignedIP address from the <b>yiaddr</b> field of a BOOTP reply. Since this routinecan execute before the system is capable of accepting unicast datagramsor responding to ARP requests for a specific IP address, the corresponding<b>ciaddr</b> field in the BOOTP request message is equal to zero.<p>The <i>pServerAddr</i> parameter provides optional storage for the IP addressof the responding server (from the <b>siaddr</b> field of a BOOTP reply).This routine broadcasts the BOOTP request message unless this buffer

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -