AzureMXChip/MXCHIPAZ3166/core/lib/netxduo/samples/demo_netxduo_snmp.c
UINT    mib2_get_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *object_requested, NX_SNMP_OBJECT_DATA *object_data)
{

UINT    i;
UINT    status;

    NX_PARAMETER_NOT_USED(agent_ptr);


    /* Loop through the sample MIB to see if we have information for the supplied variable.  */
    i =  0;
    status =  NX_SNMP_ERROR;
    while (mib2_mib[i].object_name)
    {

        /* See if we have found the matching entry.  */
        status =  nx_snmp_object_compare(object_requested, mib2_mib[i].object_name);

        /* Was it found?  */
        if (status == NX_SUCCESS)
        {

            /* Yes it was found.  */
            break;
        }

        /* Move to the next index.  */
        i++;
    }

    /* Determine if a not found condition is present.  */
    if (status != NX_SUCCESS)
    {


        /* The object was not found - return an error.  */
        return(NX_SNMP_ERROR_NOSUCHNAME);
    }

    /* Determine if the entry has a get function.  */
    if (mib2_mib[i].object_get_callback)
    {

        /* Yes, call the get function.  */
        status =  (mib2_mib[i].object_get_callback)(mib2_mib[i].object_value_ptr, object_data);
    }
    else
    {


        /* No get function, return no access.  */
        status =  NX_SNMP_ERROR_NOACCESS;
    }


    
    /* Return the status.  */
    return(status);
}
/* Define the application's GET processing routine.  */
Define the application's GET processing routine.
Define the application ' s GET processing routine .
UINT    mib2_get_processing(NX_SNMP_AGENT *agent_ptr, UCHAR *object_requested, NX_SNMP_OBJECT_DATA *object_data)
{
UINT    i;
UINT    status;
    NX_PARAMETER_NOT_USED(agent_ptr);
    i =  0;
    status =  NX_SNMP_ERROR;
    while (mib2_mib[i].object_name)
    {
        status =  nx_snmp_object_compare(object_requested, mib2_mib[i].object_name);
        if (status == NX_SUCCESS)
        {
            break;
        }
        i++;
    }
    if (status != NX_SUCCESS)
    {
        return(NX_SNMP_ERROR_NOSUCHNAME);
    }
    if (mib2_mib[i].object_get_callback)
    {
        status =  (mib2_mib[i].object_get_callback)(mib2_mib[i].object_value_ptr, object_data);
    }
    else
    {
        status =  NX_SNMP_ERROR_NOACCESS;
    }
    return(status);
}
UINT mib2_get_processing ( NX_SNMP_AGENT * agent_ptr , UCHAR * object_requested , NX_SNMP_OBJECT_DATA * object_data ) { UINT i ; UINT status ; NX_PARAMETER_NOT_USED ( agent_ptr ) ; i = 0 ; status = NX_SNMP_ERROR ; while ( mib2_mib [ i ] . object_name ) { status = nx_snmp_object_compare ( object_requested , mib2_mib [ i ] . object_name ) ; if ( status == NX_SUCCESS ) { break ; } i ++ ; } if ( status != NX_SUCCESS ) { return ( NX_SNMP_ERROR_NOSUCHNAME ) ; } if ( mib2_mib [ i ] . object_get_callback ) { status = ( mib2_mib [ i ] . object_get_callback ) ( mib2_mib [ i ] . object_value_ptr , object_data ) ; } else { status = NX_SNMP_ERROR_NOACCESS ; } return ( status ) ; }
Define the application's GET processing routine.
Define the application ' s GET processing routine .
/* Loop through the sample MIB to see if we have information for the supplied variable.  */ /* See if we have found the matching entry.  */ /* Was it found?  */ /* Yes it was found.  */ /* Move to the next index.  */ /* Determine if a not found condition is present.  */ /* The object was not found - return an error.  */ /* Determine if the entry has a get function.  */ /* Yes, call the get function.  */ /* No get function, return no access.  */ /* Return the status.  */