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

📄 muxlib.html

📁 vxworks相关论文
💻 HTML
📖 第 1 页 / 共 3 页
字号:
<html><head><!-- /vobs/wpwr/docs/vxworks/ref/muxLib.html - generated by refgen from muxLib.c --> <title> muxLib </title></head><body bgcolor="#FFFFFF"> <hr><a name="top"></a><p align=right><a href="libIndex.html"><i>VxWorks Reference Manual :  Libraries</i></a></p></blockquote><h1>muxLib</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong>muxLib</strong> - MUX network interface library </p></blockquote><h4>ROUTINES</h4><blockquote><p><p><b><i><a href="./muxLib.html#muxLibInit">muxLibInit</a></i>(&nbsp;)</b>  -  initialize global state for the MUX<br><b><i><a href="./muxLib.html#muxDevLoad">muxDevLoad</a></i>(&nbsp;)</b>  -  load a driver into the MUX<br><b><i><a href="./muxLib.html#muxDevStart">muxDevStart</a></i>(&nbsp;)</b>  -  start a device by calling its start routine<br><b><i><a href="./muxLib.html#muxDevStop">muxDevStop</a></i>(&nbsp;)</b>  -  stop a device by calling its stop routine<br><b><i><a href="./muxLib.html#muxShow">muxShow</a></i>(&nbsp;)</b>  -  all configured Enhanced Network Drivers<br><b><i><a href="./muxLib.html#muxBind">muxBind</a></i>(&nbsp;)</b>  -  bind a protocol to the MUX given a driver name <br><b><i><a href="./muxLib.html#muxSend">muxSend</a></i>(&nbsp;)</b>  -  send a packet out on a network interface<br><b><i><a href="./muxLib.html#muxPollSend">muxPollSend</a></i>(&nbsp;)</b>  -  send a packet on a network interface<br><b><i><a href="./muxLib.html#muxPollReceive">muxPollReceive</a></i>(&nbsp;)</b>  -  poll for a packet from a device driver<br><b><i><a href="./muxLib.html#muxIoctl">muxIoctl</a></i>(&nbsp;)</b>  -  send control information to the MUX or to a device<br><b><i><a href="./muxLib.html#muxMCastAddrAdd">muxMCastAddrAdd</a></i>(&nbsp;)</b>  -  add a multicast address to multicast table for a device<br><b><i><a href="./muxLib.html#muxMCastAddrDel">muxMCastAddrDel</a></i>(&nbsp;)</b>  -  delete a multicast address from a device's multicast table<br><b><i><a href="./muxLib.html#muxMCastAddrGet">muxMCastAddrGet</a></i>(&nbsp;)</b>  -  get the multicast address table from the MUX/Driver<br><b><i><a href="./muxLib.html#muxUnbind">muxUnbind</a></i>(&nbsp;)</b>  -  detach a protocol from the specified driver<br><b><i><a href="./muxLib.html#muxDevUnload">muxDevUnload</a></i>(&nbsp;)</b>  -  remove a driver from the MUX<br><b><i><a href="./muxLib.html#muxAddressForm">muxAddressForm</a></i>(&nbsp;)</b>  -  form an address into a packet<br><b><i><a href="./muxLib.html#muxPacketDataGet">muxPacketDataGet</a></i>(&nbsp;)</b>  -  return the data from a packet<br><b><i><a href="./muxLib.html#muxPacketAddrGet">muxPacketAddrGet</a></i>(&nbsp;)</b>  -  get addressing information from a packet<br><b><i><a href="./muxLib.html#endFindByName">endFindByName</a></i>(&nbsp;)</b>  -  find a device using its string name<br><b><i><a href="./muxLib.html#muxDevExists">muxDevExists</a></i>(&nbsp;)</b>  -  tests whether a device is already loaded into the MUX<br><b><i><a href="./muxLib.html#muxAddrResFuncAdd">muxAddrResFuncAdd</a></i>(&nbsp;)</b>  -  add an address resolution function<br><b><i><a href="./muxLib.html#muxAddrResFuncGet">muxAddrResFuncGet</a></i>(&nbsp;)</b>  -  get the address resolution function for ifType/protocol<br><b><i><a href="./muxLib.html#muxAddrResFuncDel">muxAddrResFuncDel</a></i>(&nbsp;)</b>  -  delete an address resolution function<br><p></blockquote><h4>DESCRIPTION</h4><blockquote><p>This library provides the routines that define the MUX interface, a facilitythat handles communication between the data link layer and the networkprotocol layer.  Using the MUX, the VxWorks network stack has decoupled thedata link and network layers.  Thus, drivers and protocols no longer need knowledge of each other's internals.  As a result, the network driver and protocol are nearly independent of each another.  This independence makes it much easier to add a new drivers or protocols.  For example, if you add a new END, all existing MUX-based protocols can use the newdriver.  Likewise, if you add a new MUX-based protocol, any existing END can use the MUX to access the new protocol.  <p></blockquote><h4>INCLUDE FILES</h4><blockquote><p><b>errno.h</b>, <b>lstLib.h</b>, <b>logLib.h</b>, <b>string.h</b>,<b>m2Lib.h</b>, <b>bufLib.h</b>, <b>if.h</b>, <b>end.h</b>, <b>muxLib.h</b><p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./muxLib.html#top">muxLib</a></b>, <i>Network Protocol Toolkit User's Guide </i><hr><a name="muxLibInit"></a><p align=right><a href="rtnIndex.html"><i>Libraries :  Routines</i></a></p></blockquote><h1><i>muxLibInit</i>(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong><i>muxLibInit</i>(&nbsp;)</strong> - initialize global state for the MUX</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS muxLibInit (void)</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine initializes all global state for the MUX.<p></blockquote><h4>RETURNS</h4><blockquote><p>OK or ERROR.</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./muxLib.html#top">muxLib</a></b><hr><a name="muxDevLoad"></a><p align=right><a href="rtnIndex.html"><i>Libraries :  Routines</i></a></p></blockquote><h1><i>muxDevLoad</i>(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong><i>muxDevLoad</i>(&nbsp;)</strong> - load a driver into the MUX</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>END_OBJ* muxDevLoad    (    int                         unit,        /* unit number fo device */    END_OBJ* (* endLoad) (char* ,    void*                       ),           /* load function of the driver */    char*                       pInitString, /* init string for this driver */    BOOL                        loaning,     /* we loan buffers */    void*                       pBSP         /* for BSP group */    )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>The <b><i><a href="./muxLib.html#muxDevLoad">muxDevLoad</a></i>(&nbsp;)</b> routine loads a network driver into the MUX.  Internally, this routine calls the specified <b><i>endLoad</i>(&nbsp;)</b> to initialize the software state of the device.  After the device is initialized, <b><i><a href="./muxLib.html#muxDevStart">muxDevStart</a></i>(&nbsp;)</b> must be called to start the device. <dl><dt><i>unit</i><dd>Expects the unit number of the device. <p><dt><i>endLoad</i><dd>Expects a pointer to the network driver's <b><i>endLoad</i>(&nbsp;)</b> entry point. <p><dt><i>pInitString</i><dd>Expects a pointer to an initialization string, a colon-delimited list of options.  The <b><i><a href="./muxLib.html#muxDevLoad">muxDevLoad</a></i>(&nbsp;)</b> routine passes this along blindly to the <b><i>endLoad</i>(&nbsp;)</b> function.<p><dt><i>loaning</i><dd>Expects a boolean value that tells the MUX whether the driver supports buffer loaning on this device.  If the low-level device cannot support buffer loaning, passing in TRUE has no effect.  <p><dt><i>pBSP</i><dd> This argument is passed blindly to the driver, which may or may not use it.  It is provided so that the BSP can pass in tables of functions that thedriver can use but which are specific to the particular BSP on whichit runs.<p></dl></blockquote><h4>RETURNS</h4><blockquote><p><p>&nbsp;A&nbsp;pointer&nbsp;to&nbsp;the&nbsp;new&nbsp;device&nbsp;or&nbsp;NULL&nbsp;if&nbsp;an&nbsp;error&nbsp;occurred.<p></blockquote><h4>ERRNO</h4><blockquote><p>S_muxLib_LOAD_FAILED</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./muxLib.html#top">muxLib</a></b><hr><a name="muxDevStart"></a><p align=right><a href="rtnIndex.html"><i>Libraries :  Routines</i></a></p></blockquote><h1><i>muxDevStart</i>(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong><i>muxDevStart</i>(&nbsp;)</strong> - start a device by calling its start routine</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS muxDevStart    (    void* pCookie /* a pointer to cookie returned by muxDevLoad() */    )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine starts a device that is already initialized and loaded into the MUX.  Internally, <b><i><a href="./muxLib.html#muxDevStart">muxDevStart</a></i>(&nbsp;)</b> calls the device's <b><i>endStart</i>(&nbsp;)</b>, which handles registering the driver's interrupt service routine and whatever else is needed to allow the device to handle receiving and transmitting.  This call to <b><i>endStart</i>(&nbsp;)</b> provides a device-dependent way to put the device into a running state. <p><dl><dt><i>pCookie</i><dd> Expects a pointer to the <b>END_OBJ</b> returned from the <b><i><a href="./muxLib.html#muxDevLoad">muxDevLoad</a></i>(&nbsp;)</b> that loaded this driver into the MUX.  This "cookie" is an identifier for the device.  </dl><p></blockquote><h4>RETURNS</h4><blockquote><p>OK, ENETDOWN if <i>pCookie</i> does not represent a valid device,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;or&nbsp;ERROR&nbsp;if&nbsp;the&nbsp;start&nbsp;routine&nbsp;for&nbsp;the&nbsp;device&nbsp;fails.<p></blockquote><h4>ERRNO</h4><blockquote><p>S_muxLib_NO_DEVICE</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./muxLib.html#top">muxLib</a></b><hr><a name="muxDevStop"></a><p align=right><a href="rtnIndex.html"><i>Libraries :  Routines</i></a></p></blockquote><h1><i>muxDevStop</i>(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong><i>muxDevStop</i>(&nbsp;)</strong> - stop a device by calling its stop routine</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS muxDevStop    (    void* pCookie /* pointer to cookie that identifies the device */    )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine stops the device specified in the <i>pCookie</i> parameter.Internally, <b><i><a href="./muxLib.html#muxDevStop">muxDevStop</a></i>(&nbsp;)</b> calls the device's own stop routine, thusputting the device into a stopped state in a device-dependent manner. <p><dl><dt><i>pCookie</i><dd> Expects the pointer returned as the function value of the <b><i><a href="./muxLib.html#muxDevLoad">muxDevLoad</a></i>(&nbsp;)</b> call for this device.  This pointer identifies the device to which the MUX has bound this protocol.  </dl><p></blockquote><h4>RETURNS</h4><blockquote><p>OK, ENETDOWN if <i>pCookie</i> does not represent a valid device, or<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ERROR&nbsp;if&nbsp;the&nbsp;stop&nbsp;routine&nbsp;for&nbsp;the&nbsp;device&nbsp;fails.<p></blockquote><h4>ERRNO</h4><blockquote><p>S_muxLib_NO_DEVICE</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./muxLib.html#top">muxLib</a></b><hr><a name="muxShow"></a><p align=right><a href="rtnIndex.html"><i>Libraries :  Routines</i></a></p></blockquote><h1><i>muxShow</i>(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong><i>muxShow</i>(&nbsp;)</strong> - all configured Enhanced Network Drivers</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>void muxShow    (    char * pDevName, /* pointer to device name */    int    unit      /* unit number for the device */    )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>If a driver is specified  <i>pDevName</i> and <i>unit</i>, this routine reports thename and type of each protocol bound to it.If a <i>pDevName</i> is not given, the entire list of devices and their protocolsis shown.<p><dl><dt><i>pDevName</i><dd>Expects a pointer to a string containing the device name, or NULL<p><dt><i>unit</i><dd> Expects a unit number for the device </dl><p></blockquote><h4>RETURNS</h4><blockquote><p>N/A</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./muxLib.html#top">muxLib</a></b><hr><a name="muxBind"></a><p align=right><a href="rtnIndex.html"><i>Libraries :  Routines</i></a></p></blockquote><h1><i>muxBind</i>(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong><i>muxBind</i>(&nbsp;)</strong> - bind a protocol to the MUX given a driver name </p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>END_OBJ* muxBind    (    char *                      pName, /* interface name, for example, ln, */    int                         unit,  /* unit number */    BOOL (* stackRcvRtn) (void*     )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>A protocol uses this routine to bind to a specific driver.The driver is specified by the <i>pName</i> and <i>unit</i> arguments(for example, ln and 0, ln and 1, ei and 0, ...).The <i>stackRcvRtn</i> is called whenever the MUX has a packet of the specified type.  If the type is <b>MUX_PROTO_PROMISC</b>, the protocol is considered promiscuous and will get all of the packets that the MUX sees.<p><dl><dt><i>pName</i><dd>Expects a pointer to a character string that contains the name of the device to which this protocol wants to use to send and receive packets. <p><dt><i>unit</i><dd>Expects a number which is the unit of the device of the type indicatedby <i>pName</i>.<p><dt><i>stackRcvRtn</i><dd>Expects a pointer function that the MUX can call when it wants to pass a packet up to the protocol.  For a description of how you should write this routine, see the description of a <b><i>stackRcvRtn</i>(&nbsp;)</b>provided in <i>Network Protocol Toolkit User's Guide. </i><p><dt><i>stackShutdownRtn</i><dd>Expects a pointer to the function that the MUX can call to shutdown the protocol.  For a description of how to write such a routine, see <b><i>stackShutdownRtn</i>(&nbsp;)</b> see the description of a <b><i>stackRcvRtn</i>(&nbsp;)</b>provided in <i>Network Protocol Toolkit User's Guide. </i><p><dt><i>stackErrorRtn</i><dd>Expects a pointer to the function that the MUX can call to give errorsto the protocol.<p><dt><i>type</i><dd>Expects a value that indicates the protocol type.  The MUX uses this type to prioritize the protocol.  For example, a protocol of type <b>MUX_PROTO_SNARF</b> has the highest priority (see the description of protocol prioritizing provided in <i>Network Protocol Toolkit User's Guide: Writing an NPT Protocol. </i>Aside from <b>MUX_PROTO_SNARF</b> and <b>MUX_PROTO_PROMISC</b>, valid protocol types include any of the values specified in RFC1700. If the type is <b>MUX_PROTO_OUTPUT</b>, this protocol is an output protocol and allpackets that are going to be output on this device are passed to the<b><i>stackRcvRtn</i>(&nbsp;)</b> routine before actually being sent down to the device.  Thiswould be useful, for instance, for a network service that needs to sendpackets directly to another network service, or for loop-back testing.If the <b><i>stackRcvRtn</i>(&nbsp;)</b> returns OK, the packet is considered to have beenconsumed and is no longer available.  An output protocol may return ERRORfrom its <b><i>stackRcvRtn</i>(&nbsp;)</b> in order to look at the packet without consuming it.<p><dt><i>pProtoName</i><dd>Expects a pointer to a character string for the name of this protocol.  This string can be NULL, in which case a protocol name isassigned internally.<p><dt><i>pSpare</i><dd> Expects a pointer to a structure defined by the protocol.  This argumentis passed up to the protocol with each received packet.<p></dl></blockquote><h4>RETURNS</h4><blockquote><p><p>&nbsp;A&nbsp;cookie&nbsp;identifying&nbsp;the&nbsp;network&nbsp;driver&nbsp;to&nbsp;which&nbsp;the&nbsp;mux&nbsp;has<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;bound&nbsp;the&nbsp;protocol.<p></blockquote><h4>ERRNO</h4><blockquote><p>S_muxLib_NO_DEVICE, S_muxLib_ALREADY_BOUND, S_muxLib_ALLOC_FAILED</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./muxLib.html#top">muxLib</a></b><hr><a name="muxSend"></a><p align=right><a href="rtnIndex.html"><i>Libraries :  Routines</i></a></p></blockquote><h1><i>muxSend</i>(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong><i>muxSend</i>(&nbsp;)</strong> - send a packet out on a network interface</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS muxSend    (    void*    pCookie, /* cookie that identifies a network interface */                      /* by muxBind() */    M_BLK_ID pNBuff   /* data to be sent */    )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine uses the <i>pCookie</i> value returned during the bind to identifythe network interface through which the packet is to be transmitted.<p><dl><dt><i>pCookie</i><dd>Expects the pointer returned from <b><i><a href="./muxLib.html#muxBind">muxBind</a></i>(&nbsp;)</b>.  This pointer identifies the device to which the MUX has bound this protocol. <p><dt><i>pNBuff</i><dd> Expects a pointer to the buffer that contains the packet you want 

⌨️ 快捷键说明

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