1.2.1.19.56 TCPIP_SNMPV3_EngineUserDataBaseSet Function

C

bool TCPIP_SNMPV3_EngineUserDataBaseSet(
    TCPIP_SNMPV3_USERDATABASECONFIG_TYPE userDataBaseType, 
    uint8_t len, 
    uint8_t userIndex, 
    void * val
);

Description

This function is used to set SNMPv3 Engine data base details using TCPIP_SNMPV3_USERDATABASECONFIG_TYPE enumeration.

Preconditions

TCPIP_SNMP_Initialize() is already called.

Parameters

ParametersDescription
userDataBaseTypeSNMPv3 data base configuration type.
lenNumber of bytes need to be read from data base.
userIndexSNMPv3 user index.
valVoid pointer to a any data type. Length parameter value is changed according to data type.

Returns

None.

Remarks

None.

Example

bool TCPIP_SNMP_VarbindSet(SNMP_ID var, SNMP_INDEX index, uint8_t ref, SNMP_VAL val)
{
switch(var)
{
    case USER_SECURITY_NAME:
        if ( ref ==  SNMP_END_OF_VAR )
        {
            if(TCPIP_SNMPV3_EngineUserDataBaseSet(SNMPV3_USERNAME_CONFIG_TYPE,strlen((char*)gSnmpv3UserSecurityName),
                                            index,gSnmpv3UserSecurityName) != true)
                return false;
        }
        // Make sure that index is within our range.
        if ( index < TCPIP_SNMPV3_USM_MAX_USER )
        {
            // Copy given value into local buffer.
            gSnmpv3UserSecurityName[ref]=val.byte;
            return true;
        }
        break;
}
}