Hi, I would like to use a string as a table index for my private mib (so its
easier to identify each row of the table from opennms). I'm declaring the
mib as follows...

MonThreadsTable OBJECT-TYPE
                        SYNTAX          SEQUENCE OF monThreadsEntry
                        MAX-ACCESS      not-accessible
                        STATUS          current
                        DESCRIPTION
                                        "softelMonitor Threads Info table"
                        ::= { softelMonitor 1 }

monThreadsEntry OBJECT-TYPE
                SYNTAX      monThreadsDetailsEntry
        ACCESS          not-accessible
        STATUS      current
                DESCRIPTION
                        "The monThreadsEntry row definition."
    INDEX       { IdThread }
    ::= { MonThreadsTable 1 }

monThreadsDetailsEntry ::=
        SEQUENCE {
                IdThread                DisplayString (SIZE (0..20)),
                ProcTime        Unsigned32,
                MaxProcTime     Unsigned32,
                ExecNumber      Unsigned32
    }
.
.
.
I used mib2c to generate a template (used iterate form) but after looking at
the code generated I noticed that mibc generated the following data
structure for my table..

    /* Typical data structure for a row entry */
struct MonThreadsTable_entry {
    /* Index values */
    char IdThread;

    /* Column values */
    char IdThread;
    u_long ProcTime;
    u_long MaxProcTime;
    u_long ExecNumber;

    /* Illustrate using a simple linked list */
    int   valid;
    struct MonThreadsTable_entry *next;
};

Why did mib3c generate the field's table Idthread as a char, shouldn't it be
string (pointer or array of chars???).  I changed its declaration to a 20
length char array but when I try to read its contents this message appears
in snmpd log file...

bad size for integer-like type (20)
send response: Error building ASN.1 representation (build int size 20: s/b
4)

So, how should I manage strings????
Thanks for any advice

Alejandro
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to