📄 muxlib.html
字号:
void * pCookie, /* protocol/device binding from muxBind() */ M_BLK_ID pMblk, /* structure to contain packet */ M_BLK_ID pSrcAddr, /* structure containing source address */ M_BLK_ID pDstAddr /* structure containing destination address */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>Use this routine to create a frame with an appropriate link-layer address. As input, this function expects the source address, the destination address, and the data you want to include in the frame. When control returns from the <b><a href="./muxLib.html#muxAddressForm">muxAddressForm</a>( )</b> call, the <i>pMblk</i> parameter references a frame ready for transmission. Internally, <b><a href="./muxLib.html#muxAddressForm">muxAddressForm</a>( )</b> either prepended the link-layer header to the data buffer supplied in <i>pMblk</i> (if there was enough room) or it allocated a new <b>mBlk</b>-<b>clBlk</b>-cluster and prepended the new <b>mBlk</b> to the <b>mBlk</b> chain supplied in <i>pMblk</i>.<p></blockquote><h4>NOTE</h4><blockquote><p>You should set the <b>pDstAddr.mBlkHdr.reserved</b> field to the networkservice type.<p><dl><dt><i>pCookie</i><dd>Expects the cookie returned from the <b><a href="./muxLib.html#muxBind">muxBind</a>( )</b>. This cookie indicates the device to which the MUX has bound this protocol. <dt><i>pMblk</i><dd>Expects a pointer to the <b>mBlk</b> structure that contains the packet. <dt><i>pSrcAddr</i><dd>Expects a pointer to the <b>mBlk</b> that contains the source address.<dt><i>pDstAddr</i><dd>Expects a pointer to the <b>mBlk</b> that contains the destination address.</dl></blockquote><h4>NOTE</h4><blockquote><p>This routine is used only with ENDs, and is not needed for NPTdrivers.<p></blockquote><h4>VXWORKS AE PROTECTION DOMAINS</h4><blockquote><p>Under VxWorks AE, you can call <b><a href="./muxLib.html#muxAddressForm">muxAddressForm</a>( )</b> from within the kernel protection domain only, and the data referenced in the <i>pCookie</i> parameter must reside in the kernel protection domain. In addition, the returned <b>M_BLK_ID</b> 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><b>M_BLK_ID</b> or NULL.<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="muxPacketDataGet"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries : Routines</i></a></p></blockquote><h1>muxPacketDataGet( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>muxPacketDataGet( )</strong> - return the data from a packet</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS muxPacketDataGet ( void * pCookie, /* protocol/device binding from muxBind() */ M_BLK_ID pMblk, /* returns the packet data */ LL_HDR_INFO * pLinkHdrInfo /* returns the packet header information */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>Any service bound to a driver may use this routine to extract thepacket data and remove the link-level header information. Thisroutine copies the header information from the packet referenced in<i>pMblk</i> into the <b>LL_HDR_INFO</b> structure referenced in <i>pLinkHdrInfo</i>.<p><dl><dt><i>pCookie</i><dd>Expects the cookie returned from the <b><a href="./muxLib.html#muxBind">muxBind</a>( )</b> call. Thiscookie indicates the device to which the MUX bound this service.<p><dt><i>pMblk</i><dd>Expects a pointer to an <b>mBlk</b> or <b>mBlk</b> cluster representing a packetcontaining the data to be returned<p><dt><i>pLinkHdrInfo</i><dd>Expects a pointer to an <b>LL_HDR_INFO</b> structure into which the packet headerinformation is copied from the incoming <b>mBlk</b><br> </dl></blockquote><h4>VXWORKS AE PROTECTION DOMAINS</h4><blockquote><p>Under VxWorks AE, you can call <b><a href="./muxLib.html#muxPacketDataGet">muxPacketDataGet</a>( )</b> from within the kernel protection domain only, and the data referenced in the 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; or ERROR, if the device type is not recognized.<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="muxPacketAddrGet"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries : Routines</i></a></p></blockquote><h1>muxPacketAddrGet( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>muxPacketAddrGet( )</strong> - get addressing information from a packet</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS muxPacketAddrGet ( void * pCookie, /* protocol/device binding from muxBind() */ M_BLK_ID pMblk, /* structure to contain packet */ M_BLK_ID pSrcAddr, /* structure containing source address */ M_BLK_ID pDstAddr, /* structure containing destination address */ M_BLK_ID pESrcAddr, /* structure containing the end source */ M_BLK_ID pEDstAddr /* structure containing the end destination */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>The routine returns the immediate source, immediate destination, ultimate source, and ultimate destination addresses from the packet pointed to in the first <b>M_BLK_ID</b>. This routine makes no attempt to extract that information from the packet directly. Instead, it passes the packet through to the driver routine that knows how to interpret the packets that it has received.<p><dl><dt><i>pCookie</i><dd>Expects the cookie returned from the <b><a href="./muxLib.html#muxBind">muxBind</a>( )</b> call. Thiscookie indicates the device to which the MUX bound this service.<p><dt><i>pMblk</i><dd>Expects an <b>M_BLK_ID</b> representing packet data from which the addressinginformation is to be extracted<p><dt><i>pSrcAddr</i><dd>Expects NULL or an <b>M_BLK_ID</b> which will hold the local source addressextracted from the packet<p><dt><i>pDstAddr</i><dd>Expects NULL or an <b>M_BLK_ID</b> which will hold the local destination addressextracted from the packet<p><dt><i>pESrcAddr</i><dd>Expects NULL or an <b>M_BLK_ID</b> which will hold the end source addressextracted from the packet<p><dt><i>pEDstAddr</i><dd>Expects NULL or an <b>M_BLK_ID</b> which will hold the end destination addressextracted from the packet</dl></blockquote><h4>VXWORKS AE PROTECTION DOMAINS</h4><blockquote><p>Under VxWorks AE, you can call <b><a href="./muxLib.html#muxPacketAddrGet">muxPacketAddrGet</a>( )</b> from within the kernel protection domain only, and the data referenced in the 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 or ERROR.<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="endFindByName"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries : Routines</i></a></p></blockquote><h1>endFindByName( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>endFindByName( )</strong> - find a device using its string name</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>END_OBJ * endFindByName ( char * pName, /* device name to search for */ int unit )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine takes a string name and a unit number and finds thedevice that has that name/unit combination.<p></blockquote><h4>VXWORKS AE PROTECTION DOMAINS</h4><blockquote><p>Under VxWorks AE, you can call <b><a href="./muxLib.html#endFindByName">endFindByName</a>( )</b> from within the kernel protection domain only, and the data referenced in the <i>pName</i> parameter must reside in the kernel protection domain. In addition, the returned <b>END_OBJ</b> 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 pointer to an <b>END_OBJ</b>; or NULL, if the device is not found.</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./muxLib.html#top">muxLib</a></b><hr><a name="muxDevExists"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries : Routines</i></a></p></blockquote><h1>muxDevExists( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>muxDevExists( )</strong> - tests whether a device is already loaded into the MUX</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>BOOL muxDevExists ( char * pName, /* string containing a device name (ln, ei, ...)*/ int unit /* unit number */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine takes a string device name (for example, ln or ei) and a unitnumber. If this device is already known to the MUX, it returns TRUE.Otherwise, this routine returns FALSE. <p><dl><dt><i>pName</i><dd>Expects a pointer to a string containing the device name<p><dt><i>unit</i><dd>Expects the unit number of the device</dl></blockquote><h4>VXWORKS AE PROTECTION DOMAINS</h4><blockquote><p>Under VxWorks AE, you can call <b><a href="./muxLib.html#muxDevExists">muxDevExists</a>( )</b> from within the kernel protection domain only, and the data referenced in the <i>pName</i> parameter 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>TRUE, if the device exists; else FALSE.</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./muxLib.html#top">muxLib</a></b><hr><a name="muxAddrResFuncAdd"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries : Routines</i></a></p></blockquote><h1>muxAddrResFuncAdd( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>muxAddrResFuncAdd( )</strong> - replace the default address resolution function</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS muxAddrResFuncAdd ( long ifType, /* Media interface type, typically from m2Lib.h */ long protocol, /* Service type, for instance from RFC 1700 */ FUNCPTR addrResFunc /* Function to call. */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>Use <b><a href="./muxLib.html#muxAddrResFuncAdd">muxAddrResFuncAdd</a>( )</b> to register an address resolution function for an interface-type/protocol pair. You must call <b><a href="./muxLib.html#muxAddrResFuncAdd">muxAddrResFuncAdd</a>( )</b> prior to calling the protocol's <i>protocol</i><b>Attach( )</b> routine. If the driver registers itself as an Ethernet driver, you do not need to call <b><a href="./muxLib.html#muxAddrResFuncAdd">muxAddrResFuncAdd</a>( )</b>. VxWorks automatically assigns <b>arpresolve( )</b> to registered Ethernet devices. The <b><a href="./muxLib.html#muxAddrResFuncAdd">muxAddrResFuncAdd</a>( )</b> functionality is intended for those who want to useVxWorks network stack with non-Ethernet drivers that require address resolution. <p><dl><dt><i>ifType</i><dd>Expects a media interface or network driver type, such as can be found in
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -