Hi all,
     I forgot to add the net-snmp version i am using net-snmp-5.1.2.
   I am having a doubt i am not returning any error from
MODE_SET_RESERVE1 after breaking from switch statement in returning
SNMP_ERR_NOERROR.
   The registration what i am using is wrong.

On Wed, 2005-06-08 at 14:21, Sasikumar Bodathula wrote:
> This is the sample code which i wrote just to trace the flow.
> Register.
> 
>     netsnmp_register_scalar(netsnmp_create_handler_registration
>                             ("getOutStandingAlarm",
>                              handle_getOutStandingAlarm,
>                              getOutStandingAlarm_oid,
>                              OID_LENGTH(getOutStandingAlarm_oid),
>                              HANDLER_CAN_RWRITE));
> 
> Code in MODE_SET_RESERVE1:
>     case MODE_SET_RESERVE1:
>         printf("inside MODE_SET_RESERVE1\n");
>         if ( requests->requestvb->type != ASN_INTEGER  ) {
>             printf( "wrong type\n");
>             netsnmp_set_request_error(reqinfo, requests,
>                                       SNMP_ERR_WRONGTYPE
> /*SNMP_ERR_WRONGVALUE or ... */
>                                       );
>             return SNMP_ERR_WRONGTYPE;
>         }
>         if ( (*(requests->requestvb->val.integer) > 1 ) ||
> (*(requests->requestvb->val.integer) < 0))
>         {
>            printf( "wrong value\n");
>            netsnmp_set_request_error(reqinfo, requests,
>                                      SNMP_ERR_WRONGVALUE
>                                      );
>           return SNMP_ERR_WRONGVALUE;
>         }
>         iTruthValue = *(requests->requestvb->val.integer);
>         printf("Incoming value is %d\n",
> *(requests->requestvb->val.integer));
>         break;
> 
> In the output printf statement in the error condition are not coming
> only success condition printf are coming i.e "inside MODE_SET_RESERVE1"
> and "Incoming value is <value>".
> 
> On Wed, 2005-06-08 at 13:51, Dave Shield wrote:
> > On Wed, 2005-06-08 at 06:28, Sasikumar Bodathula wrote:
> > > When i did set operation control is coming to MODE_SET_RESERVE1
> > > here i am checking for the type and value range
> > 
> > Yup - that sounds about right.
> > 
> > >  after this control is coming to MODE_SET_FREE
> > 
> > Which indicates that the RESERVE1 processing returned an error.
> > 
> > 
> > > In the mib i defined this test object as Truth Value this is
> > > a scalar object having read-write access. 
> > 
> > It doesn't actually matter what the MIB file says.
> > What's important is the code itself.
> > 
> > 
> > How did you register this object?
> > What code have you got in the RESERVE1 processing block?
> > 
> > 
> > Dave
> > 
> 
> 
> 
> -------------------------------------------------------
> This SF.Net email is sponsored by: NEC IT Guy Games.  How far can you shotput
> a projector? How fast can you ride your desk chair down the office luge track?
> If you want to score the big prize, get to know the little guy.  
> Play to win an NEC 61" plasma display: http://www.necitguy.com/?r=20
> _______________________________________________
> Net-snmp-users mailing list
> Net-snmp-users@lists.sourceforge.net
> Please see the following page to unsubscribe or change other options:
> https://lists.sourceforge.net/lists/listinfo/net-snmp-users



-------------------------------------------------------
This SF.Net email is sponsored by: NEC IT Guy Games.  How far can you shotput
a projector? How fast can you ride your desk chair down the office luge track?
If you want to score the big prize, get to know the little guy.  
Play to win an NEC 61" plasma display: http://www.necitguy.com/?r=20
_______________________________________________
Net-snmp-users mailing list
Net-snmp-users@lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users

Reply via email to