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

📄 muxtklib.html

📁 Vxworks API操作系统和驱动程序设计API。压缩的HTML文件
💻 HTML
📖 第 1 页 / 共 2 页
字号:
those registered as SNARF or PROMISCUOUS.<p><dt><i>pSpareData</i><dd>Expects a pointer to any spare data the driver needs to pass up to thenetwork service layer, or NULL</dl></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="./muxTkLib.html#top">muxTkLib</a></b><hr><a name="muxTkSend"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries :  Routines</i></a></p></blockquote><h1>muxTkSend(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong>muxTkSend(&nbsp;)</strong> - send a packet out on a Toolkit or END network interface</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS muxTkSend    (    void *   pCookie,         /* returned by muxTkBind()*/    M_BLK_ID pNBuff,          /* data to be sent */    char *   dstMacAddr,      /* destination MAC address */    USHORT   netType,         /* network protocol that is calling us * is */                              /* netType redundant? * */     void *   pSpareData       /* spare data passed on each send */    )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine uses <i>pCookie</i> to find a specific network interface anduses that driver's send routine to transmit a packet.<p>The transmit entry point for an NPT driver uses the following prototype:<pre>STATUS nptSend    (    END_OBJ * pEND,           /* END object */    M_BLK_ID  pPkt,           /* network packet to transmit */    char *    pDstAddr,       /* destination MAC address */    int       netType         /* network service type */    void *    pSpareData      /* optional network service data */    )</pre>The transmit entry point for an END driver the following prototype:<pre>STATUS endSend    (    void *    pEND,   /* END object */    M_BLK_ID  pPkt,   /* Network packet to transmit */    )</pre>An END driver must continue to provide the <b>addressForm(&nbsp;)</b> entry point toconstruct the appropriate link-level header. The <i>pDst</i> and <i>pSrc</i> <b>M_BLK</b>arguments to that routine supply the link-level addresses with the<b>mData</b> and <b>mLen</b> fields. The reserved field of the destination <b>M_BLK</b>contains the network service type. Both arguments <i>must</i>be treated as read-only.<p>To send a fully formed physical layer frame to a device using an NPTdriver (which typically forms the frame itself), set the <b>M_L2HDR</b> flagin the <b>mBlk</b> header.<p>A driver may be written so that it returns the error <b>END_ERR_BLOCK</b> ifthe driver has insufficient resources to transmit data.  The networkservice sublayer can use this feedback to establish a flow controlmechanism by holding off on making any further calls to <b><a href="./muxTkLib.html#muxTkSend">muxTkSend</a>(&nbsp;)</b>until the device is ready to restart transmission, at which time thedevice should call <b>muxTxRestart(&nbsp;)</b> which will call the service sublayer's<b>stackRestartRtn(&nbsp;)</b> that was registered for the interface at bind time.<p><dl><dt><i>pCookie</i><dd>Expects the cookie returned from <b><a href="./muxTkLib.html#muxTkBind">muxTkBind</a>(&nbsp;)</b>.  This Cookieidentifies the device to which the MUX has bound this protocol.<p><dt><i>pNBuff</i><dd>The network packet to be sent, formed into an <b>mBlk</b> chain.<p><dt><i>dstMacAddr</i><dd>Destination MAC address to which packet is to be sent, determinedperhaps by calling the address resolution function that was registeredfor this service/device interface.<p><dt><i>netType</i><dd>Network service type of the sending service.  This will be used toidentify the payload type in the MAC frame.<p><dt><i>pSpareData</i><dd>Reference to any additional data the network service wants to pass to thedriver during the send operation.</dl></blockquote><h4>NOTE</h4><blockquote><p>A driver may return <b>END_ERR_BLOCK</b> if it is temporarily unableto complete the send, and then call <b>muxTxRestart(&nbsp;)</b> to indicate that itis again able to send data.  If the driver has been written in this way,<b><a href="./muxTkLib.html#muxTkSend">muxTkSend</a>(&nbsp;)</b> will pass the <b>ERR_END_BLOCK</b> back as its own return value andthe service can wait for its <b>stackRestartRtn(&nbsp;)</b> callback routine to becalled before trying the send operation again.<p></blockquote><h4>RETURNS</h4><blockquote><p>OK; ENETDOWN, if <i>pCookie</i> doesn't represent a valid device;or an error, if the driver's <b><a href="./sockLib.html#send">send</a>(&nbsp;)</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="./muxTkLib.html#top">muxTkLib</a></b><hr><a name="muxTkPollSend"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries :  Routines</i></a></p></blockquote><h1>muxTkPollSend(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong>muxTkPollSend(&nbsp;)</strong> - send a packet out in polled mode to an END or NPT interface</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS muxTkPollSend    (    void *   pCookie,         /* returned by muxTkBind()*/    M_BLK_ID pNBuff,          /* data to be sent */    char *   dstMacAddr,      /* destination MAC address */    USHORT   netType,         /* network protocol that is calling us * is */                              /* netType redundant? * */     void *   pSpareData       /* spare data passed on each send */    )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine uses <i>pCookie</i> to find a specific network interface anduse that driver's <b>pollSend(&nbsp;)</b> routine to transmit a packet.<p>This routine replaces the <b><a href="./muxLib.html#muxPollSend">muxPollSend</a>(&nbsp;)</b> routine for both END and NPTdrivers.<p>When using this routine, the driver does not need to call <b><a href="./muxLib.html#muxAddressForm">muxAddressForm</a>(&nbsp;)</b>to complete the packet, nor does it need to prepend an <b>mBlk</b> of type<b>MF_IFADDR</b> containing the destination address.<p>An NPT driver's <b>pollSend(&nbsp;)</b> entry point is called based on this prototype:<pre>STATUS nptPollSend    (    END_OBJ * pEND,           /* END object */    M_BLK_ID  pPkt,           /* network packet to transmit */    char *    pDstAddr,       /* destination MAC address */    long      netType         /* network service type */    void *    pSpareData      /* optional network service data */    )</pre>The <b>pollSend(&nbsp;)</b> entry point for an END uses this prototype:<pre>STATUS endPollSend    (    END_OBJ * pEND,   /* END object */    M_BLK_ID  pPkt,   /* network packet to transmit */    )</pre>An END driver must provide the <b>addressForm(&nbsp;)</b> entry point toconstruct the appropriate link-level header. The <i>pDst</i> and <i>pSrc</i> <b>M_BLK</b>arguments to that routine supply the link-level addresses with themData and mLen fields. The reserved field of the destination <b>M_BLK</b>contains the network service type. Both arguments <i>must</i> be treated asread-only.<p><dl><dt><i>pCookie</i><dd>Expects the cookie returned from <b><a href="./muxLib.html#muxBind">muxBind</a>(&nbsp;)</b> or <b><a href="./muxTkLib.html#muxTkBind">muxTkBind</a>(&nbsp;)</b>.  This cookieidentifies the device to which the MUX has bound this protocol.<p><dt><i>pNBuff</i><dd>The network packet to be sent.<p><dt><i>dstMacAddr</i><dd>Destination MAC address to which packet is to be sent<p><dt><i>netType</i><dd>Network service type that will be used to identify the payload data inthe MAC frame.<p><dt><i>pSpareData</i><dd>Reference to any additional data the network service wants to pass to thedriver during the send operation.</dl></blockquote><h4>RETURNS</h4><blockquote><p>OK, ENETDOWN if <i>pCookie</i> doesn't represent a valid device,or an error if the driver's <b>pollSend(&nbsp;)</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="./muxTkLib.html#top">muxTkLib</a></b><hr><a name="muxTkPollReceive"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries :  Routines</i></a></p></blockquote><h1>muxTkPollReceive(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong>muxTkPollReceive(&nbsp;)</strong> - poll for a packet from a NPT or END driver</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS muxTkPollReceive    (    void *   pCookie,         /* cookie from muxTkBind routine */    M_BLK_ID pNBuff,          /* a vector of buffers passed to us */    void *   pSpare           /* a reference to spare data is returned here */    )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This is the routine that an upper layer can call to poll for a packet.Any service type retrieved from the MAC frame is passed via the reservedmember of the <b>M_BLK</b> header.<p>This API effectively replaces <b><a href="./muxLib.html#muxPollReceive">muxPollReceive</a>(&nbsp;)</b> for both END and NPT drivers.<p>For an NPT driver its <b>pollReceive(&nbsp;)</b> entry point is called based on the newprototype:<pre>STATUS nptPollReceive    (    END_OBJ * pEND,           /* END object */    M_BLK_ID  pPkt,           /* network packet buffer */    long *    pNetSvc,        /* service type from MAC frame */    long *    pNetOffset,     /* offset to network packet */    void *    pSpareData      /* optional network service data */    )</pre>The <b>pollReceive(&nbsp;)</b> entry point for an END driver uses the original prototype:<pre>STATUS endPollRcv    (    END_OBJ * pEND,   /* END object */    M_BLK_ID  pPkt,   /* network packet buffer */    )</pre>An END driver must continue to provide the <b>packetDataGet(&nbsp;)</b> entry point<p><dl><dt><i>pCookie</i><dd>Expects the cookie that was returned from <b><a href="./muxLib.html#muxBind">muxBind</a>(&nbsp;)</b> or <b><a href="./muxTkLib.html#muxTkBind">muxTkBind</a>(&nbsp;)</b>.This "cookie" identifies the driver. <p><dt><i>pNBuff</i><dd>Expects a pointer to a buffer chain into which incoming data will be put.<p><dt><i>pSpareData</i><dd>A pointer to any optional spare data provided by a NPT driver. AlwaysNULL with an END driver.</dl></blockquote><h4>RETURNS</h4><blockquote><p>OK; EAGAIN, if no packet was available; ENETDOWN, if the <b>pCookie</b>does not represent a loaded driver; or an error value returned from the driver's registered <b>pollReceive(&nbsp;)</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="./muxTkLib.html#top">muxTkLib</a></b></body></html>

⌨️ 快捷键说明

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