Dave,
Thanks a lot.
Just to wind things for the day, this is the last one trust me.
1) So taking this logic to table with ip address as the index, lets say the
following one:
index c1
--------------------
1.2.3.4 10
10.3.4.5 20
1.3.4.5 30
1.2.4.4 40
then the walk should yield :
c1.1.2.3.4
c1.1.2.4.4
c1.1.3.4.5
c1.10.3.4.5
If I am correct , in the case of c1.1.2.3.4 and c1.1.2.4.4 as both the first
two octets are same the next lexicographical one to that is 3. So all this is
comparing octets and finding out which is next/greater to the current one ?
2) This is about ip address representation in the MIB. I remember we got
IpAddress TC from SMIv2 and we can use it. But then there is some new discussion
came across saying, the IpAddress TC is old and there is new one and
more precise which people are using now-a-days !! I am not sure this i a new TC
or donno
This is what I heard !! Dave, your comments please...
Regards
--- On Thu, 15/4/10, Dave Shield <[email protected]> wrote:
From: Dave Shield <[email protected]>
Subject: Re: Regarding string as index for tables
To: "phani kumar" <[email protected]>
Cc: [email protected]
Date: Thursday, 15 April, 2010, 10:52
On 15 April 2010 10:32, phani kumar <[email protected]> wrote:
> Then walk should be like
>
> c1.ABDC
> c1.ABBEA
> c1.BCQF
> c1.DEAD
> c1.DEFC
I'd suggest that you separate the index strings, to make the division clearer
i.e.
c1."AB"."DC"
etc
But that's just presentational.
The order you list is correct.
> And if second index is IMPLIED then the walk is :
>
> c1.ABBEA
> c1.ABDC
> c1.BCQF
> c1.DEAD
> c1.DEFC
>
> Am I right?
By George, I think he's got it!
> 2)You mentioned 'iterator' helper. Is this generic library helper or any
> specific one?
> Can you provide some examples pl.?
It's one of the helpers from the 'libnetsnmpagent' library.
There are several examples of MIB implementations that use this
helper under 'agent/mibgroup'.
It's also covered in the tutorials on the project website
> 3)If the example from my previous post is altered to
[snip]
> 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?
Yes
> c1."bc" = 5
> c1."cd" = 3
> c1."ef" = 4
> c1."hi" = 2
> rowstatus."ab" = ...
You should also see
rowstatus."ag" = ....
here
> 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
[snip]
> 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 ?
If the index is non-IMPLIED, then it's sorted by length first,
then by lexicographic order.
i.e. ab, ag, bc, cd, ef, hi, abc
> May I assume this is going to be implementation specific
No!
SNMP is very clear about the mapping from index values
to the resulting OID - so that this is *NOT* implementation specific.
The order of a table is defined precisely - regardless of the
vendor(s) involved.
That's what standards are all about!
Try writing these index values down using numeric subidentifiers
rather than characters
i.e. 2.97.98 instead of "ab"
3.97.98.99 instead of "abc"
2.104.105 instead of "hi"
etc,
and compare the OIDs. That should make it clear why things
come in the order that they do.
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-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