Platform SDK: Network Management

smiOCTETS

The WinSNMP smiOCTETS structure passes context strings to multiple WinSNMP functions. The structure also describes and receives encoded SNMP messages.

The smiOCTETS structure contains a pointer to an SNMP octet string of variable length. The structure can be a member of the smiVALUE structure.

typedef struct {
    smiUINT32   len;    // number of bytes in the octet string 
    smiLPBYTE   ptr;    // pointer to an octet string 
} smiOCTETS, *smiLPOCTETS; 

Members

len
Specifies an unsigned long integer value that indicates the number of bytes in the octet string array pointed to by the ptr member.
ptr
Pointer to a byte array that contains the octet string of interest. A NULL-terminating byte is not required.

Remarks

The Microsoft WinSNMP implementation allocates and deallocates memory for all output smiOCTETS structures. The WinSNMP application should not free memory that the implementation allocates for the ptr member of an smiOCTETS structure. Instead, the application must call the SnmpFreeDescriptor function to free the memory.

Because the WinSNMP application allocates memory for input descriptor objects with variable lengths, it must free that memory. For more information, see WinSNMP Data Management Concepts.

Requirements

  Windows NT/2000: Requires Windows 2000.
  Windows 95/98: Unsupported.
  Header: Declared in Winsnmp.h.

See Also

WinSNMP API Overview, WinSNMP Structures, SnmpStrToContext, SnmpContextToStr, SnmpEncodeMsg, SnmpDecodeMsg, SnmpFreeDescriptor, smiVALUE