MibBrowser Class
Properties Methods Events Config Settings Errors
The MIBBrowser class is used to parse SNMP MIB Module definitions.
Syntax
MibBrowser
Remarks
The MIBBrowser class allows easy loading and querying of definitions in the SNMP Management Information Base (MIB) specifications.
The LoadMib method allows loading of MIB modules, which get stored in an internal tree structure for further queries.
If modules reference (import) other modules, recursive loading of modules is performed automatically and/or controlled by the ImportSymbols event.
The MIB tree is navigated through the SelectNode method, which enables pointing to a node in the tree specified by NodeOid and NodeLabel. Other node information is provided through the NodeModuleName, NodeFileName, NodeSyntax, NodeType, and NodeAccess properties.
The node selector parameter in SelectNode can be a label such as "internet", an OID such as "1.3.6.4", a combination of the two: "iso.3.dod.internet", or a label in a particular module such as "RFC1213-MIB!interfaces".
Node children and successors are provided by the ListChildren and ListSuccessors methods. The individual node information is provided via the MibNode event.
Module traps are listed via the ListTraps method. The individual trap information is provided through the TrapNode event.
Property List
The following is the full list of the properties of the class with short descriptions. Click on the links for further details.
ExactMatch | Controls the way the OID matching is done (complete or partial). |
NodeAccess | The access permissions for the selected node. |
NodeDescription | Textual description of the selected node. |
NodeFileName | The absolute path of the file where the selected node is declared. |
NodeFullLabel | The full label of the selected node. |
NodeIndex | The index of the node in a table. |
NodeLabel | The label of the selected node. |
NodeModuleName | The name of the module where the selected node is declared. |
NodeOid | The Object ID of the selected node. |
NodeSubId | The SubId of the currently selected node. |
NodeSyntax | The syntax of the selected node. |
NodeSyntaxString | The node syntax of the selected node in text format. |
NodeType | The type of the selected node. |
NodeTypeString | The node type of the selected node in text format. |
Method List
The following is the full list of the methods of the class with short descriptions. Click on the links for further details.
Config | Sets or retrieves a configuration setting. |
ListChildren | Lists the immediate children of the selected node. |
ListSuccessors | Lists all successors of the selected node. |
ListTraps | Lists all the traps defined in the loaded modules. |
LoadMib | Parses the file FileName and adds the parsed nodes to the collection of existing nodes. |
Reset | Reset all properties of the class. |
SelectNode | Used to select individual nodes in the loaded MIB module(s). |
Event List
The following is the full list of the events fired by the class with short descriptions. Click on the links for further details.
Error | Errors that occur while loading/parsing MIB modules are fired through this event. |
ImportSymbols | List of imported symbols and the respective modules where they are declared. |
MibNode | This event fires once for every child or successor of the currently selected node when invoking ListChildren or ListSuccessors . |
TrapNode | Lists module trap information. |
Config Settings
The following is a list of config settings for the class with short descriptions. Click on the links for further details.
AutoLoadMibs | Determines whether imported MIB modules are loaded automatically. |
CacheDescriptions | Controls caching of Node descriptions. |
CacheMibs | Controls MIB module caching. |
CheckNoKnownRoots | Controls whether or not the class fails when a file with no known root is loaded. |
DisplayHint | The DISPLAY-HINT property for the current node. |
MibExtensions | Controls the file extensions that the class will search for. |
NodeIsColumnar | Whether the current node is columnar. |
NodeIsScalar | Whether the current node is scalar. |
ReleaseTempNodes | Will release any temporary nodes stored by the class. |
ReturnEnumValues | Comma-separated list of the current node's enumeration textual-conventions. |
UndefinedSymbols | Comma-separated list of nodes that have not been resolved. |
BuildInfo | Information about the product's build. |
CodePage | The system code page used for Unicode to Multibyte translations. |
LicenseInfo | Information about the current license. |
MaskSensitiveData | Whether sensitive data is masked in log messages. |
ProcessIdleEvents | Whether the class uses its internal event loop to process events when the main thread is idle. |
SelectWaitMillis | The length of time in milliseconds the class will wait when DoEvents is called if there are no events to process. |
UseInternalSecurityAPI | Whether or not to use the system security libraries or an internal implementation. |
ExactMatch Property (MibBrowser Class)
Controls the way the OID matching is done (complete or partial).
Syntax
ANSI (Cross Platform) int GetExactMatch();
int SetExactMatch(int bExactMatch); Unicode (Windows) BOOL GetExactMatch();
INT SetExactMatch(BOOL bExactMatch);
int ipworkssnmp_mibbrowser_getexactmatch(void* lpObj);
int ipworkssnmp_mibbrowser_setexactmatch(void* lpObj, int bExactMatch);
bool GetExactMatch();
int SetExactMatch(bool bExactMatch);
Default Value
TRUE
Remarks
If ExactMatch is set to True, the SelectNode method will try to find an exact match for the supplied selector. If not found, an exception will be thrown.
If ExactMatch is set to False, the SelectNode method will start from the root (iso) and will go as far as it can, finding the closest match for the requested node.
For instance, in SNMPv2-MIB sysUpTime is defined as "1.3.6.1.2.1.1.3". If ExactMatch is False, calling SelectNode with selector "1.3.6.1.2.1.1.3.0" will populate NodeLabel with "sysUpTime.0" while the same call with ExactMatch set to True will fail since that exact OID is not defined in the MIB.
Data Type
Boolean
NodeAccess Property (MibBrowser Class)
The access permissions for the selected node.
Syntax
ANSI (Cross Platform) int GetNodeAccess(); Unicode (Windows) INT GetNodeAccess();
Possible Values
ACC_UNKNOWN(0),
ACC_NO_ACCESS(1),
ACC_READ_ONLY(2),
ACC_READ_CREATE(3),
ACC_READ_WRITE(4),
ACC_WRITE_ONLY(5),
ACC_FOR_NOTIFY(6)
int ipworkssnmp_mibbrowser_getnodeaccess(void* lpObj);
int GetNodeAccess();
Default Value
0
Remarks
The following is the list of values for NodeAccess:
0 | accUnknown |
1 | accNoAccess |
2 | accReadOnly |
3 | accReadCreate |
4 | accReadWrite |
5 | accWriteOnly |
6 | accForNotify |
This property is read-only.
Data Type
Integer
NodeDescription Property (MibBrowser Class)
Textual description of the selected node.
Syntax
ANSI (Cross Platform) char* GetNodeDescription(); Unicode (Windows) LPWSTR GetNodeDescription();
char* ipworkssnmp_mibbrowser_getnodedescription(void* lpObj);
QString GetNodeDescription();
Default Value
""
Remarks
Because loading descriptions can consume unwanted resources, the class can control caching of descriptions in order to keep the memory footprint of the class as small as possible.
To disable caching, set the CacheDescriptions config setting to True. In this case, the class will only save the offset of the description in the MIB file in memory, and will fetch the textual description directly from the file only when required. When using caching, make sure that the path of the loaded modules does not change or the property will be unable to fetch the correct text description.
This property is read-only.
Data Type
String
NodeFileName Property (MibBrowser Class)
The absolute path of the file where the selected node is declared.
Syntax
ANSI (Cross Platform) char* GetNodeFileName(); Unicode (Windows) LPWSTR GetNodeFileName();
char* ipworkssnmp_mibbrowser_getnodefilename(void* lpObj);
QString GetNodeFileName();
Default Value
""
Remarks
It is possible for a node to be re-declared in other modules. In this case the property contains a comma separated list of file names where the selected node is declared.
This property is read-only.
Data Type
String
NodeFullLabel Property (MibBrowser Class)
The full label of the selected node.
Syntax
ANSI (Cross Platform) char* GetNodeFullLabel(); Unicode (Windows) LPWSTR GetNodeFullLabel();
char* ipworkssnmp_mibbrowser_getnodefulllabel(void* lpObj);
QString GetNodeFullLabel();
Default Value
""
Remarks
This contains the full label of the Oid of the selected node. It is unique within the MIB module where it is declared.
This property is read-only.
Data Type
String
NodeIndex Property (MibBrowser Class)
The index of the node in a table.
Syntax
ANSI (Cross Platform) char* GetNodeIndex(); Unicode (Windows) LPWSTR GetNodeIndex();
char* ipworkssnmp_mibbrowser_getnodeindex(void* lpObj);
QString GetNodeIndex();
Default Value
""
Remarks
If the selected node has stxSequence syntax then the NodeIndex represents the column used to distinguish among different table rows.
Example:
MibParser.LoadMib(""SNMPv2-MIB"")
MibParser.SelectNode("1.3.6.1.2.1.2.2")
Debug.Print MibParser1.NodeLabel // prints "ifTable"
MibParser.SelectNode("1.3.6.1.2.1.2.2.1")
Debug.Print MibParser1.NodeLabel // prints "ifEntry"
Debug.Print MibParser1.NodeIndex // prints "ifIndex"
This property is read-only.
Data Type
String
NodeLabel Property (MibBrowser Class)
The label of the selected node.
Syntax
ANSI (Cross Platform) char* GetNodeLabel(); Unicode (Windows) LPWSTR GetNodeLabel();
char* ipworkssnmp_mibbrowser_getnodelabel(void* lpObj);
QString GetNodeLabel();
Default Value
"iso"
Remarks
This label is unique within the MIB module where it is declared.
This property is read-only.
Data Type
String
NodeModuleName Property (MibBrowser Class)
The name of the module where the selected node is declared.
Syntax
ANSI (Cross Platform) char* GetNodeModuleName(); Unicode (Windows) LPWSTR GetNodeModuleName();
char* ipworkssnmp_mibbrowser_getnodemodulename(void* lpObj);
QString GetNodeModuleName();
Default Value
""
Remarks
It is possible for a node to be redeclared in other modules. In this case the NodeModuleName contains a comma separated list of module names where the selected node is declared.
This property is read-only.
Data Type
String
NodeOid Property (MibBrowser Class)
The Object ID of the selected node.
Syntax
ANSI (Cross Platform) char* GetNodeOid(); Unicode (Windows) LPWSTR GetNodeOid();
char* ipworkssnmp_mibbrowser_getnodeoid(void* lpObj);
QString GetNodeOid();
Default Value
"1"
Remarks
Contains the Object Id (OID) of the currently selected node. The OID uniquely identifies the selected node within the entire object hierarchy.
This property is read-only.
Data Type
String
NodeSubId Property (MibBrowser Class)
The SubId of the currently selected node.
Syntax
ANSI (Cross Platform) int GetNodeSubId(); Unicode (Windows) INT GetNodeSubId();
int ipworkssnmp_mibbrowser_getnodesubid(void* lpObj);
int GetNodeSubId();
Default Value
1
Remarks
For instance, if you select the node "dod" in "rfc1155.smi", the NodeSubId value will be 6.
This property is read-only.
Data Type
Integer
NodeSyntax Property (MibBrowser Class)
The syntax of the selected node.
Syntax
ANSI (Cross Platform) int GetNodeSyntax(); Unicode (Windows) INT GetNodeSyntax();
Possible Values
STX_BOOLEAN(1),
STX_INTEGER(2),
STX_BIT_STRING(3),
STX_OCTET_STRING(4),
STX_NULL(5),
STX_OBJECT_ID(6),
STX_ENUMERATED(10),
STX_SEQUENCE_OF(15),
STX_SEQUENCE(16),
STX_SET(17),
STX_CHOICE(18),
STX_NETWORK_ADDRESS(21),
STX_IP_ADDRESS(64),
STX_COUNTER(65),
STX_GAUGE(66),
STX_TIME_TICKS(67),
STX_OPAQUE(68),
STX_NSAP(69),
STX_COUNTER_64(70),
STX_UINTEGER(71),
STX_UNKNOWN(59)
int ipworkssnmp_mibbrowser_getnodesyntax(void* lpObj);
int GetNodeSyntax();
Default Value
6
Remarks
The syntax defines what type of data the selected node contains. Common data types include:
Boolean (1) | Boolean variable. |
Integer (2) | A 32-bit signed integer. |
OctetString (4) | An octet string variable that is binary or textual data. |
Null (5) | NULL value. |
ObjectId (6) | Object identifier. |
IpAddress (64) | A 32-bit Internet address (aaa.bbb.ccc.ddd) |
Counter (65) | A counter that increases until it reaches a maximum value of (2^32). |
Gauge (66) | A non-negative int that can increase or decrease, but never exceed a maximum value. |
TimeTicks (67) | A counter that measures time in hundredths of a second. |
Opaque (68) | This type supports the capability to pass ASN.1 syntax. |
Counter64 (70) | A counter that increases until it reaches a maximum value of (2^64). |
UInteger (71) | A 32-bit unsigned integer. |
Additional type definitions can be found in the SNMP RFC's.
This property is read-only.
Data Type
Integer
NodeSyntaxString Property (MibBrowser Class)
The node syntax of the selected node in text format.
Syntax
ANSI (Cross Platform) char* GetNodeSyntaxString(); Unicode (Windows) LPWSTR GetNodeSyntaxString();
char* ipworkssnmp_mibbrowser_getnodesyntaxstring(void* lpObj);
QString GetNodeSyntaxString();
Default Value
""
Remarks
For instance, for the node "system" in "SNMPv2-MIB", NodeSyntax returns 6 (stxObjectId), while NodeSyntaxString returns "OBJECT IDENTIFIER".
This property is read-only.
Data Type
String
NodeType Property (MibBrowser Class)
The type of the selected node.
Syntax
ANSI (Cross Platform) int GetNodeType(); Unicode (Windows) INT GetNodeType();
Possible Values
MCR_OBJECT_TYPE(0),
MCR_OBJECT_IDENTITY(1),
MCR_MODULE_IDENTITY(2),
MCR_NOTIFICATION_TYPE(3),
MCR_TRAP_TYPE(4),
MCR_OBJECT_GROUP(5),
MCR_NOTIFICATION_GROUP(6),
MCR_COMPLIANCE(7),
MCR_CAPABILITIES(8)
int ipworkssnmp_mibbrowser_getnodetype(void* lpObj);
int GetNodeType();
Default Value
1
Remarks
The following are the possible values for NodeType:
0 | mcrObjectType |
1 | mcrObjectIdentity |
2 | mcrModuleIdentity |
3 | mcrNotificationType |
4 | mcrTrapType |
5 | mcrObjectGroup |
6 | mcrNotificationGroup |
7 | mcrCompliance |
8 | mcrCapabilities |
This property is read-only.
Data Type
Integer
NodeTypeString Property (MibBrowser Class)
The node type of the selected node in text format.
Syntax
ANSI (Cross Platform) char* GetNodeTypeString(); Unicode (Windows) LPWSTR GetNodeTypeString();
char* ipworkssnmp_mibbrowser_getnodetypestring(void* lpObj);
QString GetNodeTypeString();
Default Value
"OBJECT IDENTITY"
Remarks
For instance, for the node "system" in "SNMPv2-MIB", NodeType returns 2 (mcrObjectIdentity), while NodeTypeString returns "OBJECT-IDENTITY".
This property is read-only.
Data Type
String
Config Method (MibBrowser Class)
Sets or retrieves a configuration setting.
Syntax
ANSI (Cross Platform) char* Config(const char* lpszConfigurationString); Unicode (Windows) LPWSTR Config(LPCWSTR lpszConfigurationString);
char* ipworkssnmp_mibbrowser_config(void* lpObj, const char* lpszConfigurationString);
QString Config(const QString& qsConfigurationString);
Remarks
Config is a generic method available in every class. It is used to set and retrieve configuration settings for the class.
These settings are similar in functionality to properties, but they are rarely used. In order to avoid "polluting" the property namespace of the class, access to these internal properties is provided through the Config method.
To set a configuration setting named PROPERTY, you must call Config("PROPERTY=VALUE"), where VALUE is the value of the setting expressed as a string. For boolean values, use the strings "True", "False", "0", "1", "Yes", or "No" (case does not matter).
To read (query) the value of a configuration setting, you must call Config("PROPERTY"). The value will be returned as a string.
Error Handling (C++)
This method returns a String value; after it returns, call the GetLastErrorCode() method to obtain its result code; 0 indicates success, while a non-zero error code indicates that this method encountered an error during its execution. If an error occurs, the GetLastError() method can be called to retrieve the associated error message.
ListChildren Method (MibBrowser Class)
Lists the immediate children of the selected node.
Syntax
ANSI (Cross Platform) int ListChildren(); Unicode (Windows) INT ListChildren();
int ipworkssnmp_mibbrowser_listchildren(void* lpObj);
int ListChildren();
Remarks
The MibNode event fires once for every SubId of the selected node and provides all info related to that SubId.
For instance, the following code:
MibParser.LoadMib("RFC1155-SMI")
MibParser.SelectNode("internet")
MibParser.ListChildren()
will generate the following output through the MibNode event:
directory 1.3.6.1.1 mgmt 1.3.6.1.2 experimental 1.3.6.1.3 private 1.3.6.1.4
Error Handling (C++)
This method returns a result code; 0 indicates success, while a non-zero error code indicates that this method encountered an error during its execution. If an error occurs, the GetLastError() method can be called to retrieve the associated error message. (Note: This method's result code can also be obtained by calling the GetLastErrorCode() method after it returns.)
ListSuccessors Method (MibBrowser Class)
Lists all successors of the selected node.
Syntax
ANSI (Cross Platform) int ListSuccessors(); Unicode (Windows) INT ListSuccessors();
int ipworkssnmp_mibbrowser_listsuccessors(void* lpObj);
int ListSuccessors();
Remarks
The MibNode event fires once for each successor of the selected node and provides all information related to it.
Error Handling (C++)
This method returns a result code; 0 indicates success, while a non-zero error code indicates that this method encountered an error during its execution. If an error occurs, the GetLastError() method can be called to retrieve the associated error message. (Note: This method's result code can also be obtained by calling the GetLastErrorCode() method after it returns.)
ListTraps Method (MibBrowser Class)
Lists all the traps defined in the loaded modules.
Syntax
ANSI (Cross Platform) int ListTraps(); Unicode (Windows) INT ListTraps();
int ipworkssnmp_mibbrowser_listtraps(void* lpObj);
int ListTraps();
Remarks
The TrapNode event fires once for every trap and provides all info related to it.
For instance, the following code:
MibParser.LoadMib("mib_ii.mib")
MibParser.ListTraps()
will generate the following output through the TrapNode event:
coldStart 0 snmp
warmStart 1 snmp
linkDown 2 snmp
linkUp 3 snmp
authenticationFailure 4 snmp
Error Handling (C++)
This method returns a result code; 0 indicates success, while a non-zero error code indicates that this method encountered an error during its execution. If an error occurs, the GetLastError() method can be called to retrieve the associated error message. (Note: This method's result code can also be obtained by calling the GetLastErrorCode() method after it returns.)
LoadMib Method (MibBrowser Class)
Parses the file FileName and adds the parsed nodes to the collection of existing nodes.
Syntax
ANSI (Cross Platform) int LoadMib(const char* lpszFileName); Unicode (Windows) INT LoadMib(LPCWSTR lpszFileName);
int ipworkssnmp_mibbrowser_loadmib(void* lpObj, const char* lpszFileName);
int LoadMib(const QString& qsFileName);
Remarks
This method can be used to load and parse a MIB file into the class.
Some MIB modules contain references to other modules within their imports sections. When loading a MIB that contains external imports, the ImportSymbols event will fire for each external reference. These modules must be loaded if possible to generate a complete representation for the loaded MIB.
It is possible for the component to attempt to load all external references automatically. To do this, use Config and set "AutoLoadMibs=True". Setting this configuration property causes the class to attempt to find and load any external references included in the current MIB. The class will only find external modules if they reside in the same directory as the current module. Alternatively, the class can load additional modules by calling LoadMib while inside the ImportSymbols event.
If the AutoLoadMibs config setting is set to False, and no explicit action is taken to load necessary modules inside the ImportSymbols event, some symbols may remain unresolved. These symbols will not appear in the MibNode hierarchy until the module containing their definition is loaded. Order is unimportant when loading additional MIB modules. A complete list of unresolved symbols can be found by retrieving the UndefinedSymbols config setting (comma separated list of symbols).
Note that FileName also accepts MIB data. If MIB data is used, the class will expect the NodeFileName to be at the beginning of the string, surrounded by "[]". For example:
[RFC-1215]RFC-1215 DEFINITIONS ::= BEGIN......END
Error Handling (C++)
This method returns a result code; 0 indicates success, while a non-zero error code indicates that this method encountered an error during its execution. If an error occurs, the GetLastError() method can be called to retrieve the associated error message. (Note: This method's result code can also be obtained by calling the GetLastErrorCode() method after it returns.)
Reset Method (MibBrowser Class)
Reset all properties of the class.
Syntax
ANSI (Cross Platform) int Reset(); Unicode (Windows) INT Reset();
int ipworkssnmp_mibbrowser_reset(void* lpObj);
int Reset();
Remarks
This method resets all of the node properties as well as the internal collection of parsed nodes.
Error Handling (C++)
This method returns a result code; 0 indicates success, while a non-zero error code indicates that this method encountered an error during its execution. If an error occurs, the GetLastError() method can be called to retrieve the associated error message. (Note: This method's result code can also be obtained by calling the GetLastErrorCode() method after it returns.)
SelectNode Method (MibBrowser Class)
Used to select individual nodes in the loaded MIB module(s).
Syntax
ANSI (Cross Platform) int SelectNode(const char* lpszSelector); Unicode (Windows) INT SelectNode(LPCWSTR lpszSelector);
int ipworkssnmp_mibbrowser_selectnode(void* lpObj, const char* lpszSelector);
int SelectNode(const QString& qsSelector);
Remarks
SelectNode is used for selecting individual nodes and should be called before querying node information.
The Selector parameter can be a label such as "internet", an OID such as "1.3.6.4", a combination of the two: "iso.3.dod.internet", or a label in a particular module such as "RFC1213-MIB!interfaces".
Either '.' or ':' can be used to separate SubIds. If a SubId starts with "0x" or follows the ":" separator then its hexadecimal value is used. For instance, "0x1.0x3.0x6.0x1A" is the same as "1:3:6:1A".
All properties and methods of the class will operate on the selected node. For example, calling ListSuccessors will only list the successors of the selected node.
Error Handling (C++)
This method returns a result code; 0 indicates success, while a non-zero error code indicates that this method encountered an error during its execution. If an error occurs, the GetLastError() method can be called to retrieve the associated error message. (Note: This method's result code can also be obtained by calling the GetLastErrorCode() method after it returns.)
Error Event (MibBrowser Class)
Errors that occur while loading/parsing MIB modules are fired through this event.
Syntax
ANSI (Cross Platform) virtual int FireError(MibBrowserErrorEventParams *e);
typedef struct {
int ErrorCode;
const char *Description; int reserved; } MibBrowserErrorEventParams;
Unicode (Windows) virtual INT FireError(MibBrowserErrorEventParams *e);
typedef struct {
INT ErrorCode;
LPCWSTR Description; INT reserved; } MibBrowserErrorEventParams;
#define EID_MIBBROWSER_ERROR 1 virtual INT IPWORKSSNMP_CALL FireError(INT &iErrorCode, LPSTR &lpszDescription);
class MibBrowserErrorEventParams { public: int ErrorCode(); const QString &Description(); int EventRetVal(); void SetEventRetVal(int iRetVal); };
// To handle, connect one or more slots to this signal. void Error(MibBrowserErrorEventParams *e);
// Or, subclass MibBrowser and override this emitter function. virtual int FireError(MibBrowserErrorEventParams *e) {...}
Remarks
ErrorCode contains an error code and Description contains a textual description of the error. For a list of valid error codes and their descriptions, please refer to the Error Codes section.
ImportSymbols Event (MibBrowser Class)
List of imported symbols and the respective modules where they are declared.
Syntax
ANSI (Cross Platform) virtual int FireImportSymbols(MibBrowserImportSymbolsEventParams *e);
typedef struct {
const char *Symbols;
const char *ModuleName; int reserved; } MibBrowserImportSymbolsEventParams;
Unicode (Windows) virtual INT FireImportSymbols(MibBrowserImportSymbolsEventParams *e);
typedef struct {
LPCWSTR Symbols;
LPCWSTR ModuleName; INT reserved; } MibBrowserImportSymbolsEventParams;
#define EID_MIBBROWSER_IMPORTSYMBOLS 2 virtual INT IPWORKSSNMP_CALL FireImportSymbols(LPSTR &lpszSymbols, LPSTR &lpszModuleName);
class MibBrowserImportSymbolsEventParams { public: const QString &Symbols(); const QString &ModuleName(); int EventRetVal(); void SetEventRetVal(int iRetVal); };
// To handle, connect one or more slots to this signal. void ImportSymbols(MibBrowserImportSymbolsEventParams *e);
// Or, subclass MibBrowser and override this emitter function. virtual int FireImportSymbols(MibBrowserImportSymbolsEventParams *e) {...}
Remarks
The Symbols parameter is a comma separated list of all symbols that must be imported from ModuleName.
The module is loaded through the LoadMib method.
MibNode Event (MibBrowser Class)
This event fires once for every child or successor of the currently selected node when invoking ListChildren or ListSuccessors .
Syntax
ANSI (Cross Platform) virtual int FireMibNode(MibBrowserMibNodeEventParams *e);
typedef struct {
const char *NodeLabel;
const char *NodeOid;
int NodeType;
const char *NodeTypeString;
int NodeSyntax;
const char *NodeSyntaxString;
int NodeAccess;
const char *NodeIndex;
const char *NodeParentName;
const char *NodeDescription;
const char *NodeModuleName;
const char *NodeFileName; int reserved; } MibBrowserMibNodeEventParams;
Unicode (Windows) virtual INT FireMibNode(MibBrowserMibNodeEventParams *e);
typedef struct {
LPCWSTR NodeLabel;
LPCWSTR NodeOid;
INT NodeType;
LPCWSTR NodeTypeString;
INT NodeSyntax;
LPCWSTR NodeSyntaxString;
INT NodeAccess;
LPCWSTR NodeIndex;
LPCWSTR NodeParentName;
LPCWSTR NodeDescription;
LPCWSTR NodeModuleName;
LPCWSTR NodeFileName; INT reserved; } MibBrowserMibNodeEventParams;
#define EID_MIBBROWSER_MIBNODE 3 virtual INT IPWORKSSNMP_CALL FireMibNode(LPSTR &lpszNodeLabel, LPSTR &lpszNodeOid, INT &iNodeType, LPSTR &lpszNodeTypeString, INT &iNodeSyntax, LPSTR &lpszNodeSyntaxString, INT &iNodeAccess, LPSTR &lpszNodeIndex, LPSTR &lpszNodeParentName, LPSTR &lpszNodeDescription, LPSTR &lpszNodeModuleName, LPSTR &lpszNodeFileName);
class MibBrowserMibNodeEventParams { public: const QString &NodeLabel(); const QString &NodeOid(); int NodeType(); const QString &NodeTypeString(); int NodeSyntax(); const QString &NodeSyntaxString(); int NodeAccess(); const QString &NodeIndex(); const QString &NodeParentName(); const QString &NodeDescription(); const QString &NodeModuleName(); const QString &NodeFileName(); int EventRetVal(); void SetEventRetVal(int iRetVal); };
// To handle, connect one or more slots to this signal. void MibNode(MibBrowserMibNodeEventParams *e);
// Or, subclass MibBrowser and override this emitter function. virtual int FireMibNode(MibBrowserMibNodeEventParams *e) {...}
Remarks
When calling either ListChildren or ListSuccessors, the MibNode event will fire once for every child of the currently selected node. The ListChildren method will cause the event will fire once for each of the immediate children of the current node. ListSuccessors cause this event to fire for each of the immediate children of the current node, as well as the entire tree of successors of those children.
NodeLabel is the name or textual representation of the current node, and is unique to its siblings. The NodeOid is the OID of the listed node and uniquely identifies the node within the entire MIB. The remaining parameters offer additional information about the listed node.
Information about the listed node is only available through the MibNode event parameters. All class properties remain related to the currently selected node.
If a MibNode is declared in more than one file or module, then the NodeFileName and NodeModuleName parameters will contain a comma separated list of files/modules where the node is declared.
For instance, the following code:
MibParser.LoadMib("RFC1155-SMI")
MibParser.SelectNode("internet") // OID 1.3.6.1
MibParser.ListSuccessors()
will generate the following output through the event:
directory 1.3.6.1.1 mgmt 1.3.6.1.2 experimental 1.3.6.1.3 private 1.3.6.1.4 enterprises 1.3.6.1.4.1
TrapNode Event (MibBrowser Class)
Lists module trap information.
Syntax
ANSI (Cross Platform) virtual int FireTrapNode(MibBrowserTrapNodeEventParams *e);
typedef struct {
const char *TrapName;
int SpecificTrap;
const char *TrapEnterprise;
const char *TrapVariables;
const char *TrapDescription;
const char *TrapReferences;
const char *TrapModuleName;
const char *TrapFileName; int reserved; } MibBrowserTrapNodeEventParams;
Unicode (Windows) virtual INT FireTrapNode(MibBrowserTrapNodeEventParams *e);
typedef struct {
LPCWSTR TrapName;
INT SpecificTrap;
LPCWSTR TrapEnterprise;
LPCWSTR TrapVariables;
LPCWSTR TrapDescription;
LPCWSTR TrapReferences;
LPCWSTR TrapModuleName;
LPCWSTR TrapFileName; INT reserved; } MibBrowserTrapNodeEventParams;
#define EID_MIBBROWSER_TRAPNODE 4 virtual INT IPWORKSSNMP_CALL FireTrapNode(LPSTR &lpszTrapName, INT &iSpecificTrap, LPSTR &lpszTrapEnterprise, LPSTR &lpszTrapVariables, LPSTR &lpszTrapDescription, LPSTR &lpszTrapReferences, LPSTR &lpszTrapModuleName, LPSTR &lpszTrapFileName);
class MibBrowserTrapNodeEventParams { public: const QString &TrapName(); int SpecificTrap(); const QString &TrapEnterprise(); const QString &TrapVariables(); const QString &TrapDescription(); const QString &TrapReferences(); const QString &TrapModuleName(); const QString &TrapFileName(); int EventRetVal(); void SetEventRetVal(int iRetVal); };
// To handle, connect one or more slots to this signal. void TrapNode(MibBrowserTrapNodeEventParams *e);
// Or, subclass MibBrowser and override this emitter function. virtual int FireTrapNode(MibBrowserTrapNodeEventParams *e) {...}
Remarks
When calling ListTraps, the TrapNode event fires once for every trap found in the module.
The following are the descriptions of the event parameters:
TrapName | The name of the trap (its label). |
TrapSpecificTrap | The specific id of this trap. |
TrapEnterprise | The defining entity. |
TrapVariables | A comma separated list of the symbols that should be present inside the trap. |
TrapDescription | A textual memo about the node. |
TrapModuleName | The module that contains the trap definition. |
TrapFileName | The filename of the MIB where the trap is defined. |
If a trap has been defined in more than one module or file, then ModuleName and FileName will contain a comma separated list of values.
Config Settings (MibBrowser Class)
The class accepts one or more of the following configuration settings. Configuration settings are similar in functionality to properties, but they are rarely used. In order to avoid "polluting" the property namespace of the class, access to these internal properties is provided through the Config method.MibBrowser Config Settings
When False, the class will only save the offset of the description in the MIB file in memory, and will fetch the textual description directly from the file only when required.
When using caching, make sure that the path of the loaded modules does not change or the property will be unable to fetch the correct text description.
Note that this config is read only.
"label1(Value), label2(Value), label3(Value)..."
Base Config Settings
The following is a list of valid code page identifiers:
Identifier | Name |
037 | IBM EBCDIC - U.S./Canada |
437 | OEM - United States |
500 | IBM EBCDIC - International |
708 | Arabic - ASMO 708 |
709 | Arabic - ASMO 449+, BCON V4 |
710 | Arabic - Transparent Arabic |
720 | Arabic - Transparent ASMO |
737 | OEM - Greek (formerly 437G) |
775 | OEM - Baltic |
850 | OEM - Multilingual Latin I |
852 | OEM - Latin II |
855 | OEM - Cyrillic (primarily Russian) |
857 | OEM - Turkish |
858 | OEM - Multilingual Latin I + Euro symbol |
860 | OEM - Portuguese |
861 | OEM - Icelandic |
862 | OEM - Hebrew |
863 | OEM - Canadian-French |
864 | OEM - Arabic |
865 | OEM - Nordic |
866 | OEM - Russian |
869 | OEM - Modern Greek |
870 | IBM EBCDIC - Multilingual/ROECE (Latin-2) |
874 | ANSI/OEM - Thai (same as 28605, ISO 8859-15) |
875 | IBM EBCDIC - Modern Greek |
932 | ANSI/OEM - Japanese, Shift-JIS |
936 | ANSI/OEM - Simplified Chinese (PRC, Singapore) |
949 | ANSI/OEM - Korean (Unified Hangul Code) |
950 | ANSI/OEM - Traditional Chinese (Taiwan; Hong Kong SAR, PRC) |
1026 | IBM EBCDIC - Turkish (Latin-5) |
1047 | IBM EBCDIC - Latin 1/Open System |
1140 | IBM EBCDIC - U.S./Canada (037 + Euro symbol) |
1141 | IBM EBCDIC - Germany (20273 + Euro symbol) |
1142 | IBM EBCDIC - Denmark/Norway (20277 + Euro symbol) |
1143 | IBM EBCDIC - Finland/Sweden (20278 + Euro symbol) |
1144 | IBM EBCDIC - Italy (20280 + Euro symbol) |
1145 | IBM EBCDIC - Latin America/Spain (20284 + Euro symbol) |
1146 | IBM EBCDIC - United Kingdom (20285 + Euro symbol) |
1147 | IBM EBCDIC - France (20297 + Euro symbol) |
1148 | IBM EBCDIC - International (500 + Euro symbol) |
1149 | IBM EBCDIC - Icelandic (20871 + Euro symbol) |
1200 | Unicode UCS-2 Little-Endian (BMP of ISO 10646) |
1201 | Unicode UCS-2 Big-Endian |
1250 | ANSI - Central European |
1251 | ANSI - Cyrillic |
1252 | ANSI - Latin I |
1253 | ANSI - Greek |
1254 | ANSI - Turkish |
1255 | ANSI - Hebrew |
1256 | ANSI - Arabic |
1257 | ANSI - Baltic |
1258 | ANSI/OEM - Vietnamese |
1361 | Korean (Johab) |
10000 | MAC - Roman |
10001 | MAC - Japanese |
10002 | MAC - Traditional Chinese (Big5) |
10003 | MAC - Korean |
10004 | MAC - Arabic |
10005 | MAC - Hebrew |
10006 | MAC - Greek I |
10007 | MAC - Cyrillic |
10008 | MAC - Simplified Chinese (GB 2312) |
10010 | MAC - Romania |
10017 | MAC - Ukraine |
10021 | MAC - Thai |
10029 | MAC - Latin II |
10079 | MAC - Icelandic |
10081 | MAC - Turkish |
10082 | MAC - Croatia |
12000 | Unicode UCS-4 Little-Endian |
12001 | Unicode UCS-4 Big-Endian |
20000 | CNS - Taiwan |
20001 | TCA - Taiwan |
20002 | Eten - Taiwan |
20003 | IBM5550 - Taiwan |
20004 | TeleText - Taiwan |
20005 | Wang - Taiwan |
20105 | IA5 IRV International Alphabet No. 5 (7-bit) |
20106 | IA5 German (7-bit) |
20107 | IA5 Swedish (7-bit) |
20108 | IA5 Norwegian (7-bit) |
20127 | US-ASCII (7-bit) |
20261 | T.61 |
20269 | ISO 6937 Non-Spacing Accent |
20273 | IBM EBCDIC - Germany |
20277 | IBM EBCDIC - Denmark/Norway |
20278 | IBM EBCDIC - Finland/Sweden |
20280 | IBM EBCDIC - Italy |
20284 | IBM EBCDIC - Latin America/Spain |
20285 | IBM EBCDIC - United Kingdom |
20290 | IBM EBCDIC - Japanese Katakana Extended |
20297 | IBM EBCDIC - France |
20420 | IBM EBCDIC - Arabic |
20423 | IBM EBCDIC - Greek |
20424 | IBM EBCDIC - Hebrew |
20833 | IBM EBCDIC - Korean Extended |
20838 | IBM EBCDIC - Thai |
20866 | Russian - KOI8-R |
20871 | IBM EBCDIC - Icelandic |
20880 | IBM EBCDIC - Cyrillic (Russian) |
20905 | IBM EBCDIC - Turkish |
20924 | IBM EBCDIC - Latin-1/Open System (1047 + Euro symbol) |
20932 | JIS X 0208-1990 & 0121-1990 |
20936 | Simplified Chinese (GB2312) |
21025 | IBM EBCDIC - Cyrillic (Serbian, Bulgarian) |
21027 | Extended Alpha Lowercase |
21866 | Ukrainian (KOI8-U) |
28591 | ISO 8859-1 Latin I |
28592 | ISO 8859-2 Central Europe |
28593 | ISO 8859-3 Latin 3 |
28594 | ISO 8859-4 Baltic |
28595 | ISO 8859-5 Cyrillic |
28596 | ISO 8859-6 Arabic |
28597 | ISO 8859-7 Greek |
28598 | ISO 8859-8 Hebrew |
28599 | ISO 8859-9 Latin 5 |
28605 | ISO 8859-15 Latin 9 |
29001 | Europa 3 |
38598 | ISO 8859-8 Hebrew |
50220 | ISO 2022 Japanese with no halfwidth Katakana |
50221 | ISO 2022 Japanese with halfwidth Katakana |
50222 | ISO 2022 Japanese JIS X 0201-1989 |
50225 | ISO 2022 Korean |
50227 | ISO 2022 Simplified Chinese |
50229 | ISO 2022 Traditional Chinese |
50930 | Japanese (Katakana) Extended |
50931 | US/Canada and Japanese |
50933 | Korean Extended and Korean |
50935 | Simplified Chinese Extended and Simplified Chinese |
50936 | Simplified Chinese |
50937 | US/Canada and Traditional Chinese |
50939 | Japanese (Latin) Extended and Japanese |
51932 | EUC - Japanese |
51936 | EUC - Simplified Chinese |
51949 | EUC - Korean |
51950 | EUC - Traditional Chinese |
52936 | HZ-GB2312 Simplified Chinese |
54936 | Windows XP: GB18030 Simplified Chinese (4 Byte) |
57002 | ISCII Devanagari |
57003 | ISCII Bengali |
57004 | ISCII Tamil |
57005 | ISCII Telugu |
57006 | ISCII Assamese |
57007 | ISCII Oriya |
57008 | ISCII Kannada |
57009 | ISCII Malayalam |
57010 | ISCII Gujarati |
57011 | ISCII Punjabi |
65000 | Unicode UTF-7 |
65001 | Unicode UTF-8 |
Identifier | Name |
1 | ASCII |
2 | NEXTSTEP |
3 | JapaneseEUC |
4 | UTF8 |
5 | ISOLatin1 |
6 | Symbol |
7 | NonLossyASCII |
8 | ShiftJIS |
9 | ISOLatin2 |
10 | Unicode |
11 | WindowsCP1251 |
12 | WindowsCP1252 |
13 | WindowsCP1253 |
14 | WindowsCP1254 |
15 | WindowsCP1250 |
21 | ISO2022JP |
30 | MacOSRoman |
10 | UTF16String |
0x90000100 | UTF16BigEndian |
0x94000100 | UTF16LittleEndian |
0x8c000100 | UTF32String |
0x98000100 | UTF32BigEndian |
0x9c000100 | UTF32LittleEndian |
65536 | Proprietary |
- Product: The product the license is for.
- Product Key: The key the license was generated from.
- License Source: Where the license was found (e.g., RuntimeLicense, License File).
- License Type: The type of license installed (e.g., Royalty Free, Single Server).
- Last Valid Build: The last valid build number for which the license will work.
This setting only works on these classes: AS3Receiver, AS3Sender, Atom, Client(3DS), FTP, FTPServer, IMAP, OFTPClient, SSHClient, SCP, Server(3DS), Sexec, SFTP, SFTPServer, SSHServer, TCPClient, TCPServer.
Setting this configuration setting to true tells the class to use the internal implementation instead of using the system security libraries.
On Windows, this setting is set to false by default. On Linux/macOS, this setting is set to true by default.
To use the system security libraries for Linux, OpenSSL support must be enabled. For more information on how to enable OpenSSL, please refer to the OpenSSL Notes section.
Trappable Errors (MibBrowser Class)
Error Handling (C++)
Call the GetLastErrorCode() method to obtain the last called method's result code; 0 indicates success, while a non-zero error code indicates that this method encountered an error during its execution. Known error codes are listed below. If an error occurs, the GetLastError() method can be called to retrieve the associated error message.
MibBrowser Errors
1000 | Missing token. |
1001 | Unexpected token. |
1002 | Unexpected end of file. |
1003 | MIB error. |
1004 | Nested MIBs are not supported. |
1005 | Missing import. |