Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.
Other versions of this page are also available for the following:
Windows Mobile Not Supported Windows Embedded CE Supported
8/28/2008

The SnmpMibViewstructure defines the MIB view that is passed to the SnmpTfxOpencall. You must define a locally static instance of this type in order to pass it to the SnmpTfxOpenroutine. To initialize the SnmpMibViewstructure, use the MIB_VIEWmacro as shown in the following code example.

Copy Code
SnmpMibView gViewSnmpTest = MIB_VIEW(snmpTest);

Note the convention that is used in all of the SnmpTfx macros. These macros operate by assuming a base name and having the C preprocessor prepend character tokens to generate additional variable names, which are used to reference other data that must have been defined and initialized by the extension-agent writer.

To implement the MIB_View macro
  1. Assign an OID to the root of the MIB tree.

    This OID must have the name ids_ name,where namematches the base name of the MIB_VIEWmacro parameter. For example.

    Copy Code
    static UINT snmpTest[] = {1,3,6,1,4,1,311,1,1,11};
    

    The OID of the MIB root consists of an array of unsigned integers. In this case the definition is for a MIB root at 1.3.6.1.4.1.311.1.1.11, which is in the Vendor, Microsoft portion of the MIB tree.

  2. Define an array of MIB entries.

    Define these entries according to the SnmpMibEntrystructure and base them on the base name of the parameter to the MIB_VIEWmacro, mib_ name. For example.

    Copy Code
    SnmpMibEntry snmpTest[] = { ...]
    
  3. Define an array of MIB tables.

    Define these tables according to the SnmpMibTablestructure. Base the definition on the base name of the parameter to the MIB_VIEWmacro, tbl_name. For example.

    Copy Code
    SnmpMibTable snmpTest[]
    

See Also