Hello all

I'm writing a module based on the create-dataset.conf template.
Here's the piece of the code:
--------------------------------
netsnmp_table_data_set *table_set; // global

void
initialize_table_commTable(void)
{
    static oid commTable_oid[] = {1,3,6,1,4,1,27142,1,10,1};
    size_t commTable_oid_len = OID_LENGTH(commTable_oid);    
    int one = 1;

    table_set = netsnmp_create_table_data_set("commTable");
    table_set->allow_creation = 1;
    table_set->rowstatus_column = COLUMN_COMMROWSTATUS;

    netsnmp_table_set_add_indexes(table_set,
                           ASN_INTEGER,  /* index: commIndex */
                           0);
    netsnmp_table_set_multi_add_default_row(table_set,
                                            COLUMN_COMMINDEX,ASN_INTEGER, 0,
                                            NULL, 0,
                                            COLUMN_COMMFROMTS, ASN_INTEGER, 1,
                                            NULL, 0,
                                            COLUMN_COMMTOTS, ASN_INTEGER, 1,
                                            NULL, 0,
                                            COLUMN_COMMCOUNTTS, ASN_INTEGER, 1,
                                            &one, sizeof(one),
                                            COLUMN_COMMMODE, ASN_INTEGER, 1,
                                            &one, sizeof(one),
                                            COLUMN_COMMROWSTATUS, ASN_INTEGER, 
1,
                                            NULL, 0,
                              0);

netsnmp_register_table_data_set(
netsnmp_create_handler_registration("commTable", NULL, commTable_oid, 
commTable_oid_len, HANDLER_CAN_RWRITE),
                            table_set, NULL);

        populate_table(); // filling the 'table_set'
}

void
init_comm(void)
{
    initialize_table_commTable();
    snmp_log(LOG_DEBUG, "init done\n");
}
-----------------------------
I've compiled this into .so and added dlmod line to snmpd.conf. But I get "No 
Such Object available on this agent at this OID" message though I see my log 
message in logs which means the module did loaded.

So does this piece of code process get/walk/set requests self-dependently or I 
_am_ to use suggested commTable_handler() and write code for all requests?
Or there are other errors?

PS sorry for long snippet but I'm really stuck.

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
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