📄 muxlib.html
字号:
to transmit. Before you call <b><i><a href="./muxLib.html#muxSend">muxSend</a></i>( )</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>( )</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>( )</b>. <p></dl></blockquote><h4>RETURNS</h4><blockquote><p><p> OK, ENETDOWN if <i>pCookie</i> does not represent a valid interface,<br> or ERROR if the driver's <b><i>endSend</i>( )</b> routine 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>( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong><i>muxPollSend</i>( )</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>( )</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>( )</b>. This Cookieidentifies the device to which the MUX has bound the protocol calling<b><i><a href="./muxLib.html#muxPollSend">muxPollSend</a></i>( )</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> OK, ENETDOWN if <i>pCookie</i> doesn't represent a valid device,<br> or ERROR if the device type is not recognized or if the<br> <b><i>endPollSend</i>( )</b> routine for the driver 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>( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong><i>muxPollReceive</i>( )</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>( )</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> OK, ENETDOWN if the pCookie<br> does not represent a loaded driver, or an error value returned<br> from the driver's registered <b><i>endPollReceive</i>( )</b> 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>( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong><i>muxIoctl</i>( )</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>( )</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>( )</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> OK, ENETDOWN if pCookie does not represent a bound device,<br> or ERROR if the command 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>( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong><i>muxMCastAddrAdd</i>( )</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>( )</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> OK, ENETDOWN if <i>pCookie</i> doesn't represent a valid device,<br> or ERROR if the device's <b><i>endMCastAddrAdd</i>( )</b> function 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>( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong><i>muxMCastAddrDel</i>( )</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>( )</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> OK, ENETDOWN if <i>pCookie</i> does not represent a valid driver,<br> or ERROR if the driver's registered <b><i>endMCastAddrDel</i>( )</b> function<br> 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>( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong><i>muxMCastAddrGet</i>( )</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>( )</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>( )</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> OK, ENETDOWN if <i>pCookie</i> does not represent a valid driver,or ERROR if the driver's registered <b><i>endMCastAddrGet</i>( )</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>( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong><i>muxUnbind</i>( )</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>( )</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>( )</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>( )</b> to bind the driver and protocol. <p></dl></blockquote><h4>RETURNS</h4><blockquote><p><p> OK, EINVAL if <i>pCookie</i> does not represent a valid driver or <br> the protocol is not attached, ERROR if <b><i><a href="./muxLib.html#muxUnbind">muxUnbind</a></i>( )</b> 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>( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong><i>muxDevUnload</i>( )</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>( )</b> of each protocol bound to the END via<b><i><a href="./muxLib.html#muxBind">muxBind</a></i>( )</b> will be called. Each <b><i>stackShutdownRtn</i>( )</b> is expectedto call <b><i><a href="./muxLib.html#muxUnbind">muxUnbind</a></i>( )</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 + -