Value Representation - Compaq TCP/IP Services for OpenVMS Programming And Reference Manual

Tcp/ip services for openvms
Table of Contents

Advertisement

Load the response OID back into the method routine's VARBIND structure.
Set the method->varbind field with the OID of the actual MIB variable
instance you are returning. This is usually accomplished by loading an
array of integers with the instance OID you wish to return and calling the
instance2OID
Load the response data back into the method routine's VARBIND structure.
Use one of the support routines with the corresponding data type to load the
method->varbind field with the data to return:
o_integer
o_string
o_octet
o_oid
These routines make a copy of the data you specify. The
manages any memory associated with copied data. The method routine must
manage the original data's memory.
The routine does any necessary conversions to the type defined in the
object table for the MIB variable and copies the converted data into the
method->varbind field. See Section 5.2.3 for information on data value
representation.
Return the correct status value, as follows:
ESNMP_MTHD_noError
ESNMP_MTHD_noSuchInstance
ESNMP_MTHD_noSuchObject
ESNMP_MTHD_ genErr

5.2.3 Value Representation

The values in a VARBIND structure for each data type are represented as follows.
(Refer to the ESNMP.H file for a definition of the OCT and OID structures.)
ESNMP_TYPE_Integer32 (varbind->value.sl field)
This is a 32-bit signed integer. Use the
value into the VARBIND structure. Note that the prototype for the value
argument is unsigned long; therefore, you may need to cast this to a signed
integer.
ESNMP_TYPE_DisplayString, ESNMP_TYPE_Opaque
ESNMP_TYPE_OctetString (varbind->value.oct field)
This is an octet string. It is contained in the VARBIND structure as an OCT
structure that contains a length and a pointer to a dynamically allocated
character array.
support routine.
eSNMP API Routines
*_set Routine
libesnmp
The routine completed successfully or
no errors were found.
There is no such instance of the
requested object.
No such object exists.
An error occurred and the routine did
not complete successfully.
o_integer
routine to insert an integer
eSNMP API Routines 5–27
function

Advertisement

Table of Contents
loading

Table of Contents