smiVALUE structure (winsnmp.h)
[SNMP is available for use in the operating systems specified in the Requirements section. It may be altered or unavailable in subsequent versions. Instead, use Windows Remote Management, which is the Microsoft implementation of WS-Man.]
The WinSNMP smiVALUE structure describes the value associated with a variable name in a variable binding entry.
The syntax member of the smiVALUE structure contains a WinSNMP data type that indicates the type of data in the value member. The value member of the structure is the union of all possible WinSNMP data types.
Syntax
typedef struct {
smiUINT32 syntax;
union {
smiINT sNumber;
smiUINT32 uNumber;
smiCNTR64 hNumber;
smiOCTETS string;
smiOID oid;
smiBYTE empty;
} value;
} smiVALUE, *smiLPVALUE;
Members
syntax
Type: smiUINT32
Specifies an unsigned long integer that indicates the syntax data type of the value member. This member can be only one of the types listed in the following table. For more information, see WinSNMP Data Types and RFC 1902, "Structure of Management Information for Version 2 of the Simple Network Management Protocol (SNMPv2)."
The last three syntax types describe exception conditions under the SNMP version 2C (SNMPv2C) framework.
value
Specifies the union of all possible WinSNMP syntax data types, including the smiOID or smiOCTETS descriptor types.
sNumber
Type: smiINT Specifies a signed long integer value.
uNumber
Type: smiUINT32 Specifies a 32-bit unsigned long integer value.
hNumber
Type: smiCNTR64 Specifies a 64-bit unsigned integer value
string
Type: smiOCTETS Specifies a string.
oid
Type: smiOID Specifies an object identifier (OID).
empty
Type: smiBYTE Specifies an empty member.
value.sNumber
value.uNumber
value.hNumber
value.string
value.oid
value.empty
Remarks
A WinSNMP application must check the syntax member of an smiVALUE structure to correctly dereference the value member. The value member can contain a simple scalar value or a non-scalar value like an smiOCTETS or an smiOID descriptor structure.
If the syntax member indicates that the value member is an smiOCTETS or an smiOID descriptor structure, the WinSNMP application must determine whether to free the resources allocated for the structure. The Microsoft WinSNMP implementation allocates and deallocates memory for all output smiOCTETS and smiOID structures. The application must call the SnmpFreeDescriptor function to free the memory for the ptr member of these structures.
Because the WinSNMP application allocates memory for input descriptors with variable lengths, it must free that memory. For more information, see WinSNMP Data Management Concepts.
Requirements
Requirement | Value |
---|---|
Minimum supported client | Windows 2000 Professional [desktop apps only] |
Minimum supported server | Windows 2000 Server [desktop apps only] |
Header | winsnmp.h |