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

📄 distlib.html

📁 Vxworks API操作系统和驱动程序设计API。压缩的HTML文件
💻 HTML
📖 第 1 页 / 共 2 页
字号:
<html><head><!-- /vobs/wpwr/docs/vxworks/ref/distLib.html - generated by refgen from distLib.c --> <title> distLib </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>distLib</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong>distLib</strong> - distributed objects initialization and control library (VxFusion option) </p></blockquote><h4>ROUTINES</h4><blockquote><p><p><b><a href="./distLib.html#distInit">distInit</a>(&nbsp;)</b>  -  initialize and bootstrap the current node (VxFusion option)<br><b><a href="./distLib.html#distCtl">distCtl</a>(&nbsp;)</b>  -  perform a distributed objects control function (VxFusion option)<br><p></blockquote><h4>DESCRIPTION</h4><blockquote><p>This library provides an initialization and control interface for VxFusion.<p>Use <b><a href="./distLib.html#distInit">distInit</a>(&nbsp;)</b> to initialize VxFusion on the current node.  In addition to performing local initialization, <b><a href="./distLib.html#distInit">distInit</a>(&nbsp;)</b> attempts to locate remote VxFusionnodes on the network and download copies of the databases from one of the remote nodes.<p>Call <b><a href="./distLib.html#distCtl">distCtl</a>(&nbsp;)</b> to set VxFusion run-time parameters using an <b><a href="./ioLib.html#ioctl">ioctl</a>(&nbsp;)</b>-likesyntax.<p></blockquote><h4>NOTE</h4><blockquote><p>In this release, the <b><a href="./distLib.html#distInit">distInit</a>(&nbsp;)</b> routine is called automatically with default parameters when a target boots using a VxWorks image with VxFusion installed.<p></blockquote><h4>AVAILABILITY</h4><blockquote><p>This module is distributed as a component of the unbundled distributedmessage queues option, VxFusion.<p></blockquote><h4>INCLUDE FILES</h4><blockquote><p><b>distLib.h</b><hr><a name="distInit"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries :  Routines</i></a></p></blockquote><h1>distInit(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong>distInit(&nbsp;)</strong> - initialize and bootstrap the current node (VxFusion option)</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS distInit    (    DIST_NODE_ID myNodeId,      /* node ID of this node */    FUNCPTR      ifInitRtn,     /* interface adapter init routine */    void *       pIfInitConf,   /* ptr to interface configuration */    int          maxTBufsLog2,  /* max number of telegram buffers */    int          maxNodesLog2,  /* max number of nodes in node db */    int          maxQueuesLog2, /* max number of queues on this node */    int          maxGroupsLog2, /* max number of groups in db */    int          maxNamesLog2,  /* max bindings in name db */    int          waitNTicks     /* wait n ticks when bootstrapping */    )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine initializes VxFusion on the current node.  The routine begins byinitializing the local databases and other internal services.  As part of thisprocess, the current node is given the address specified by the <i>myNodeId</i>argument.  <p>Secondly, this routine links a network driver to the stack bycalling the interface adapter initialization routine specified by the<i>ifInitRtn</i> argument.  If the interface adapter initialization is successful,this routine then initializes the telegram buffer library which is neededfor manipulating telegram buffers--the buffers that hold the packetssent between nodes.<p>Thirdly, this routine attempts to determine what other VxFusion nodes areactive on the network.  This is done by continually sending a <b>BOOTSTRAP</b>telegram, which indicates to other nodes that VxFusion is starting up on thisnode.  Nodes that receive a <b>BOOTSTRAP</b> telegram answer by sending an <b>XACK</b>telegram.  The <b>XACK</b> telegram contains information about the remote node.The sender of the first <b>XACK</b> received is the godfather for the current node.The purpose of the godfather is to update local databases.  Ifno <b>XACK</b> is received within the amount of time specified by the <i>waitNTicks</i>argument, it is assumed that this node is the first node to come up on thenetwork.<p>As soon as a godfather is located or it is assumed that a node sending an<b>XACK</b> is the first to do so on the network, the state of the node shiftsfrom the <i>booting</i> state to the <i>network</i> state.  In thenetwork state, all packets are sent using reliable communicationchannels; therefore all packets must be now acknowledged by thereceiver(s).<p>If a godfather has been located, the current node asks it toupdate the local databases by sending an <b>INCO_REQ</b> packet.  The godfather then begins updating the local databases.  When the godfather finishes the update, it sends an <b>INCO_DONE</b> packet to the node being updated.<p>Once the database updates have completed, the node moves into the <i>operational</i> state and broadcasts an <b>INCO_UPNOW</b> packet.<p>The number of telegram buffers pre-allocated is equal to 2^<i>maxTBufsLog2</i>.<p>Up to 2^<i>maxNodesLog2</i> nodes can be handled by the node database.<p>The number of distributed message queues is limited to 2^<i>maxQueuesLog2</i>.<p>Distributed message queue groups may not exceed 2^<i>maxGroupsLog2</i> groups.<p>The distributed name database can work with up to 2^<i>maxNamesLog2</i> entries.<p></blockquote><h4>EXAMPLE</h4><blockquote><p><p><pre>-&gt; distInit (0x930b2610, distIfUdpInit, "ln0", 9, 5, 7, 6, 8, (4*sysClkRateGet())</pre>This command sets the ID of the local node to 0x930b2610 (147.11.38.16). The <b>distIfUdpInit(&nbsp;)</b> routine is called to initialize the interfaceadapter (in this case, a UDP adapter). The UDP adapter requires a pointer to the hardware interface name as configuration data (in this case, "ln0").  When starting up, 512 (2^9) telegram buffers are pre-allocated.The node database is configured to hold as many as 32 (2^5) nodes, includingthe current node.  128 (2^7) distributed message queues can be created on the local node.  The local group database can hold up to 64 (2^6) groups, while the name database is limited to 256 (2^8) entries.<p>When the node bootstraps, it waits for 4 seconds (4*<b><a href="./sysLib.html#sysClkRateGet">sysClkRateGet</a>(&nbsp;)</b>) to allow other nodes to respond.<p></blockquote><h4>NOTE</h4><blockquote><p>This routine is called automatically with default parameters when a target boots using a VxWorks image with VxFusion installed.<p></blockquote><h4>AVAILABILITY</h4><blockquote><p>This routine is distributed as a component of the unbundled distributedmessage queues option, VxFusion.<p></blockquote><h4>RETURNS</h4><blockquote><p>OK, or ERROR if the initialization fails.<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./distLib.html#top">distLib</a></b>, <b><a href="./distLib.html#top">distLib</a></b><hr><a name="distCtl"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries :  Routines</i></a></p></blockquote><h1>distCtl(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong>distCtl(&nbsp;)</strong> - perform a distributed objects control function (VxFusion option)</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>int distCtl    (    int function,             /* function code */    int argument              /* arbitrary argument */    )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine sets various parameters and hooks that control the system.  Ituses a syntax similar to that of the <b><a href="./ioLib.html#ioctl">ioctl</a>(&nbsp;)</b> routine.It accepts the following functions:<dl><dt><b>DIST_CTL_LOG_HOOK</b><dd>This function sets a routine to be called each time a log message is produced. By default, the log hook writes the message to standard output.The prototype of the <b><a href="./mathALib.html#log">log</a>(&nbsp;)</b> routine should look like this:<pre>   void log (char *logMsg);</pre><dt><b>DIST_CTL_PANIC_HOOK</b><dd>This function sets a routine to be called when the system panics. 

⌨️ 快捷键说明

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