Dave,
Thanks.
Now that this should help me out on the double index issue..
1) If the table is like this and the none mentioned for second index(so
assuming non- implied...)
Index1 Index2 c1 RS
----------------------------------
AB BEA 1
AB DC 2
BC QF 30
DE FC 15
DE AD 10
Then walk should be like
c1.ABDC
c1.ABBEA
c1.BCQF
c1.DEAD
c1.DEFC
And if second index is IMPLIED then the walk is :
c1.ABBEA
c1.ABDC
c1.BCQF
c1.DEAD
c1.DEFC
Am I right?
2)You mentioned 'iterator' helper. Is this generic library helper or any
specific one?
Can you provide some examples pl.?
3)If the example from my previous post is altered to
> index c1 rowstatus
> ----------------------
> ab 1
> ag 1 <<< this is new addition
> hi 2
> cd 3
> ef 4
> bc 5
In that case, the table **as reported via SNMP** should be walked in the order
c1."ab" = 1
c1."ag" = 1 <<<< Here goes the new one ..as 'a' in ab and 'a' in ag are
same then next comparision is between b and g so g comes second as per
lexicographis order am I right?
c1."bc" = 5
c1."cd" = 3
c1."ef" = 4
c1."hi" = 2
rowstatus."ab" = ...
rowstatus."bc" = ...
rowstatus."cd" = ...
rowstatus."ef" = ...
rowstatus."hi" = ...
And again if this is modified to
> index c1 rowstatus
> ----------------------
> ab 1
> abc 1 <<< new one and single letter
> ag 1
> hi 2
> cd 3
> ef 4
> bc 5
and assuming that the index is non-IMPLIED which one comes first in the walk
c1.ab or c1.ag ? as both got 2 letters ? May I assume this is going to be
implementation specific as some or other logic needs to be applied at the end
to retrieve the data for non-implied index....and 'abg' comes last in the walk
as this is three letter
Regards
--- On Thu, 15/4/10, Dave Shield <d.t.shi...@liverpool.ac.uk> wrote:
From: Dave Shield <d.t.shi...@liverpool.ac.uk>
Subject: Re: Regarding string as index for tables
To: "phani kumar" <kumarc...@yahoo.co.uk>
Cc: net-snmp-users@lists.sourceforge.net
Date: Thursday, 15 April, 2010, 9:50
On 15 April 2010 09:34, phani kumar <kumarc...@yahoo.co.uk> wrote:
> Thanks for quick response and as you said lets assume the index looks like
>
> { index1, IMPLIED index2 }
>
> and lets simplify the index from two to one
Which?
Are you asking about a two-string indexed table, or a single-string
indexed table?
> and lets say this looks like
>
> index c1 rowstatus
> ----------------------
> ab 1
> hi 2
> cd 3
> ef 4
> bc 5
In that case, the table **as reported via SNMP** should be walked in the order
c1."ab" = 1
c1."bc" = 5
c1."cd" = 3
c1."ef" = 4
c1."hi" = 2
rowstatus."ab" = ...
rowstatus."bc" = ...
rowstatus."cd" = ...
rowstatus."ef" = ...
rowstatus."hi" = ...
> In the above scenario, the index is not according to lexicographical
> (am i correct?) order and this is because its is not sorted(lets assume).
I presume this is how the data is represented internally?
(Either within the agent, or in the underlying subsystem).
In which case, one of the tasks of the MIB implementation module
is to present the data in lexicographical order, as above.
That's precisely the purpose of the 'iterator' helper.
> So, how does the getnext works here?
> How is the next lexicographically index found? Is this like this
>
> ab then bc then cd then ef and hi
Correct.
Note that this works "as expected" because all the strings are
the same length. If some of the index strings were longer
than others, then the order depends on whether the table is
IMPLIED or not.
An IMPLIED index would continue to work in dictionary order.
A non-IMPLIED index would sort by length first. So short index
strings would come before longer ones.
OK?
Dave
> Could you pl also answer ip address being index from my earlier post
Patience - I'll get onto that once I'm happy that you're confident with
the stuff above!
------------------------------------------------------------------------------
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-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