I've a littrle problem to insert rows in my table.
I used mib2c.iterate.conf to generate code for my adslAturPhysTable from 
ADSL-LINE-MIB.
This table uses ifIndex as index (I don't understand very well this kind of 
index it could be external index?!) and I try to insert a row with this 
structure:

/** Initialize the adslAturPhysTable table by defining its contents and how 
it's structured */

void
initialize_table_adslAturPhysTable(void)
{
    static oid      adslAturPhysTable_oid[] =
        { 1, 3, 6, 1, 2, 1, 10, 94, 1, 1, 3 };
    size_t          adslAturPhysTable_oid_len =
        OID_LENGTH(adslAturPhysTable_oid);
.......
......
.....

    /*
     * Initialise the contents of the table here
    */

     adslAturPhysTable_head=adslAturPhysTable_createEntry(1);

}

............
...........
    * Typical data structure for a row entry
     */
struct adslAturPhysTable_entry {
    /*
     * Index values
     */
    long            ifIndex;

    /*
     * Column values
     */
    char            adslAturInvSerialNumber;
    char            adslAturInvVendorID;
    char            adslAturInvVersionNumber;
    long            adslAturCurrSnrMgn;
    u_long          adslAturCurrAtn;
    char            adslAturCurrStatus;
    long            adslAturCurrOutputPwr;
    u_long          adslAturCurrAttainableRate;

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

struct adslAturPhysTable_entry *adslAturPhysTable_head=NULL;


/*
 * create a new row in the (unsorted) table
 */
struct adslAturPhysTable_entry *
adslAturPhysTable_createEntry(long ifIndex)
{
    struct adslAturPhysTable_entry *entry=NULL;

    entry = SNMP_MALLOC_TYPEDEF(struct adslAturPhysTable_entry);
    if (!entry)
        return NULL;

    entry->ifIndex = ifIndex;

    /* iserisco dei valori standard */
    entry->adslAturInvSerialNumber="a";
    entry->adslAturInvVendorID="r";
    entry->adslAturInvVersionNumber="u";
    entry->adslAturCurrSnrMgn=3;
    entry->adslAturCurrAtn=7;
    entry->adslAturCurrStatus="t";
    entry->adslAturCurrOutputPwr=5;
    entry->adslAturCurrAttainableRate=8;
    adslAturPhysTable_head=entry;
     entry->next =NULL;
    return entry;
}


the problem is when i start my subagent that launch 
initialize_table_adslAturPhysTable, and I try to do snmpwalk command but I 
received:

[EMAIL PROTECTED] demon_table_phys]# snmpwalk -c rw -v 2c localhost -IR 
adslAturPhysTable
Error in packet.
Reason: (genError) A general failure occured
Failed object: ADSL-LINE-MIB::adslAturPhysTable

ADSL-LINE-MIB::adslAturPhysTable = No Such Object available on this agent at 
this OID

And my subagent crash
[EMAIL PROTECTED] demon_table_phys]# ./adsl-demon-phy
example-demon is up and running.
Segmentation fault (core dumped)


What's wrong ? How can i create row ???





-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid3432&bid#0486&dat1642
_______________________________________________
Net-snmp-users mailing list
Net-snmp-users@lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users

Reply via email to