IDA_SetVars

 

int IDA_SetVars(idaServID_t *servID,

                idaVarRecord_t *varRecs,

   ulong *errorIndex, ulong *errorStatus);

 

Parameters

servID

[in] Pointer to SERVER_IDENTIFIERstructure returned from IDA_OpenSession.

varRecs

[in/out] Pointer to the user's array of populated VARIABLE_RECORDstructures. IDA_SetVarswill use the data in this structure to build the actual SET request to be sent to the server. The structure is also used to place results from the set operation.

errorIndex

[out] If an error occurs this parm will be populated with the index of the entry in the BulkRec structure that generated an error code.

errorStatus

[out] The error code will be placed here. You should be able to find this error code in the IDAApis.h file to help determine the problem.

 

Return Values

0 indicates a successful IDA_SetVars().

Non-zero return codes are documented in the IDAApis.h file.

Remarks

This method is called to Set mib data utilizing an InSight server agent. IDA_SetVars() may be used to set multiple mibVars in a single request.

Application users may utilize the idaVarRecord to specify each variable to Set. For each variable, user must specify where each variable's specified “Set” data resides (datap), the length of the users set data (dataLen) , and the SNMP variable type (varType). Also may specify Instance data of each variable.

Users array of IdaVarRecords may contain a maximum of 48 user Variable IDs (entries).

For each table mibVar specified in the user’s idaVarRecord structure, user must specify the instance and instance length of the mibVar that the user is requesting to set.

Note: for scaler variables an instance of “.0” is implied.

For IDA_SetVars() the user must specify the SNMP varType for that mibVar.

The last idaVarRecord entry must always be zeros. This “null” idaVarRecord is used by the internals of the Apis to determine the end of your request data.

 

Sample Code

 

char gUserName[10] = "1";

#define UNAME_LEN 1

 

char gPassword[9] = "1";

#define PW_LEN 1

 

idaVarRecord_t gLoginVars[] =

{

{ IDAN_ClientSessUserName , gUserName ,

UNAME_LEN, UNAME_LEN, NULL, 0, 0, NULL, SNMP_TYPE_DisplayString},

{ IDAN_ClientSessPassword , gPassword ,

PW_LEN, PW_LEN, NULL, 0, 0, NULL, SNMP_TYPE_DisplayString},

{ IDAV_ENDOFNONREP, 0, 0, 0, 0, 0, 0, 0, 0 },

{ 0, 0, 0, 0, 0, 0, 0, 0, 0 }

// Notes: -instance id not required for scalers (".0" is implied)

// -varType is required on SETs

};

 

 

 

gServID.in_nodename = gNodeName;

 

printf("Attempting to connect %s\n", gServID.in_nodename);

 

rc = IDA_OpenSession(&gServID); /* Establish a connect to that ctlr. */

if (rc != 0)

printf("Unable to connect. rc = %d.\n", rc);

 

if (!rc)

{

printf("Connected. Logging on.\n");

rc = IDA_SetVars(&gServID, gLoginVars, &errorIndex, &errorStatus);

if (rc != 0)

printf("Unable to login. rc = %d.\n", rc);

}

 

if (!rc)

printf("Logged in. Starting GET_NEXT loop.\n");

Converted from CHM to HTML with chm2web Pro 2.85 (unicode)