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

📄 muxlib.html

📁 vxworks相关论文
💻 HTML
📖 第 1 页 / 共 3 页
字号:
to transmit.  Before you call <b><i><a href="./muxLib.html#muxSend">muxSend</a></i>(&nbsp;)</b>, you need to put the addressing information at the head of the buffer.  To do this, call <b><i><a href="./muxLib.html#muxAddressForm">muxAddressForm</a></i>(&nbsp;)</b>. <p>Also, the buffer should probably be reserved from the MUX-managed memory pool.  To reserve a buffer from this pool, the protocol should call <b><i>muxBufAlloc</i>(&nbsp;)</b>. <p></dl></blockquote><h4>RETURNS</h4><blockquote><p><p>&nbsp;OK,&nbsp;ENETDOWN&nbsp;if&nbsp;<i>pCookie</i>&nbsp;does&nbsp;not&nbsp;represent&nbsp;a&nbsp;valid&nbsp;interface,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;or&nbsp;ERROR&nbsp;if&nbsp;the&nbsp;driver's&nbsp;<b><i>endSend</i>(&nbsp;)</b>&nbsp;routine&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="muxPollSend"></a><p align=right><a href="rtnIndex.html"><i>Libraries :  Routines</i></a></p></blockquote><h1><i>muxPollSend</i>(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong><i>muxPollSend</i>(&nbsp;)</strong> - send a packet on a network interface</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS muxPollSend    (    void*    pCookie, /* cookie the protocol got from muxBind() */    M_BLK_ID pNBuff   /* data to be sent */    )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine takes a cookie which was returned by <b><i><a href="./muxLib.html#muxBind">muxBind</a></i>(&nbsp;)</b>and uses it to determine which network interface drivershould be used in transmitting the data.  The routine takes the datapointed to by <i>pNBuff</i> and sends it to the destination specified by callingthe functions in that driver.<p><dl><dt><i>pCookie</i><dd>Expects the cookie returned from <b><i><a href="./muxLib.html#muxBind">muxBind</a></i>(&nbsp;)</b>. This Cookieidentifies the device to which the MUX has bound the protocol calling<b><i><a href="./muxLib.html#muxPollSend">muxPollSend</a></i>(&nbsp;)</b>.<p><dt><i>pNBuff</i><dd> Expects a pointer to the buffer(<b>mBlk</b>) chain that contains the packet to betransmitted.<p></dl></blockquote><h4>RETURNS</h4><blockquote><p><p>&nbsp;OK,&nbsp;ENETDOWN&nbsp;if&nbsp;<i>pCookie</i>&nbsp;doesn't&nbsp;represent&nbsp;a&nbsp;valid&nbsp;device,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;or&nbsp;ERROR&nbsp;if&nbsp;the&nbsp;device&nbsp;type&nbsp;is&nbsp;not&nbsp;recognized&nbsp;or&nbsp;if&nbsp;the<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b><i>endPollSend</i>(&nbsp;)</b>&nbsp;routine&nbsp;for&nbsp;the&nbsp;driver&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="muxPollReceive"></a><p align=right><a href="rtnIndex.html"><i>Libraries :  Routines</i></a></p></blockquote><h1><i>muxPollReceive</i>(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong><i>muxPollReceive</i>(&nbsp;)</strong> - poll for a packet from a device driver</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS muxPollReceive    (    void*    pCookie, /* cookie passed in endLoad call */    M_BLK_ID pNBuff   /* a vector of buffers passed to us */    )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This is the routine that an upper layer can call to poll for a packet.<p><dl><dt><i>pCookie</i><dd>Expects the cookie that was returned from <b><i><a href="./muxLib.html#muxBind">muxBind</a></i>(&nbsp;)</b>.This "cookie" is an identifier for the driver.<p><dt><i>pNBuff</i><dd> Expects a pointer to a buffer chain into which incoming data will be put.<p></dl></blockquote><h4>RETURNS</h4><blockquote><p><p>&nbsp;OK,&nbsp;ENETDOWN&nbsp;if&nbsp;the&nbsp;pCookie<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;does&nbsp;not&nbsp;represent&nbsp;a&nbsp;loaded&nbsp;driver,&nbsp;or&nbsp;an&nbsp;error&nbsp;value&nbsp;returned<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;from&nbsp;the&nbsp;driver's&nbsp;registered&nbsp;<b><i>endPollReceive</i>(&nbsp;)</b>&nbsp;function.<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="muxIoctl"></a><p align=right><a href="rtnIndex.html"><i>Libraries :  Routines</i></a></p></blockquote><h1><i>muxIoctl</i>(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong><i>muxIoctl</i>(&nbsp;)</strong> - send control information to the MUX or to a device</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS muxIoctl    (    void*   pCookie, /* cookie identifying the device to access */    int     cmd,     /* command to pass to ioctl */    caddr_t data     /* data need for command in cmd */    )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine gives the protocol access to the network driver's control functions.  The MUX itself can implement some of the standard controlfunctions, so not all commands necessarily pass down to the device.  Otherwise, both command and data pass down to the device unmolested.<p>This routine also lets the protocol change the routine that the MUX uses to pass data up to the protocol as well as the routine that the MUX uses to shutdown the protocol. <p><dl><dt><i>pCookie</i><dd>Expects the pointer returned as the function value of <b><i><a href="./muxLib.html#muxBind">muxBind</a></i>(&nbsp;)</b>.  The pointer identifies the device to which this protocol is bound. <p><dt><i>cmd</i><dd>Expects a value indicating the control command you want to execute. For valid <i>cmd</i> values, see the description of the <b><i>endIoctl</i>(&nbsp;)</b> routineprovided in <i>Network Protocol Toolkit User's Guide </i>.<p><dt><i>data</i><dd> Expects the data or a pointer to the data needed to carry out the command specified in <i>cmd</i>. <p></dl></blockquote><h4>RETURNS</h4><blockquote><p><p>&nbsp;OK,&nbsp;ENETDOWN&nbsp;if&nbsp;pCookie&nbsp;does&nbsp;not&nbsp;represent&nbsp;a&nbsp;bound&nbsp;device,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;or&nbsp;ERROR&nbsp;if&nbsp;the&nbsp;command&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="muxMCastAddrAdd"></a><p align=right><a href="rtnIndex.html"><i>Libraries :  Routines</i></a></p></blockquote><h1><i>muxMCastAddrAdd</i>(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong><i>muxMCastAddrAdd</i>(&nbsp;)</strong> - add a multicast address to multicast table for a device</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS muxMCastAddrAdd    (    void*  pCookie, /* returned by the muxBind() call */    char * pAddress /* address to add to the table */    )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine adds an address to the multicast table maintained for a device. Internally, this function uses <i>pCookie</i> to find the device-specific routine that handles adding an address to the device's multicast table. <p><dl><dt><i>pCookie</i><dd>Expects the pointer returned as the function value of the <b><i><a href="./muxLib.html#muxBind">muxBind</a></i>(&nbsp;)</b> call.  This pointer identifies the device to which the MUX has bound this protocol. <p><dt><i>pAddress</i><dd> Expects a pointer to a character string containing the address you want to add. <p></dl></blockquote><h4>RETURNS</h4><blockquote><p><p>&nbsp;OK,&nbsp;ENETDOWN&nbsp;if&nbsp;<i>pCookie</i>&nbsp;doesn't&nbsp;represent&nbsp;a&nbsp;valid&nbsp;device,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;or&nbsp;ERROR&nbsp;if&nbsp;the&nbsp;device's&nbsp;<b><i>endMCastAddrAdd</i>(&nbsp;)</b>&nbsp;function&nbsp;fails.<p></blockquote><h4>ERRNO</h4><blockquote><p>ENOTSUP, S_muxLib_NO_DEVICE</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./muxLib.html#top">muxLib</a></b><hr><a name="muxMCastAddrDel"></a><p align=right><a href="rtnIndex.html"><i>Libraries :  Routines</i></a></p></blockquote><h1><i>muxMCastAddrDel</i>(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong><i>muxMCastAddrDel</i>(&nbsp;)</strong> - delete a multicast address from a device's multicast table</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS muxMCastAddrDel    (    void* pCookie, /* Returned by the muxBind() call */    char* pAddress /* Address to delete from the table. */    )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine deletes an address from the multicast table maintained for a device.  Internally, this function uses <i>pCookie</i> to find the device-specific routine that handles deleting an address from the device's multicast table.<p><dl><dt><i>pCookie</i><dd>Expects the pointer returned as the function value of the <b><i><a href="./muxLib.html#muxBind">muxBind</a></i>(&nbsp;)</b> call.  This pointer identifies the device to which the MUX bound this protocol. <p><dt><i>pAddress</i><dd> Expects a pointer to a character string containing the address you want to delete. <p></dl></blockquote><h4>RETURNS</h4><blockquote><p><p>&nbsp;OK,&nbsp;ENETDOWN&nbsp;if&nbsp;<i>pCookie</i>&nbsp;does&nbsp;not&nbsp;represent&nbsp;a&nbsp;valid&nbsp;driver,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;or&nbsp;ERROR&nbsp;if&nbsp;the&nbsp;driver's&nbsp;registered&nbsp;<b><i>endMCastAddrDel</i>(&nbsp;)</b>&nbsp;function<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;fails.<p></blockquote><h4>ERRNO</h4><blockquote><p>ENOTSUP, EINVAL, S_muxLib_NO_DEVICE</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./muxLib.html#top">muxLib</a></b><hr><a name="muxMCastAddrGet"></a><p align=right><a href="rtnIndex.html"><i>Libraries :  Routines</i></a></p></blockquote><h1><i>muxMCastAddrGet</i>(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong><i>muxMCastAddrGet</i>(&nbsp;)</strong> - get the multicast address table from the MUX/Driver</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>int muxMCastAddrGet    (    void*         pCookie, /* returned by the muxBind() call */    MULTI_TABLE * pTable   /* pointer to a table to be filled and returned. */    )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine expects a buffer into which it can write the list of multicast addresses for the specified device.  Internally, thisroutine uses <i>pCookie</i> to access the device-specific routine neededto retrieve the multicast address table. <p><dl><dt><i>pCookie</i><dd>Expects the pointer returned as the function value of the <b><i><a href="./muxLib.html#muxBind">muxBind</a></i>(&nbsp;)</b> call.  This pointer identifies the device to which the MUX has bound this protocol. <p><dt><i>pTable</i><dd> Expects the pointer to a <b>MULTI_TABLE</b> structure.  You must have allocated this structure at some time before the call to <b><i><a href="./muxLib.html#muxMCastAddrGet">muxMCastAddrGet</a></i>(&nbsp;)</b>. The <b>MULTI_TABLE</b> structure is defined in <b>end.h</b> as: <p><pre>   typedef struct multi_table       {       int     tableLen;   /* length of table in bytes */       char    *pTable;    /* pointer to entries */       } MULTI_TABLE;</pre></dl></blockquote><h4>RETURNS</h4><blockquote><p><p>&nbsp;OK,&nbsp;ENETDOWN&nbsp;if&nbsp;<i>pCookie</i>&nbsp;does&nbsp;not&nbsp;represent&nbsp;a&nbsp;valid&nbsp;driver,or ERROR if the driver's registered <b><i>endMCastAddrGet</i>(&nbsp;)</b> function 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="muxUnbind"></a><p align=right><a href="rtnIndex.html"><i>Libraries :  Routines</i></a></p></blockquote><h1><i>muxUnbind</i>(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong><i>muxUnbind</i>(&nbsp;)</strong> - detach a protocol from the specified driver</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS muxUnbind    (    void*   pCookie,    /* pointer to identifier for device */    long    type,       /* device type passed in muxBind() call */    FUNCPTR stackRcvRtn /* pointer to stack receive routine */    )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine disconnects a protocol from the specified driver.  <p><dl><dt><i>pCookie</i><dd>Expects the pointer returned as the function value from the <b><i><a href="./muxLib.html#muxBind">muxBind</a></i>(&nbsp;)</b> call.  This pointer identifies the device to which the MUX has bound this protocol. <p><dt><i>type</i><dd>This is the type that you passed down in the <b><i><a href="./muxLib.html#muxBind">muxBind</a></i>(&nbsp;)</b> call.<p><dt><i>stackRcvRtn</i><dd> Expects a pointer to the stack receive routine you specified when you called <b><i><a href="./muxLib.html#muxBind">muxBind</a></i>(&nbsp;)</b> to bind the driver and protocol. <p></dl></blockquote><h4>RETURNS</h4><blockquote><p><p>&nbsp;OK,&nbsp;EINVAL&nbsp;if&nbsp;<i>pCookie</i>&nbsp;does&nbsp;not&nbsp;represent&nbsp;a&nbsp;valid&nbsp;driver&nbsp;or&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;the&nbsp;protocol&nbsp;is&nbsp;not&nbsp;attached,&nbsp;ERROR&nbsp;if&nbsp;<b><i><a href="./muxLib.html#muxUnbind">muxUnbind</a></i>(&nbsp;)</b>&nbsp;fails.<p></blockquote><h4>ERRNO</h4><blockquote><p>EINVAL, S_muxLib_NO_DEVICE</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./muxLib.html#top">muxLib</a></b><hr><a name="muxDevUnload"></a><p align=right><a href="rtnIndex.html"><i>Libraries :  Routines</i></a></p></blockquote><h1><i>muxDevUnload</i>(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong><i>muxDevUnload</i>(&nbsp;)</strong> - remove a driver from the MUX</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS muxDevUnload    (    char * pName, /* a string containing the name of the device for example, */                  /* or ei */    int    unit   /* the unit number */    )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine unloads a driver from the MUX.  This breaks anynetwork connections an application might have open.  The<b><i>stackShutdownRtn</i>(&nbsp;)</b> of each protocol bound to the END via<b><i><a href="./muxLib.html#muxBind">muxBind</a></i>(&nbsp;)</b> will be called.  Each <b><i>stackShutdownRtn</i>(&nbsp;)</b> is expectedto call <b><i><a href="./muxLib.html#muxUnbind">muxUnbind</a></i>(&nbsp;)</b> to detach from the END.<p><dl><dt><i>pName</i><dd>Expects a pointer to a string containing the name of the device, for example<b>ln</b> or <b>ei</b><p><dt><i>unit</i><dd> Expects the unit number of the device indicated by <i>pName</i><p></dl></blockquote><h4>RETURNS</h4><blockquote><p>

⌨️ 快捷键说明

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