tfSnmpAllocAndInsert
Table of Contents >> SNMP Programmer's Reference
| #include <trapi.h> |
| int tfSnmpAllocAndInsert | ( |
| ttUserVoidPtr entryPtr, | |
| ttUser32Bit entryType, | |
| ttUser32Bit flags | |
| ); |
| You must define TM_SNMPV3_FORCE_TRECK_ALLOCATE in your trsystem.h file for this API to be available. |
Function Description
This function is a wrapper function for certain add/insert APIs for the SNMPv3 tables that dynamically allocates the required memory. This allows the user to use static memory for these structures. When calling the add/insert APIs directly, the user must ensure that the memory allocated for the entry can be free'd by the Treck stack when it is no longer needed.
Parameters
- entryPtr
- A pointer to the structure to be added. The structure corresponds to the entryType like so:
entryType Data type TM_SNMP_TABLE_COMMUNITY ttSnmpCommunityTable TM_SNMP_TABLE_NOTIFY_FILTER_PROFILE ttSnmpNotifyFilterProfileTableEntry TM_SNMP_TABLE_NOTIFY_FILTER ttSnmpNotifyFilterTableEntry TM_SNMP_TABLE_NOTIFY ttSnmpNotifyTableEntry TM_SNMP_TABLE_TARGET_ADDR ttSnmpTargetAddrTableEntry TM_SNMP_TABLE_TARGET_PARAMS ttSnmpTargetParamsTableEntry TM_SNMP_TABLE_ACCESS ttSnmpVacmAccessTable TM_SNMP_TABLE_CONTEXT ttSnmpVacmContextTable TM_SNMP_TABLE_SEC2GROUP ttSnmpVacmSec2GroupTable TM_SNMP_TABLE_USM ttSnmpUsmUserTable TM_SNMP_TABLE_VTF ttSnmpVacmViewTreeFamilyTable
- entryType
- One of the following:
- TM_SNMP_TABLE_COMMUNITY
- TM_SNMP_TABLE_NOTIFY_FILTER_PROFILE
- TM_SNMP_TABLE_NOTIFY_FILTER
- TM_SNMP_TABLE_NOTIFY
- TM_SNMP_TABLE_TARGET_ADDR
- TM_SNMP_TABLE_TARGET_PARAMS
- TM_SNMP_TABLE_ACCESS
- TM_SNMP_TABLE_CONTEXT
- TM_SNMP_TABLE_SEC2GROUP
- TM_SNMP_TABLE_USM
- TM_SNMP_TABLE_VTF
- flags
- Currently unused.
Returns
- TM_ENOERROR
- Success.
- TM_EINVAL
- The entryPtr was NULL.
- TM_ALLOCATION_ERROR
- Insufficient memory to complete the operation.
- (Other)
- Error code as returned by one of the add/insert APIs. Please refer to it for more information.