m2iflib.html
来自「Vxworks API操作系统和驱动程序设计API。压缩的HTML文件」· HTML 代码 · 共 1,089 行 · 第 1/3 页
HTML
1,089 行
<p align=right><a href="rtnIndex.htm"><i>OS Libraries : Routines</i></a></p></blockquote><h1>m2IfVariableUpdate( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>m2IfVariableUpdate( )</strong> - update the contents of an interface non-counter object </p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS m2IfVariableUpdate ( M2_ID * pId, /* The pointer to the device M2_ID object */ UINT varId, /* Variable to update */ caddr_t pData /* Data to use */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This function is used to update an interface variable. The variable isspecified by varId and the data to use is specified by pData. Note thatdifferent variable expect different types of data. Here is a list of thevariables and the type of data expected. Therefore, pData will be cast to the type listed below for each variable.<table><tr valign=top><th align=left>Variable </th><th align=left> Casted to Type</tr><tr><td colspan="2"><hr></tr><tr valign=top><td align=left>ifDescr </td><td align=left> char *</tr><tr valign=top><td align=left>ifType </td><td align=left> UINT</tr><tr valign=top><td align=left>ifMtu </td><td align=left> ULONG</tr><tr valign=top><td align=left>ifSpeed </td><td align=left> ULONG</tr><tr valign=top><td align=left>ifPhysAddress </td><td align=left> <b>M2_PHYADDR</b> *</tr><tr valign=top><td align=left>ifAdminStatus </td><td align=left> ULONG</tr><tr valign=top><td align=left>ifOperStatus </td><td align=left> ULONG</tr><tr valign=top><td align=left>ifLastChange </td><td align=left> ULONG</tr><tr valign=top><td align=left>ifOutQLen </td><td align=left> ULONG</tr><tr valign=top><td align=left>ifSpecific </td><td align=left> <b>M2_OBJECTID</b> *</tr><tr valign=top><td align=left>ifName </td><td align=left> char *</tr><tr valign=top><td align=left>ifLinkUpDownTrapEnable </td><td align=left> UINT</tr><tr valign=top><td align=left>ifHighSpeed </td><td align=left> ULONG</tr><tr valign=top><td align=left>ifPromiscuousMode </td><td align=left> UINT</tr><tr valign=top><td align=left>ifConnectorPresent </td><td align=left> UINT</tr><tr valign=top><td align=left>ifAlias </td><td align=left> char *</tr><tr valign=top><td align=left></tr></tr></table></blockquote><h4>RETURNS</h4><blockquote><p>ERROR, if the <b>M2_ID</b> is NULL; OK, if the variable was updated.</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./m2IfLib.html#top">m2IfLib</a></b><hr><a name="m2IfPktCountRtnInstall"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries : Routines</i></a></p></blockquote><h1>m2IfPktCountRtnInstall( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>m2IfPktCountRtnInstall( )</strong> - install an interface packet counter routine</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS m2IfPktCountRtnInstall ( M2_ID * pId, M2_PKT_COUNT_RTN pRtn )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This function installs a routine in the <b>M2_ID</b>. This routine is a packetcounter which is able to update all the interface counters.<p></blockquote><h4>RETURNS</h4><blockquote><p>ERROR if the <b>M2_ID</b> is NULL, OK if the routine was installed.</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./m2IfLib.html#top">m2IfLib</a></b><hr><a name="m2IfCtrUpdateRtnInstall"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries : Routines</i></a></p></blockquote><h1>m2IfCtrUpdateRtnInstall( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>m2IfCtrUpdateRtnInstall( )</strong> - install an interface counter update routine</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS m2IfCtrUpdateRtnInstall ( M2_ID * pId, M2_CTR_UPDATE_RTN pRtn )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This function installs a routine in the <b>M2_ID</b>. This routine is able toupdate a single specified interface counter.<p></blockquote><h4>RETURNS</h4><blockquote><p>ERROR if the <b>M2_ID</b> is NULL, OK if the routine was installed.</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./m2IfLib.html#top">m2IfLib</a></b><hr><a name="m2IfVarUpdateRtnInstall"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries : Routines</i></a></p></blockquote><h1>m2IfVarUpdateRtnInstall( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>m2IfVarUpdateRtnInstall( )</strong> - install an interface variable update routine</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS m2IfVarUpdateRtnInstall ( M2_ID * pId, M2_VAR_UPDATE_RTN pRtn )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This function installs a routine in the <b>M2_ID</b>. This routine is able toupdate a single specified interface variable.<p></blockquote><h4>RETURNS</h4><blockquote><p>ERROR if the <b>M2_ID</b> is NULL, OK if the routine was installed.</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./m2IfLib.html#top">m2IfLib</a></b><hr><a name="m2IfInit"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries : Routines</i></a></p></blockquote><h1>m2IfInit( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>m2IfInit( )</strong> - initialize MIB-II interface-group routines</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS m2IfInit ( FUNCPTR pTrapRtn, /* pointer to user trap generator */ void * pTrapArg /* pointer to user trap generator argument */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine allocates the resources needed to allow access to the MIB-II interface-group variables. This routine must be called before any interface variables can be accessed. The input parameter <i>pTrapRtn</i> is anoptional pointer to a user-supplied SNMP trap generator. The input parameter<i>pTrapArg</i> is an optional argument to the trap generator. Only one trapgenerator is supported.<p></blockquote><h4>VXWORKS AE PROTECTION DOMAINS</h4><blockquote><p>Under VxWorks AE, you can call <b><a href="./m2IfLib.html#m2IfInit">m2IfInit</a>( )</b> from within the kernel protection domain only, and the data referenced in the <i>pTrapRtn</i> and <i>pTrapArg</i> parameters must reside in the kernel protection domain. This restriction does not apply to non-AE versions of VxWorks. <p></blockquote><h4>RETURNS</h4><blockquote><p>OK, if successful; ERROR, if an error occurred.<p></blockquote><h4>ERRNO</h4><blockquote><p><p><b>S_m2Lib_CANT_CREATE_IF_SEM</b><p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./m2IfLib.html#top">m2IfLib</a></b>, <b><a href="./m2IfLib.html#m2IfGroupInfoGet">m2IfGroupInfoGet</a>( )</b>, <b><a href="./m2IfLib.html#m2IfTblEntryGet">m2IfTblEntryGet</a>( )</b>, <b><a href="./m2IfLib.html#m2IfTblEntrySet">m2IfTblEntrySet</a>( )</b>, <b><a href="./m2IfLib.html#m2IfDelete">m2IfDelete</a>( )</b><hr><a name="m2IfTableUpdate"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries : Routines</i></a></p></blockquote><h1>m2IfTableUpdate( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>m2IfTableUpdate( )</strong> - insert or remove an entry in the ifTable</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS m2IfTableUpdate ( struct ifnet * pIfNet, UINT status, /* attaching or detaching */ int (* if_ioctl) /* protocol specific ioctl or null for */ /* default (ethernet) */ (struct socket* ,u_long,caddr_t), STATUS (* addr_get) /* func to grab the interface's addrs, null */ /* for default (ethernet) */ (struct ifnet* , M2_IFINDEX* ) )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine is called by <b>if_attach</b> and <b>if_detach</b> to insert/removean entry from the local <b><a href="./m2IfLib.html#top">m2IfLib</a></b> ifTable. The status can be either<b>M2_IF_TABLE_INSERT</b> or <b>M2_IF_TABLE_REMOVE</b>. The ifIndex that is searchedfor in the AVL tree is specified in given the ifnet struct.<i><b>if_ioctl</b></i> is a function pointer to change the flags on the interface.<i>addr_get</i> is a function pointer to add the interface's addresses toifRcvAddressTable. Ethernet interfaces can use NULL for both functionpointers, other interfaces will need to pass an appropriate function.<p></blockquote><h4>RETURNS</h4><blockquote><p>ERROR if entry does not exist, OK if the entry was deleted</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./m2IfLib.html#top">m2IfLib</a></b><hr><a name="rcvEtherAddrGet"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries : Routines</i></a></p></blockquote><h1>rcvEtherAddrGet( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>rcvEtherAddrGet( )</strong> - populate the rcvAddr fields for the ifRcvAddressTable</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS rcvEtherAddrGet ( struct ifnet * pIfNet, /* pointer to the interface's ifnet */ M2_IFINDEX * pIfIndexEntry /* avl node */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This function needs to be called to add all physical addresses for which aninterface may receive or send packets. This includes unicast and multicastaddresses. The address is inserted into the linked list maintained in theAVL node corresponding to the interface. Given the ifnet struct and theAVL node corresponding to the interface, this function goes through all thephysical addresses associated with this interface and adds them into thelinked list.<p></blockquote><h4>RETURNS</h4><blockquote><p>OK, if successful; ERROR, otherwise.</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./m2IfLib.html#top">m2IfLib</a></b><hr><a name="rcvEtherAddrAdd"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries : Routines</i></a></p></blockquote><h1>rcvEtherAddrAdd( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>rcvEtherAddrAdd( )</strong> - add a physical address into the linked list</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS rcvEtherAddrAdd ( M2_IFINDEX * pIfIndexEntry, /* the avl node */ unsigned char * pEnetAddr /* the addr to be added */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This function is a helper function for rcvEtherAddrGet. It is called toadd a single physical address into the linked list of addresses maintainedby the AVL node.<p></blockquote><h4>RETURNS</h4><blockquote><p>OK, if successful; ERROR, otherwise.</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./m2IfLib.html#top">m2IfLib</a></b><hr><a name="m2IfTblEntryGet"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries : Routines</i></a></p></blockquote><h1>m2IfTblEntryGet( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>m2IfTblEntryGet( )</strong> - get a MIB-II interface-group table entry</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS m2IfTblEntryGet ( int search, /* M2_EXACT_VALUE or M2_NEXT_VALUE */ void * pIfReqEntry /* pointer to requested interface entry */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine maps the MIB-II interface index to the system's internalinterface index. The internal representation is in the form of a balancedAVL tree indexed by ifIndex of the interface. The <i>search</i> parameter is set to either <b>M2_EXACT_VALUE</b> or <b>M2_NEXT_VALUE</b>; for a discussion of its use, seethe manual entry for <b><a href="./m2Lib.html#top">m2Lib</a></b>. The interface table values are returned in astructure of type <b>M2_DATA</b>, which is passed as the second argument to this routine.<p></blockquote><h4>RETURNS</h4><blockquote><p><p>OK, or ERROR if the input parameter is not specified, or a match is not found.<p></blockquote><h4>ERRNO</h4><blockquote><p><p> <b>S_m2Lib_INVALID_PARAMETER</b><br> <b>S_m2Lib_ENTRY_NOT_FOUND</b><p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./m2IfLib.html#top">m2IfLib</a></b>, <b><a href="./m2Lib.html#top">m2Lib</a></b>, <b><a href="./m2IfLib.html#m2IfInit">m2IfInit</a>( )</b>, <b><a href="./m2IfLib.html#m2IfGroupInfoGet">m2IfGroupInfoGet</a>( )</b>, <b><a href="./m2IfLib.html#m2IfTblEntrySet">m2IfTblEntrySet</a>( )</b>, <b><a href="./m2IfLib.html#m2IfDelete">m2IfDelete</a>( )</b><hr><a name="m2IfDefaultValsGet"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries : Routines</i></a></p></blockquote><h1>m2IfDefaultValsGet( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>m2IfDefaultValsGet( )</strong> - get the default values for the counters</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>void m2IfDefaultValsGet ( M2_DATA * pM2Data, /* The requested entry */ M2_IFINDEX * pIfIndexEntry /* The ifindex node */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This function fills the given struct with the default values asspecified in the RFC. We will enter this routine only if the ioctlto the driver fails.<p></blockquote><h4>RETURNS</h4><blockquote><p>n/a</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./m2IfLib.html#top">m2IfLib</a></b><hr><a name="m2IfCommonValsGet"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries : Routines</i></a></p></blockquote><h1>m2IfCommonValsGet( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>m2IfCommonValsGet( )</strong> - get the common values</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>void m2IfCommonValsGet ( M2_DATA * pM2Data, /* The requested struct */ M2_IFINDEX * pIfIndexEntry /* The ifindex node */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This function updates the requested struct with all the data that isindependent of the driver ioctl. This information can be obtainedfrom the ifnet structures.<p></blockquote><h4>RETURNS</h4><blockquote><p>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?