Hi, Thanks for the help, in fact we didn't have any accessible content. But now, we have the C code, oam.c and oam.h, to respond the requests of the MIB OAM-GLOBAL-REG-V1.txt (all these files are attached) and we need to have a handler so we can control the requests.
While testing these code we noted that if we have 2 indexs, and if one of them is DisplayString type and the other one Integer type the code doesn't respond to the simple GET request, just GETNEXT requests. We also like that the code respond to a GETBULK request in order to get all the elements from a table. Can you give us a hand? -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Dave Shield Sent: quarta-feira, 26 de Março de 2008 9:22 To: Baltazar Francois Cc: [email protected]; Angela Lazaro Subject: Re: Help with snmp tables 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
oam.c
Description: oam.c
oam.h
Description: oam.h
OAM-GLOBAL-REG-V1 DEFINITIONS ::= BEGIN
IMPORTS
OBJECT-TYPE
FROM RFC-1212
enterprises
FROM RFC1155-SMI;
--
-- Node definitions
-- 1.3.6.1.4.1.22222
oam OBJECT-IDENTITY
STATUS current
DESCRIPTION "BLABABALBA"
::= { enterprises 22222 }
oamReg OBJECT-IDENTITY
STATUS current
DESCRIPTION "BLABABALBA"
::= { oam 1 }
oamModules OBJECT-IDENTITY
STATUS current
DESCRIPTION "BLABABALBA"
::= { oamReg 1 }
oamTable OBJECT-TYPE
SYNTAX SEQUENCE OF OamEntry
MAX-ACCESS not-accessible
STATUS current
DESCRIPTION "BLABABALBA"
::= { oamModules 1 }
oamEntry OBJECT-TYPE
SYNTAX OamEntry
MAX-ACCESS not-accessible
STATUS current
DESCRIPTION "BLABABALBA"
INDEX { oamIndex1,
oamIndex2 }
::= { oamTable 1 }
OamEntry ::= SEQUENCE {
oamIndex1 DisplayString,
column1 Integer32,
oamIndex2 Integer32,
column2 Integer32
}
oamIndex1 OBJECT-TYPE
SYNTAX DisplayString
MAX-ACCESS not-accessible
STATUS current
DESCRIPTION "Column Description"
::= { oamEntry 1 }
column1 OBJECT-TYPE
SYNTAX Integer32 (1 .. 3)
MAX-ACCESS read-only
STATUS current
DESCRIPTION "Column Description"
::= { oamEntry 2 }
oamIndex2 OBJECT-TYPE
SYNTAX Integer32 (1 .. 3)
MAX-ACCESS not-accessible
STATUS current
DESCRIPTION "Column Description"
::= { oamEntry 3 }
column2 OBJECT-TYPE
SYNTAX Integer32 (1 .. 3)
MAX-ACCESS read-only
STATUS current
DESCRIPTION "Column Description"
::= { oamEntry 4 }
END
------------------------------------------------------------------------- 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
