/*
 * Note: this file originally auto-generated by mib2c using
 *        : mib2c.check_values.conf,v 1.8 2004/01/12 00:43:45 rstory Exp $
 */

/*
 * standard headers
 */
#include <net-snmp/net-snmp-config.h>
#include <net-snmp/net-snmp-includes.h>
#include <net-snmp/agent/net-snmp-agent-includes.h>
#include "test_handler.h"
#include "cfgmon.h"

int check_TEST_UsageType(int type, long *val, size_t val_len, long *old_val, size_t old_val_len)
{

    int ret = SNMP_ERR_NOERROR;

    /** Check to see that we were called legally */
    if (!val)
    {
        snmp_log(LOG_ERR, "%s: NULL input", __func__);
        return SNMP_ERR_GENERR;
    }

    /** Check the incoming type for correctness */
    if (type != ASN_INTEGER)
    {
        snmp_log(LOG_ERR, "%s: wrong type %d", __func__, type);
        return SNMP_ERR_WRONGTYPE;
    }


    /** Check the enums.  Legal values will continue, others return error. */
    //This is the new value
    switch (*val)
    {
        case CFGMON_USAGE_1:
        case CFGMON_USAGE_2:
        case CFGMON_USAGE_3:
            break;

            /** not a legal enum value.  return an error */
        default:
            snmp_log(LOG_ERR, "%s: Invalid value %ld", __func__, *val);
            return SNMP_ERR_INCONSISTENTVALUE;
    }


    return ret;
}
