OverView Index Help                                                                WebNMS Agent Toolkit C Edition 6 

varbindlist.c
This file contains routines to create and add the varbinds. These routines are used while processing the received request or sending a trap or inform.
Return Type Method Summary
VarBind* AddVarBind (Vector *varBindVect, OID *varName, INT32 varNameLen, U_CHAR varType, U_CHAR *varVal, INT32 varValLen, U_CHAR freeFlag)
             It will create a entry which contains all information which are passed to this function.
VarBind* CloneVarBind(VarBind *varBindPtr)
             This function create a new varbind reference and all the info of the received varBindPtr to the newly create one.
void CopyVarBinds(Vector *destVect, Vector *srcVect, INT32 fromIndex)
             This function will copy the all the varBinds from the source Vector to dest Vector from the given index.
VarBind* CreateAVarBind(OID *varName, INT32 varNameLen, U_CHAR varType, U_CHAR *varVal, INT32 varValLen)
             It will create a Entry which contains all information which are passed to this function and put it into the VarBind structure.
CHAR CreateVarBind(Vector *vect, TreeCell *cellPtr, OID *varName, INT32 varNameLen, U_CHAR *varVal, INT32 varValLen, U_CHAR version, U_CHAR rollBackFlag, INT32 globalIndex)
             It will create a Entry which contains all information which are passed to this function and put it into the corresponding Vector.
CHAR DeleteDuplicateTreeCellVarBind(Vector *varBindListVect)
             It is used to identify the duplicate tree cell in the given Vector.
void DeleteTableEntry(Vector *tableVector, TreeCell *cell, EntryInfo *entryInfoPtr, OID *reqOid, INT32 reqOidLen, U_CHAR *status)
             It will delete the specified row from the given table Vector.
void FreeRollBackList(Vector *varBindListVect)
             It is used to free the memory which is reserved for the key "delete".
void FreeVarBindList(Vector *vect)
             It is used to free the allocated memory of each Entry of the given Vector.
CHAR GetVarBindAndSetAgain(INT32 pduVersion, Vector *holderVector, U_CHAR *errStatus, LONG *errIndex, TransportDomainInfo *tdInfo)
             This function is called if mulitvar set is failed.
VarBind* GetVarBindForMatchingOidInVector(Vector *varBindVect, OID *oid, INT32 oidLen, INT32 fromIndex)
             It will compare the oid with each oid in the Vector from the fromIndex.
U_CHAR IsDuplicateVarbind(Vector *rollBackVarBinds, OID *oid, INT32 oidLen)
             Compares each Entry's oid of the given Vector with given oid.
U_CHAR IsRollBackRequired(Vector *holderVector, INT32 *index)
             Check each Entry's rollBackFlag value.
void PrintVarBind(VarBind *varBindPtr)
             It will print the varbind information according to the varbind type.
void UnsetRollBackFlag(Vector *rollBackVarBinds, TreeCell *receivedCellPtr, OID *oid, INT32 oidLen, U_CHAR rowStatusFlag)
             Compares each Entry's oid of the given Vector with varName.
U_CHAR* UpdateTableEntry(Vector *tableVector, TreeCell *cell, ColumnAttributeInfo *columnAttrb, OID *reqOid, INT32 *reqOidLen, U_CHAR *varVal, INT32 *varValLen, U_CHAR *status)
             It will update the give column Attribute value after resolving the table Entry.
   
Method Details

AddVarBind()

VarBind* AddVarBind (Vector *varBindVect, OID *varName, INT32 varNameLen, U_CHAR varType, U_CHAR *varVal, INT32 varValLen, U_CHAR freeFlag)

It will create a entry which contains all information which are passed to this function.

Arguments:
1. Reference of the Vector (IN).
2. Requested oid (IN).
3. Requested oid length (IN).
4. The datatype of the oid (IN).
5. Variable value (IN).
6. Variable value length (IN).
7. Flag to indicate to free the variable value(IN).
Return type:
The reference of the added varbind.
Bugs:
null

CloneVarBind()

VarBind* CloneVarBind(VarBind *varBindPtr)

This function create a new varbind reference and all the info of the received varBindPtr to the newly create one.

Arguments:
1. Reference of the VarBind (IN).
Return type:
The cloned varbind reference
Bugs:
null

CopyVarBinds()

void CopyVarBinds(Vector *destVect, Vector *srcVect, INT32 fromIndex)

This function will copy the all the varBinds from the source Vector to dest Vector from the given index.

Arguments:
1. Refernece to the dest Vector(IN/OUT).
2. Reference to the src Vector(IN).
3. index(IN).
Return type:
Nothing.
Bugs:
null

CreateAVarBind()

VarBind* CreateAVarBind(OID *varName, INT32 varNameLen, U_CHAR varType, U_CHAR *varVal, INT32 varValLen)

It will create a Entry which contains all information which are passed to this function and put it into the VarBind structure.

Arguments:
1. Requested oid (IN).
2. Requested oid length (IN).
3. The datatype of the oid (IN).
4. Variable value (IN).
5. Variable value length (IN).
Return type:
VarBind reference.
Bugs:
null

CreateVarBind()

CHAR CreateVarBind(Vector *vect, TreeCell *cellPtr, OID *varName, INT32 varNameLen, U_CHAR *varVal, INT32 varValLen, U_CHAR version, U_CHAR rollBackFlag, INT32 globalIndex)

It will create a Entry which contains all information which are passed to this function and put it into the corresponding Vector. It is used for rollback. If roll back fails then each element in the Vector is retrived and set method is called.

Arguments:
1. Reference of the Vector (IN).
2. Tree Cell reference (IN).
3. Requested oid (IN).
4. Requested oid length (IN).
5. Original value of the oid before set (IN).
6. Original value length (IN).
7. The version of the SNMP message (IN).
8. The status of the rollback flag (IN).
9. global index(IN).
Return type:
SUCCESS or FAILURE.
Bugs:
null

DeleteDuplicateTreeCellVarBind()

CHAR DeleteDuplicateTreeCellVarBind(Vector *varBindListVect)

It is used to identify the duplicate tree cell in the given Vector.

Arguments:
1. Reference of the Vector (OUT).
Return type:
SUCCESS or FAILURE..
Bugs:
null

DeleteTableEntry()

void DeleteTableEntry(Vector *tableVector, TreeCell *cell, EntryInfo *entryInfoPtr, OID *reqOid, INT32 reqOidLen, U_CHAR *status)

It will delete the specified row from the given table Vector.it is used for atomic set in multi protocol agent.

Arguments:
1. Reference of the Vector (IN/OUT).
2. Tree cell reference (IN).
3. Entry Info reference (IN).
4. Received oid (IN).
5. Received oid length (IN).
6. Status variable reference (IN/OUT).
Return type:
Nothing.
Bugs:
null

FreeRollBackList()

void FreeRollBackList(Vector *varBindListVect)

It is used to free the memory which is reserved for the key "delete".

Arguments:
1. Reference of the Vector (IN).
Return type:
Nothing.
Bugs:
null

FreeVarBindList()

void FreeVarBindList(Vector *vect)

It is used to free the allocated memory of each Entry of the given Vector. Depending upon the flag in the VarBind structure the the value of the VarBind structure will be freed.

Arguments:
1. Reference of the Vector (IN).
Return type:
Nothing.
Bugs:
null

GetVarBindAndSetAgain()

CHAR GetVarBindAndSetAgain(INT32 pduVersion, Vector *holderVector, U_CHAR *errStatus, LONG *errIndex, TransportDomainInfo *tdInfo)

This function is called if mulitvar set is failed. Retrieve each Entry from the given Vector and will do the set with original(previous) value.

Arguments:
1. Snmp Pdu Version.
2. Reference of the Vector (IN).
3. Pointer to error status (OUT).
4. Pointer to error index (OUT).
5. Reference to transport domain(IN).
Return type:
Status of the operation.
Bugs:
null

GetVarBindForMatchingOidInVector()

VarBind* GetVarBindForMatchingOidInVector(Vector *varBindVect, OID *oid, INT32 oidLen, INT32 fromIndex)

It will compare the oid with each oid in the Vector from the fromIndex. If any matching is found then it will return the corresponding varBindPtr.

Arguments:
1. Reference to the varbind(IN).
2. oid(IN).
3. oidLen(IN).
4. Index(IN).
Return type:
Reference to the VarBind.
Bugs:
null

IsDuplicateVarbind()

U_CHAR IsDuplicateVarbind(Vector *rollBackVarBinds, OID *oid, INT32 oidLen)

Compares each Entry's oid of the given Vector with given oid. If both are matches then return YES. Otherwise NO.

Arguments:
1. Reference of the Vector (IN).
2. oid value (oid of the tree cell) (IN).
3. oid length (oid length of the treecell) (IN).
Return type:
On founding duplicate Entry return YES, otherwise NO.
Bugs:
null

IsRollBackRequired()

U_CHAR IsRollBackRequired(Vector *holderVector, INT32 *index)

Check each Entry's rollBackFlag value. If it is TRUE then return YES as well the index number of the Vector.

Arguments:
1.Reference of the Vector (IN).
2.Index number of the Vector where roll back is failed
(OUT)
Return type:
YES, if any Entry of the Vector contains rollBackFlag value as TRUE. Otherwise NO.
Bugs:
null

PrintVarBind()

void PrintVarBind(VarBind *varBindPtr)

It will print the varbind information according to the varbind type.

Arguments:
1. Reference to the VarBind (IN).
Return type:
Nothing.
Bugs:
null

UnsetRollBackFlag()

void UnsetRollBackFlag(Vector *rollBackVarBinds, TreeCell *receivedCellPtr, OID *oid, INT32 oidLen, U_CHAR rowStatusFlag)

Compares each Entry's oid of the given Vector with varName. If both are matches then set FALSE for the rollBackFlag of the corresponding Entry.

Arguments:
1. Reference of the Vector (IN).
2. CellPtr for the received varbind (IN).
3. VarName (oid of the received varbind) (IN).
4. VarNameLen (oid length of the received varbind) (IN).
5. Column is rowStatus or not (IN).
Return type:
Nothing.
Bugs:
null

UpdateTableEntry()

U_CHAR* UpdateTableEntry(Vector *tableVector, TreeCell *cell, ColumnAttributeInfo *columnAttrb, OID *reqOid, INT32 *reqOidLen, U_CHAR *varVal, INT32 *varValLen, U_CHAR *status)

It will update the give column Attribute value after resolving the table Entry. It is used for atomic set in mutli protocol agent.

Arguments:
1. Reference of the Vector (IN/OUT).
2. Tree cell reference (IN).
3. Table column Attribute info (IN).
4. Received oid (IN).
5. Received oid length (IN).
6. VarBind value (IN).
7. VarBind value length (IN).
8. Status variable reference (IN/OUT).
Return type:
Attribute pointer or NULL.
Bugs:
null


OverView Index Help                                                                WebNMS Agent Toolkit C Edition 6 

Copyright (c) 2009 ZOHO Corp. All Rights Reserved.