[AGENT++] problem with SYNTAX BITS (correction!!)

Frank Fock fock at agentpp.com
Tue Sep 1 17:46:03 CEST 2009


Hi Jean-Philippe,

Ok, then the agent is buggy.
Instead using an SnmpInt32 you should
use OctetString. AgenPro would have generated
the correct syntax. Why did you use SnmpInt32
here?

Best regards,
Frank

Jacquemin, Jean-Philippe wrote:
> sorry,
> that was wrongly placed piece of test code.
> The correct one is :
> 
>                         SYNTAX BITS
>                             {
>                             lampOK(0),
>                             error1(1),
>                             error2(2),
>                             error3(3),
>                             error4(4)
>                             }
> 
> Best regards,
> 
> Jean-Philippe
> 
> 
>  
> 
> -----Original Message-----
> From: agentpp-bounces at agentpp.org [mailto:agentpp-bounces at agentpp.org]
> On Behalf Of Jacquemin, Jean-Philippe
> Sent: dinsdag 1 september 2009 11:23
> To: Frank Fock
> Cc: agentpp at agentpp.org
> Subject: Re: [AGENT++] problem with SYNTAX BITS
> 
> Hi Frank,
> 
> Thanks for your answer.
> However I have downloaded the latest MIB Explorer Pro that I am using
> with an evaluation licence and I have the same problem : my value is not
> seen as a bitfield but as an integer.
> 
> For example when my error value is 3, I should see : error1+error2 (bit1
> + bit2 active) but I get error3(3) !!
> 
> Here is the exact piece of MIB file:
> "
>         -- 1.3.6.1.4.1.12612.220.11.2.2.4.10
>         lampErrorStatus OBJECT-TYPE
>                         SYNTAX BITS
>                             {
>                             lampOK(0),
>                             error1(1),
>                             error2(2),
>                             error3(4),
>                             error4(8)
>                             }
>                         MAX-ACCESS      read-only
>                         STATUS  current
>                         DESCRIPTION
>                                 "This is the projector (system) status.
>                                 ........."
>                         ::= { lampProperties 10 } "
> 
> and the corresponding SnmpAgent code :
> 
> (MidDatabase constructino)
> 
>   if ((enReturnValue != CError::eNoError)
>       || (m_poidLampErrorStatus = new Oidx((Oidx(*m_poidLampProperties)
> += m_dwLampErrorStatus) += (DWORD)0)) == NULL
>       || (pInt32 = new SnmpInt32((SDWORD)0)) == NULL
>       || (pMibLeaf = new MibLeaf(*m_poidLampErrorStatus, READONLY,
> pInt32)) == NULL
>       || add(pMibLeaf) == NULL)
>   {
>     enReturnValue = CError::eMibBuildingError;
>   }
> 
> (Value feed)
> 
>         if (pMibLeaf) 
>         {
>           m_pMibDataBase->lock_mib();    
>           pMibLeaf->set_value(*pSnmpValue);
>           m_pMibDataBase->unlock_mib();    
>         }
> 
> 
> Best regards,
> Jean-Philippe
>  
> 
> -----Original Message-----
> From: Frank Fock [mailto:fock at agentpp.com]
> Sent: maandag 31 augustus 2009 17:24
> To: Jacquemin, Jean-Philippe
> Cc: agentpp at agentpp.org
> Subject: Re: [AGENT++] problem with SYNTAX BITS
> 
> Hi Jean-Philippe,
> 
> This is most likely a bug in MG-Soft's MIB Browser.
> Try MIB Explorer from http://www.agentpp.com instead. I do not think
> that you will have to change your code or design.
> 
> Best regards,
> Frank
> 
> Jacquemin, Jean-Philippe wrote:
>> Hi All,
>>
>> Has anyone experienced problems with the bitfields ?
>>
>> In my MIB file I use the syntax:
>>
>> SYNTAX BITS
>> {
>>   noError(0),
>>   error1(1),
>>   error2(2),
>>   error3(3),
>>   error4(4)
>> }
>>
>> but instead of reading it as a bitfield, the MIB-Browser I use (from
>> MG-Soft) interpretes it as an Integer. Combination of error is 
>> therefore not possbile.
>>
>> In my SnmpAgent I only use 2 classes : SnmpInt32 and OctetStr.
>>
>> Could it be that because all my numerical leaves are Integers that 
>> this bitfield is intepreted only as an integer ??
>>
>>
>> Thanks in advance,
>>
>> Jean-Philippe
>>
>>
>> DISCLAIMER:
>> Unless indicated otherwise, the information contained in this message
> is privileged and confidential, and is intended only for the use of the
> addressee(s) named above and others who have been specifically
> authorized to receive it. If you are not the intended recipient, you are
> hereby notified that any dissemination, distribution or copying of this
> message and/or attachments is strictly prohibited. The company accepts
> no liability for any damage caused by any virus transmitted by this
> email. Furthermore, the company does not warrant a proper and complete
> transmission of this information, nor does it accept liability for any
> delays. If you have received this message in error, please contact the
> sender and delete the message. Thank you.
>> _______________________________________________
>> AGENTPP mailing list
>> AGENTPP at agentpp.org
>> http://lists.agentpp.org/mailman/listinfo/agentpp
> 

-- 
AGENT++
http://www.agentpp.com
http://www.snmp4j.com
http://www.mibexplorer.com
http://www.mibdesigner.com




More information about the AGENTPP mailing list