📄 muxlib.html
字号:
int unit, /* unit number */ BOOL (* stackRcvRtn) (void* , long, M_BLK_ID, LL_HDR_INFO * , void* ), /* receive function to be called. */ STATUS (* stackShutdownRtn) (void* , void* ), /* routine to call to shutdown the stack */ STATUS (* stackTxRestartRtn) (void* , void* ), /* routine to tell the stack it can transmit */ void (* stackErrorRtn) (END_OBJ* , END_ERR* , void* ), /* routine to call on an error. */ long type, /* protocol type from RFC1700 and many */ /* other sources (for example, 0x800 is IP) */ char * pProtoName, /* string name for protocol */ void * pSpare /* per protocol spare pointer */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>A network service uses this routine to bind to an END specified by the<i>pName</i> and <i>unit</i> arguments (for example, ln and 0, ln and 1, or ei and 0).<p></blockquote><h4>NOTE</h4><blockquote><p>This routine should only be used to bind to drivers that use theold END driver callback function prototypes. NPT drivers, or END driversthat use the newer callback function prototypes, should use <b><a href="./muxTkLib.html#muxTkBind">muxTkBind</a>( )</b>instead. See the<i>Network Protocol Toolkit Programmer's Guide </i>for more information on when to use <b><a href="./muxLib.html#muxBind">muxBind</a>( )</b> and <b><a href="./muxTkLib.html#muxTkBind">muxTkBind</a>( )</b>.<p>The <i>type</i> argument assigns a network service to one of several classes.Standard services receive the portion of incoming data associatedwith <i>type</i> values from RFC 1700. Only one service for each RFC 1700type value may be bound to an END.<p>Services with <i>type</i> <b>MUX_PROTO_SNARF</b> provide a mechanism for bypassingthe standard services for purposes such as firewalls. These serviceswill get incoming packets before any of the standard services.<p>Promiscuous services with <i>type</i> <b>MUX_PROTO_PROMISC</b> receive any packetsnot consumed by the snarf or standard services. <p>The MUX allows multiple snarf and promiscuous services but does notcoordinate between them. It simply delivers available packets to eachservice in FIFO order. Services that consume packets may prevent"downstream" services from receiving data if the desired packets overlap.<p>An output service (with <i>type</i> <b>MUX_PROTO_OUTPUT</b>) receives outgoing databefore it is sent to the device. This service type allows two networkservices to communicate directly and provides a mechanism for loop-backtesting. Only one output service is supported for each driver.<p>The MUX calls the registered <i>stackRcvRtn</i> whenever it receives a packetof the appropriate type. If that routine returns TRUE, the packet isnot offered to any remaining services (or to the driver in the case ofoutput services). A service (including an output service) may returnFALSE to examine a packet without consuming it. See the description of a<b>stackRcvRtn( )</b> in the<i>Network Protocol Toolkit Programmer's Guide </i>for additional information about the expected behavior of that routine.<p>The <i>stackShutdownRtn</i> argument provides a function that the MUX can useto shut down the service. See the<i>Network Protocol Toolkit Programmer's Guide </i>for a description of how to write such a routine.<p>The <i>pProtoName</i> argument provides the name of the service as a characterstring. A service name is assigned internally if the argument is NULL.<p>The <i>pSpare</i> argument registers a pointer to data defined by the service.The MUX includes this argument in calls to the call back routines from this service.<p></blockquote><h4>VXWORKS AE PROTECTION DOMAINS</h4><blockquote><p>Under VxWorks AE, you can call <b><a href="./muxLib.html#muxBind">muxBind</a>( )</b> from within the kernel protection domain only, and the data referenced in the <i>stackRcvRtn</i>, <i>stackShutdownRtn</i>, <i>stackTxRestartRtn</i>, <i>stackErrorRtn</i> and <i>pSpare</i> parameters must reside in the kernel protection domain. In addition, the returned void pointer is valid in the kernel protection domain only. This restriction does not apply under non-AE versions of VxWorks. <p></blockquote><h4>RETURNS</h4><blockquote><p>A cookie identifying the binding between the service and driver;or NULL, if an error occurred.<p></blockquote><h4>ERRNO</h4><blockquote><p><b>S_muxLib_NO_DEVICE</b>, <b>S_muxLib_ALREADY_BOUND</b>, <b>S_muxLib_ALLOC_FAILED</b></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.htm"><i>OS Libraries : Routines</i></a></p></blockquote><h1>muxSend( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>muxSend( )</strong> - send a packet out on a network interface</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS muxSend ( void * pCookie, /* protocol/device binding from muxBind() */ M_BLK_ID pNBuff /* data to be sent */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine transmits a packet for the service specified by <i>pCookie</i>.You got this cookie from a previous bind call that bound the service to a particular interface. This <b><a href="./muxLib.html#muxSend">muxSend</a>( )</b> call uses this bound interface to transmit the packet.<p><dl><dt><i>pCookie</i><dd>Expects the cookie returned from <b><a href="./muxLib.html#muxBind">muxBind</a>( )</b>. This cookie identifies aparticular service-to-interface binding.<dt><i>pNBuff</i><dd>Expects a pointer to the buffer that contains the packet you want to transmit. Before you call <b><a href="./muxLib.html#muxSend">muxSend</a>( )</b>, you need to put the addressing information at the head of the buffer. To do this, call <b><a href="./muxLib.html#muxAddressForm">muxAddressForm</a>( )</b>. </dl></blockquote><h4>VXWORKS AE PROTECTION DOMAINS</h4><blockquote><p>Under VxWorks AE, you can call <b><a href="./muxLib.html#muxSend">muxSend</a>( )</b> from within the kernel protection domain only, and the data referenced in the <i>pCookie</i> and <i>pNBuff</i> parameters must reside in the kernel protection domain. This restriction does not apply under non-AE versions of VxWorks. <p></blockquote><h4>RETURNS</h4><blockquote><p>OK; ENETDOWN, if <i>pCookie</i> does not represent a valid binding;or ERROR, if the driver's <b>endSend( )</b> routine fails.<p></blockquote><h4>ERRNO</h4><blockquote><p><b>S_muxLib_NO_DEVICE</b></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.htm"><i>OS Libraries : Routines</i></a></p></blockquote><h1>muxPollSend( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>muxPollSend( )</strong> - now <b>deprecated</b>, see <b><a href="./muxTkLib.html#muxTkPollSend">muxTkPollSend</a>( )</b></p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS muxPollSend ( void * pCookie, /* binding instance from muxBind() */ M_BLK_ID pNBuff /* data to be sent */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine transmits a packet for the service specified by <i>pCookie</i>.You got this cookie from a previous bind call that bound the service to a particular interface. This <b><a href="./muxLib.html#muxPollSend">muxPollSend</a>( )</b> call uses this bound interface to transmit the packet. The <i>pNBuff</i> argument is a buffer (<b>mBlk</b>) chain that contains the packet to be sent.<p></blockquote><h4>RETURNS</h4><blockquote><p>OK; ENETDOWN, if <i>pCookie</i> does not represent a valid device;ERROR, if the device type is not recognized; or an error value from the device's registered <b>endPollSend( )</b> routine. <p></blockquote><h4>ERRNO</h4><blockquote><p><b>S_muxLib_NO_DEVICE</b></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.htm"><i>OS Libraries : Routines</i></a></p></blockquote><h1>muxPollReceive( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>muxPollReceive( )</strong> - now <b>deprecated</b>, see <b><a href="./muxTkLib.html#muxTkPollReceive">muxTkPollReceive</a>( )</b></p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS muxPollReceive ( void * pCookie, /* binding instance from muxBind() */ M_BLK_ID pNBuff /* a vector of buffers passed to us */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p></blockquote><h4>NOTE</h4><blockquote><p>This routine has been deprecated in favor of <b><a href="./muxTkLib.html#muxTkPollReceive">muxTkPollReceive</a>( )</b><p>Upper layers can call this routine to poll for a packet.<p><dl><dt><i>pCookie</i><dd>Expects the cookie that was returned from <b><a href="./muxLib.html#muxBind">muxBind</a>( )</b>.This cookie indicates which driver to query for available data.<p><dt><i>pNBuff</i><dd>Expects a pointer to a buffer chain into which to receive data.</dl></blockquote><h4>VXWORKS AE PROTECTION DOMAINS</h4><blockquote><p>Under VxWorks AE, you can call <b><a href="./muxLib.html#muxPollReceive">muxPollReceive</a>( )</b> from within the kernel protection domain only, and the data referenced in the <i>pCookie</i> and <i>pNBuff</i> parameters must reside in the kernel protection domain. This restriction does not apply under non-AE versions of VxWorks. <p></blockquote><h4>RETURNS</h4><blockquote><p>OK; ENETDOWN, if the <i>pCookie</i> argument does not represent a loaded driver; or an error value returned from the driver's registered <b>endPollReceive( )</b> function.<p></blockquote><h4>ERRNO</h4><blockquote><p><b>S_muxLib_NO_DEVICE</b></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.htm"><i>OS Libraries : Routines</i></a></p></blockquote><h1>muxIoctl( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>muxIoctl( )</strong> - send control information to the MUX or to a device</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS muxIoctl ( void * pCookie, /* service/device binding from */ /* muxBind()/muxTkBind() */ 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 service 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 to the device without modification.<p>Typical uses of <b><a href="./muxLib.html#muxIoctl">muxIoctl</a>( )</b> include commands to start, stop, or reset thenetwork interface, or to add or configure MAC and network addresses.<p><dl><dt><i>pCookie</i><dd>Expects the cookie returned from <b><a href="./muxLib.html#muxBind">muxBind</a>( )</b> or <b><a href="./muxTkLib.html#muxTkBind">muxTkBind</a>( )</b>. Thiscookie indicates the device to which this service is bound. <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>endIoctl( )</b> and<b>nptIoctl( )</b> routines provided in the<i>Network Protocol Toolkit Programmer's Guide .</i><dt><i>data</i><dd>Expects the data or a pointer to the data needed to carry out the commandspecified in <i>cmd</i>. <br> </dl></blockquote><h4>VXWORKS AE PROTECTION DOMAINS</h4><blockquote><p>Under VxWorks AE, you can call <b><a href="./muxLib.html#muxIoctl">muxIoctl</a>( )</b> from within the kernel protection domain only, and the data referenced in the <i>pCookie</i> and <i>data</i> parameters must reside in the kernel protection domain. This restriction does not apply under non-AE versions of VxWorks. <p></blockquote><h4>RETURNS</h4><blockquote><p>OK; ENETDOWN, if <i>pCookie</i> does not represent a bound device;or ERROR, if the command fails.<p></blockquote><h4>ERRNO</h4><blockquote><p><b>S_muxLib_NO_DEVICE</b></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.htm"><i>OS Libraries : Routines</i></a></p></blockquote><h1>muxMCastAddrAdd( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>muxMCastAddrAdd( )</strong> - add a multicast address to a device's multicast table </p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS muxMCastAddrAdd ( void * pCookie, /* binding instance from muxBind() or */ /* muxTkBind() */ 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 by a device.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -