OverView Index Help                                                                WebNMS Agent Toolkit C Edition 6 

vacmcontexttablehdlr.c
This file contains handlers for the snmpVacmContextTable defined in the RFC 3415.

See Also :
Return Type Method Summary
CHAR CreateAndAddNewSnmpVacmContextTableEntry(U_CHAR *snmpVacmContextName, INT32 snmpVacmContextNameLen)
             It will take all columns value as input and create an instance then add it to the vector.
CHAR CreateAndAddSnmpVacmContextTableEntry(OID *instance, INT32 instanceLen, U_CHAR *snmpVacmContextName, INT32 snmpVacmContextNameLen)
             It will take all columns value and its instance value as input and add create an entry then add it to the vector.
void* CreateSnmpVacmContextTableRowWithDefaultValues(U_CHAR **indexList, INT32 *indexListLen, INT32 len)
             It will create a new row and assign default value for each table column.
void FreeSnmpVacmContextTableEntryMemory(Entry *entryPtr)
             It will free the reserved memeory for an entry.
Vector* GetSnmpVacmContextTableInfo(INT32 startIdx, INT32 numOfRows, INT32 *flag)
             It will return the table vector reference, before that it will verify the total size of the table and set flag value.
void InitSnmpVacmContextTable()
             It will register the TreeCell with agent and initialize all data structures related to the modulesnmpVacmContextTable.
CHAR IsAccessAllowed(U_CHAR *contextName, INT32 contextNameLen, U_CHAR *secName, INT32 secNameLen, LONG secModel, U_CHAR secLevel, U_CHAR viewType, OID *oid, INT32 oidLen, U_CHAR *tempView, INT32 *tempViewLen)
             This function will check for the access according to RFC 3415 with given Context Name, Security Model, Security Level, view Type and OID.
CHAR IsValidContext(U_CHAR *contextName, INT32 contextNameLen)
             Check for the Entry which matches the given context name.
CHAR ReadFromSnmpVacmContextTableFile()
             It will read the table enteries from the file and add it to the vector.
U_CHAR* ReadSnmpVacmContextName(void *tableEntryPtr, INT32 *varValLen, U_CHAR *status)
             Get method for (table) column snmpVacmContextName.
U_CHAR* SnmpVacmContextTableProcessReadReq(U_CHAR pduType, OID *reqOid, INT32 *reqOidLen, INT32 *varValLen, U_CHAR *status)
             It will process the GET & GET-NEXT requests and send back the appropriate result.
U_CHAR* SnmpVacmContextTableProcessWriteReq(INT32 pduVersion, OID *reqOid, INT32 reqOidLen, U_CHAR *varVal, INT32 *varValLen, U_CHAR *status)
             It will process the SET requests and send back the modified result.
CHAR UpdateSnmpVacmContextTable(U_CHAR command)
             Update the changes of SnmpVacmContextTable.
CHAR WriteToSnmpVacmContextTableFile()
             It will write the table enteries from the vector into the file.
   
Method Details

CreateAndAddNewSnmpVacmContextTableEntry()

CHAR CreateAndAddNewSnmpVacmContextTableEntry(U_CHAR *snmpVacmContextName, INT32 snmpVacmContextNameLen)

It will take all columns value as input and create an instance then add it to the vector.

Arguments:
1. Table column snmpVacmContextName (IN).
Return type:
SUCCESS or FAILURE.
Bugs:
null
See Also:

CreateAndAddSnmpVacmContextTableEntry()

CHAR CreateAndAddSnmpVacmContextTableEntry(OID *instance, INT32 instanceLen, U_CHAR *snmpVacmContextName, INT32 snmpVacmContextNameLen)

It will take all columns value and its instance value as input and add create an entry then add it to the vector.

Arguments:
1. Instance Oid (IN).
2. Instance Oid Length (IN).
3. Table column snmpVacmContextName (IN).
Return type:
SUCCESS or FAILURE.
Bugs:
null
See Also:

CreateSnmpVacmContextTableRowWithDefaultValues()

void* CreateSnmpVacmContextTableRowWithDefaultValues(U_CHAR **indexList, INT32 *indexListLen, INT32 len)

It will create a new row and assign default value for each table column. For index column it will assign the value from input argument (index).

Arguments:
1. List of index values (IN).
2. Length of each index value (IN).
3. Length of the index list (IN).
Return type:
Created aaplicationTable row pointer.
Bugs:
null
See Also:

FreeSnmpVacmContextTableEntryMemory()

void FreeSnmpVacmContextTableEntryMemory(Entry *entryPtr)

It will free the reserved memeory for an entry.

Arguments:
1. Reference of the table entry (IN).
Return type:
Nothing.
Bugs:
null
See Also:

GetSnmpVacmContextTableInfo()

Vector* GetSnmpVacmContextTableInfo(INT32 startIdx, INT32 numOfRows, INT32 *flag)

It will return the table vector reference, before that it will verify the total size of the table and set flag value.

Arguments:
1. Starting Row index (IN).
2. Number of rows (IN).
3. Flag about remaining number of rows (OUT).
Return type:
Nothing.
Bugs:
null
See Also:

InitSnmpVacmContextTable()

void InitSnmpVacmContextTable(void)

It will register the TreeCell with agent and initialize all data structures related to the modulesnmpVacmContextTable.

Arguments:
Nothing.
Return type:
Nothing.
Bugs:
null
See Also:
CreateAndAddNewSnmpVacmContextTableEntry()

IsAccessAllowed()

CHAR IsAccessAllowed(U_CHAR *contextName, INT32 contextNameLen, U_CHAR *secName, INT32 secNameLen, LONG secModel, U_CHAR secLevel, U_CHAR viewType, OID *oid, INT32 oidLen, U_CHAR *tempView, INT32 *tempViewLen)

This function will check for the access according to RFC 3415 with given Context Name, Security Model, Security Level, view Type and OID. These are the informations retrieved from the received V3 Message when a request is received from the manager. It will check the access in four steps. 1. Check for the existence of the given Context Name. 2. Check for the group name with Security name and Security Model. 3. Check for the access with Group name, Context Name, Security Model, Security Level. 4. Check for the view with view name and OID.

Arguments:
1. Context Name (IN).
2. Context Name Length (IN).
3. Security Name (IN).
4. Security Name Length (IN).
5. Security Model (IN).
6. Security Level (IN).
7. View Type (GET/GET-NEXT/SET/GET-BULK) (IN).
8. Oid (IN).
9. Oid Length (IN).
10. tempView (IN / OUT).
Return type:
YES if access to the given OID is allowed otherwise SNMP_ERR_GENERR or SNMP_ERR_AUTHORIZATIONERRO, will be returned based on the internal error type.
Bugs:
null

IsValidContext()

CHAR IsValidContext(U_CHAR *contextName, INT32 contextNameLen)

Check for the Entry which matches the given context name.

Arguments:
1. Context Name (IN).
2. Context Name Length (IN).
Return type:
YES if context name is available in the table Otherwise NO will be returned.
Bugs:
null

ReadFromSnmpVacmContextTableFile()

CHAR ReadFromSnmpVacmContextTableFile()

It will read the table enteries from the file and add it to the vector.

Arguments:
Nothing.
Return type:
SUCCESS or FAILURE.
Bugs:
null
See Also:
WriteToSnmpVacmContextTableFile()

ReadSnmpVacmContextName()

U_CHAR* ReadSnmpVacmContextName(void *tableEntryPtr, INT32 *varValLen, U_CHAR *status)

Get method for (table) column snmpVacmContextName. A human readable name identifying a particular context at a particular SNMP entity. The empty contextName (zero length) represents the default context.

Arguments:
1. Pointer of the entry (IN).
2. Pointer of the variable value length (IN/OUT).
3. Status which is used to return SNMP Error (IN/OUT).
Return type:
Pointer of the return variable value.
Bugs:
null
See Also:

SnmpVacmContextTableProcessReadReq()

U_CHAR* SnmpVacmContextTableProcessReadReq(U_CHAR pduType, OID *reqOid, INT32 *reqOidLen, INT32 *varValLen, U_CHAR *status)

It will process the GET & GET-NEXT requests and send back the appropriate result.

Arguments:
1. PduType (GET/GET-NEXT) (IN).
2. Requested Oid (IN).
3. Requested Oid Length (IN).
4. Variable value length (IN).
5. It is used to return snmp error or exception(IN/OUT).
Return type:
Pointer to the return variable value.
Bugs:
null
See Also:
SnmpVacmContextTableProcessWriteReq()

SnmpVacmContextTableProcessWriteReq()

U_CHAR* SnmpVacmContextTableProcessWriteReq(INT32 pduVersion, OID *reqOid, INT32 reqOidLen, U_CHAR *varVal, INT32 *varValLen, U_CHAR *status)

It will process the SET requests and send back the modified result.

Arguments:
1. Snmp PduVersion.
2. Requested Oid (IN).
3. Requested Oid Length (IN).
4. Variable value (IN).
5. Variable value length (IN).
6. It is used for atomic set implementation and
to return snmp error or exception(IN/OUT).
Return type:
Pointer to the return variable value.
Bugs:
null
See Also:
SnmpVacmContextTableProcessReadReq()

UpdateSnmpVacmContextTable()

CHAR UpdateSnmpVacmContextTable(U_CHAR command)

Update the changes of SnmpVacmContextTable.

Arguments:
command type.
Return type:
SUCCESS or FAILURE.
Bugs:
null
See Also:

WriteToSnmpVacmContextTableFile()

CHAR WriteToSnmpVacmContextTableFile()

It will write the table enteries from the vector into the file.

Arguments:
Nothing.
Return type:
SUCCESS or FAILURE.
Bugs:
null
See Also:
ReadFromSnmpVacmContextTableFile()


OverView Index Help                                                                WebNMS Agent Toolkit C Edition 6 

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