On 24 July 2012 06:45, Naama Bar Menachem
<naama.barmenac...@novelsat.com> wrote:
> I took your advice and tried a single getnext.
> No matter what index I write, it always receives 0,0,0,what-i-insert
> (the first 3 are received as 0, only the fourth is received properly).

First of all - an apology.
I've had a closer look at the library code, and build_oid_noalloc()
does encode the whole index varbind list - not just a single value.
(I must have been looking at build_oid_segment() instead!)


> Is my index read wrong? Does ipAddress saved in " idx->val.integer " ?

Strictly speaking - no.   It's saved as the first four octets of
'idx->val.string'
Those two buffers actually overlap, so this may or may not be the same.
But given that you're getting the wrong results, that would tend to indicate
that they're not!

   One possibility springs to mind - are you working with a 64-bit system?
It may be that you are settings the IP address as octets 5-8 of a 64-bit
long variable,   while the code that retrieves it is looking at octets 1-4.
That would certainly explain the response OID that's generated.

Try using 'snmp_set_var' to set the index varbind values for the three
IP addresses.   Have a look at agent/mibgroup/mibII/tcpTable.c
for an example of working with IP Address values.

Dave

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
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/listinfo/net-snmp-users

Reply via email to