The Read-only oid I had mentioned in my previous post is not in the
source code that I attached the first.
Actually it is an oid having read-only access in the MIB. Since this
is a read-only, I am having MODE_GET alone in my compiled C file.
I dont know how it is looking for SET_RESERVE1 or SET_ACTION for this
read-only oid?
Once again I am attaching the previous logs
2005-06-23 11:52:21 unknown mode (0) in handle_IPMaskCurrent
2005-06-23 11:52:21 unknown mode (4) in handle_IPMaskCurrent
And I tried to replace RONLY to RWRITE in the handler definition for
this read-only oid.But again I am getting the same problem.
Thanks
On 6/23/05, Dave Shield <[EMAIL PROTECTED]> wrote:
> On Thu, 2005-06-23 at 07:38, aakansha rajvi wrote:
> > I replaced strcpy by strncpy and it is working for me.
>
>
> > But the problem is, I have allocated memory for "rcommunity" by
> > using array
> >
> > char rcommunity[10];
> >
> > Since this is the case, if I SET private1233, the size of which is
> > greater than 10 or even if it is equal to 10, then some junk values
> > are appended at the end.
>
> Then you need to check the length of the incoming value, to
> see whether it will fit. Something like:
>
> if (requests->requestvb->val_len >= 10 ) {
> netsnmp_set_request_error(reqinfo, requests,
> SNMP_ERR_WRONGVALUE);
> return SNMP_ERR_NOERROR;
> }
>
>
>
> > Actually I am having a scalar oid, the permission of which is
> > READ-ONLY in the MIB.
> > I executed mib2c to compile that MIB and since this oid is READ-ONLY,
> > case MODE_GET alone is created for this particular oid in its handler
> > function.
>
> Checking your original code file, you actually registered the object
> as RWRITE:
>
> netsnmp_register_table_data_set(
> netsnmp_create_handler_registration(
> "pethPsePortTable", pethPsePortTable_handler,
> pethPsePortTable_oid, DIM(pethPsePortTable_oid),
> HANDLER_CAN_RWRITE),
> ^^^^^^^^^^^^^^^^^^ table_set, NULL);
>
>
> That means that your handler is expected to cope with the various
> SET modes.
>
> Try changing this to 'HANDLER_CAN_RONLY'
>
>
> 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_idt77&alloc_id492&op=click
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders