Hi all,
We have generate the C code from the mib file OAM-GLOBAL-REG-V1.txt (attached) 
with the command
 
mib2c -c mib2c.create-dataset.conf oam
 
Then we have created the handler to respond to the mib values.
 
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.
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"));

We have tried to change this call to replace by an integer value (the value of 
the index column), code has compiled but crash at this point giving 
"segmentation fault".

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....

Can you help us with that ?

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

Best regards,
François Baltazar

Attachment: oam.h
Description: oam.h

Attachment: oam.c
Description: oam.c



        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 { oamIndex }
                 ::= { oamTable 1 }
         
         
         OamEntry ::= SEQUENCE {
                        oamIndex Integer32,
                        column1 Integer32,
                        column2 Integer32
                        }  
                        
                oamIndex  OBJECT-TYPE
                SYNTAX            Integer32 (1 .. 3)
        MAX-ACCESS        not-accessible
        STATUS            current
        DESCRIPTION        "Column Description"
        ::=  {  oamEntry 1  }   
        
        column1  OBJECT-TYPE
                SYNTAX            Integer32 (1 .. 3)
        MAX-ACCESS        not-accessible
        STATUS            current
        DESCRIPTION        "Column Description"
        ::=  {  oamEntry 2  }  
        
        column2  OBJECT-TYPE
                SYNTAX            Integer32 (1 .. 3)
        MAX-ACCESS        not-accessible
        STATUS            current
        DESCRIPTION        "Column Description"
        ::=  {  oamEntry 3  }




                 
        END

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to