On 6 April 2010 18:26, maxim maxim <[email protected]> wrote:
> snmp_varlist_add_variable(¬ification_vars,
> objid_snmptrap, objid_snmptrap_len,
This parameter is the name of the varbind to be added.
It's inherently of type Object ID, so the size is the
number of subidentifiers:
> oid objid_snmptrap[] = { 1, 3, 6, 1, 6, 3, 1, 1, 4, 1, 0 };
> size_t objid_snmptrap_len =OID_LENGTH(objid_snmptrap);
which is exactly what you have.
However, the final parameter pair:
> ASN_OBJECT_ID,
> (u_char *)notification_oid, notification_oid_len);
is the value to be assigned to this varbind.
This can be of any type (integer, string, ObjectID)
so the size is the size of the whole value.
In *bytes*, not subidentifiers.
> oid notification_oid[] ={1, 3, 6, 1, 6, 3, 1, 1, 5, 3};
> size_t notification_oid_len =OID_LENGTH(notification_oid);
You are passing the number of subidentifiers (32-bit values),
but the library is taking this as the number of bytes (8-bit values).
So it's only using the first quarter of the value.
Try
size_t notification_oid_len = sizeof(notification_oid);
Dave
------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders