Re: Help regarding snmpset operation

This is a discussion on Re: Help regarding snmpset operation within the SNMP Users forums, part of the Networking and Network Related category; This is the sample code which i wrote just to trace the flow. Register. netsnmp_register_scalar(netsnmp_create_handler_reg istration ("getOutStandingAlarm", ...


Go Back   Usenet Forums > Networking and Network Related > SNMP Users

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 06-08-2005
Sasikumar Bodathula
 
Posts: n/a
Default Re: Help regarding snmpset operation

This is the sample code which i wrote just to trace the flow.
Register.

netsnmp_register_scalar(netsnmp_create_handler_reg istration
("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/...net-snmp-users
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 08:08 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0