seligor / agentuino

Automatically exported from code.google.com/p/agentuino
0 stars 0 forks source link

Read Write Community Cant read #22

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
Use the SNMP GET command whith the Read Write Community Name

What is the expected output? What do you see instead?
Agentduino should return with an SNMP GET RESPONSE

My work around for now in the requestPdu class:

    } else if ( (pdu->type == SNMP_PDU_GET || pdu->type == SNMP_PDU_GET_NEXT) && comLen == _getSize ) {
        Serial << "SNMPGET Test Comm Name" << endl;
        bool RWAuth = true;
        bool RoAuth = true;
        for ( i = 0; i < _getSize; i++ ) {
            if( _packet[verEnd + 3 + i] != (byte)_getCommName[i] ) {
                RoAuth = false;
            }
            if( _packet[verEnd + 3 + i] != (byte)_setCommName[i] ) {
                RWAuth = false;
            }
        }
        if (RoAuth == false && RWAuth == false)
        {
            // set pdu error
            pdu->error = SNMP_ERR_NO_SUCH_NAME;
            return SNMP_API_STAT_NO_SUCH_NAME;
        }

Original issue reported on code.google.com by jims.par...@gmail.com on 22 Feb 2015 at 9:50