Gemma> 1.- I think that two variables belonging to different trees
Gemma> (brother trees) in the MIB can`t have the same name.
David> Hi Gemma, your suspicions are correct. You shouldn't have variables
David> with the same name on a single MIB file. It is not allowed by SMI.
But note the qualification.
You can't have MIB objects with the same name "in a single MIB file"
(or strictly speaking, in a MIB module)
It *is* permissable to have objects with the same name defined in
two different MIB modules. Often not a good idea, but perfectly valid.
As far as 'mib2c' output is concerned, this is just a template.
You can call the (C) variables by whatever name you like.
This bears no relationship whatsoever with the MIB object names.
So if you run mib2c on a subtree (split across two MIB modules) that
happens to include two MIB objects with the same name, then you'd
need to tweak the template code to distinguish between the two.
You'd probably find it easier to run mib2c on a smaller subtree,
and avoid this problem altogether. But it's a perfectly valid
way to proceed.
2.- I want to define an array inside another array.
Nope - not possible.
At least not in that form.
You'll need to define a second parallel array,
that shares the same index objects, plus extra ones.
So, I have
defined "PrLnTab" that is an array with to index, the first one is "LinInd",
a reference to the "Lin" owning the "PrLn" and the second index "PrLnInd"
makes reference to the "PrLn" inside a "Lin". Something similar has been
done for "Sec". Is correct the way I have solved this problem?
Ummm...
It's not totally clear from that description, but yes - that sounds about
right.
Would be
problematic the existence of three variables name "LinInd" is this case?
As far as the MIB definitions are concerned, you should only have
one definition of "LinInd". (Hopefully not with that name!)
You don't say which mib2c config you're using to build this table,
but I'm not sure whether any of them support tables-within-tables
like this. You'll probably have to tackle linking the tables together
yourself.
But you can certainly have multiple C variables with the same name.
The fact that they're generated by an automatic tool doesn't affect
the basic C syntax rules. If they're local to a handler routine,
then they can be called whatever you like!
3.- The third (and last question). Are the OIDs generated by mib2c when I
make "mib2c -c mib2c.scalar.conf -f sest1 sestac" for the variables
belonging to an array corrects?
What exactly do you mean by that question?
If you're using the 'mib2c.scalar' config, then this *only* deals
with scalar objects. It will completely ignore MIB tables.
So there shouldn't be anything included for any array handling.
But the OIDs for the scalar objects should match the MIB file definitions.
If those MIB files are correct, then the generated OIDs will be too.
I say that because this variables are inside
an array
By "array" do you mean "table" ?
If so, then the 'mib2c.scalar" config is the wrong one to use.
Dave