Hi Dave

Thank you for the respond.

I am not following - which change do you think I should do, and why do
you think it is only updating the first index?

I don't think it is the reason for the issue for 2 reasons:
1. I see that the LAST index is actually updated (table-id) and all
other 3 are not updated (all of type ipAddress)
2. I have another table with multiple indices, all integers, and with
same code (which is automatically generated by mib2c) it works fine

Thank you,
Naama


-----Original Message-----
From: dave.shi...@gmail.com [mailto:dave.shi...@gmail.com] On Behalf Of
Dave Shield
Sent: Monday, July 23, 2012 7:02 PM
To: Naama Bar Menachem
Cc: net-snmp-users@lists.sourceforge.net
Subject: Re: problem with get_next when ipAddress as table index

On 23 July 2012 16:48, Naama Bar Menachem
<naama.barmenac...@novelsat.com> wrote:
> I have a table with 4 indices, 3 of them are of type ipAddress


> On the "get-next" function
>
> * I receive the indices
> * get the information from server
> * updated the table's row
> *updated the indices (idx->val.integer) with new value (next)

I've only had a very quick look, but it appears that you're updating all
four of the new index values:

>                     idx = indexes;
>                     *(idx->val.integer) = key_pointer->dest_ip;
>                     idx = idx->next_variable;
>                     *(idx->val.integer) = key_pointer->dest_subnet;
>                     idx = idx->next_variable;
>                     *(idx->val.integer) = key_pointer->next_hop_ip;
>                     idx = idx->next_variable;
>                     *(idx->val.integer) = key_pointer->table_id;


 but then building the response OID with only one of them:


>                     build_space_len = reginfo->rootoid_len;
>                     build_space[build_space_len++] = 1; /* entry */
>                     build_space[build_space_len++] = column;    /*
column */
>                     build_oid_noalloc(build_space + build_space_len,
>                                       MAX_OID_LEN - build_space_len,
&index_oid_len,
>                                       NULL, 0, indexes);

   I would have thought you need to extend the OID to include the values
of the subnet, next hop and table ID as well.

>                     snmp_set_var_objid(request->requestvb,
build_space,
>                                        build_space_len + 
> index_oid_len);


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