I'm not sure if I found a solution to my problem, but anyway
netsnmp_handler_registration *handler_reg =
netsnmp_create_handler_registration(buffy,
handle_snmp,
scalar_oid,
OID_LENGTH(scalar_oid),
HANDLER_CAN_RONLY);
I tried to output each handler, and rootoid_len that comes from
OID_LENGTH(scalar_oid) was 1 for all scalars. I reckon this value should be the
length of the OID (1.3.6.1.4.1.40463.2.1 = 9).
I have my own wrapper class around an OID with the length, when I used this
length instead of OID_LENGTH(scalar_oid), it registered all my scalars with no
duplicates.
Why does this work for my 3 hard coded scalars, but not my list of scalars?
const oid scalar_oid[] = { 1,3,6,1,4,1,45678,1,1 };
OID_LENGTH(scalar_oid) gives value 9.
const oid *scalar_oid = wrapper.getOid(); //Has same oid within. Returns a
pointer to an oid.
OID_LENGTH(scalar_oid) gives value 1.
Both of these is just a pointer right? So why does OID_LENGTH work one the
first, but not the second?
My immediate problem is solved. Thanks for all assistance.
/Sverre
----- Original Message -----
Fra: "Dave Shield" <[email protected]>
Til: "Sverre Moe" <[email protected]>
Kopi: "net-snmp-users" <[email protected]>
Sendt: 29. oktober 2012 12:38:51
Emne: Re: Debugging SNMP
On 29 October 2012 10:46, Sverre Moe <[email protected]> wrote:
> I have also tried to output the handler memory address, and its not
> always unique. Don't know if it has anything to do with the problem.
Hmmm.... as far as I can tell, this structure should be unique,
but this duplication could well be a symptom of the problem,
rather than the underlying cause.
> Packaged dump output. Doesn't look like have any information about the
> scalar registration as I can see.
> dumph_send: (Un)Register Prefix
> dumpv_send: OID: iso
> dumph_send: OID Header
> dumpx_send: 01 00 00 00
> dumpv_send: # subids: 1 (0x01)
> dumpv_send: prefix: 0 (0x00)
> dumpv_send: inclusive: 0 (0x00)
> dumph_send: OID Segments
> dumpx_send: 01 00 00 00
> dumpv_send: Integer: 1 (0x01)
> dumpx_send:0C 00 00 00
> dumpv_send: Integer: 12 (0x0C)
This is the section that specifies the OID being registered.
Personally, I've always tended to use the raw packet dump
rather than this formatted version - but as far as I can tell,
this is trying to register either .1 (or possibly .1.12,
though I can't immediately see where the 12 comes from!)
What is the OID that this is intended to register?
What do the other packet dumps look like?
If they are all trying to register the OID .1, then this would
explain where the duplicate registration failures are coming from!
Have you managed to put together a dummy version of this
module that we can use to try and reproduce the problem?
Dave
CONFIDENTIALITY
This e-mail and any attachment contain KONGSBERG information which may be
proprietary, confidential or subject to export regulations, and is only meant
for the intended recipient(s). Any disclosure, copying, distribution or use is
prohibited, if not otherwise explicitly agreed with KONGSBERG. If received in
error, please delete it immediately from your system and notify the sender
properly.
------------------------------------------------------------------------------
The Windows 8 Center - In partnership with Sourceforge
Your idea - your app - 30 days.
Get started!
http://windows8center.sourceforge.net/
what-html-developers-need-to-know-about-coding-windows-8-metro-style-apps/
_______________________________________________
Net-snmp-users mailing list
[email protected]
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users