On Tue, 2005-06-21 at 12:51, aakansha rajvi wrote:
> First if I set "test" to a string type oid , snmpget results in "test".
> Again if I set "try" to the same oid, the result of snmpget is "tryt"
> ie., the length of the variable holding this string is growing dynamically.

Not exactly.
It looks as if the buffer holding the current value isn't getting
cleared before you insert the new one.   My guess is that if you
issue a SET of "test123", then GET will return the correct value.
If you then issue a SET of "try0", then GET will return "try0123"


> Pls see the attached sample code(containing handler function and
> varaible declaration alone) I am using for one particular scalar
> string type oid.


    case MODE_SET_ACTION:
              :
        strcpy(struct_obj.rcommunity,
               (void*)(requests->requestvb->val.string));  


Try clearing the 'rcommunity' buffer before you assign the
new value.  Something like:

    case MODE_SET_ACTION:
              :
+       memset(struct_obj.rcommunity, 0, sizeof(stuct_obj.rcommunity));
        strcpy(struct_obj.rcommunity,
               (void*)(requests->requestvb->val.string));  


Dave



-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to