On 25/03/2008, Baltazar Francois <[EMAIL PROTECTED]> wrote:
>  We have generate the C code from the mib file OAM-GLOBAL-REG-V1.txt
> (attached)

The first thing that strikes me about that MIB file is that you are
defining a table with no accessible content.
The oamIndex column is defined as being "not-accessible"
(which is correct), but the two "column1/2" objects are also
defined as "not-accessible".
   This means that there is nothing in this table which can
be retrieved via SNMP.


> with the command
>
>  mib2c -c mib2c.create-dataset.conf oam

I'm not convinced that this code is the output of mib2c.
Given that all three MIB objects are not-accessible,
then I'd expect the default row call to be empty.

The OID given in 'oamTable_oid' doesn't match the OID from the
MIB file either.


>  Then we have created the handler to respond to the mib values.

If you are using the 'table_dataset' helper, then you don't need
a handler routine.  The dataset handler will deal with this for you.



>  When we have test the code , the agent seem to respond only to GET NEXT
> request. The OID that results from these requests is something like:
>     column_oid.6.115.110.109.112.118.51.

What is the exact GET request(s) that you are trying?


>  As you can see in the .c attached file there is a call to
>
>   netsnmp_table_row_add_index(row, ASN_OCTET_STR, "snmpv3",
>                                 strlen("snmpv3"));

Again, I don't believe that this was generated by mib2c.


>  We have tried to change this call to replace by an integer value (the value 
> of
> the index column),

That would be correct, yes.

> code has compiled but crash at this point giving "segmentation fault".

What is the exact code that you are using?


>  What we are trying to do is only to have an only one handler for all the 
> values
> of the table, which respond to GET and GETNEXT requests for the values
> which look like column_oid.1, column_oid.2, column_oid.n....

That is how things should work, yes.
Apart from the problems mentioned above (like not having any valid
columns in your MIB!)


>  Note : We are using net-snmp version 5.1.1 on Red Hat EL4

That is a very old release, and the 5.1.x line is no longer supported.
You might wish to upgrade to a more recent version (e.g. 5.4.1).
Though the problems you have outlined are probably not version
specific.

Dave

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to