I have put the following code in snmpd.c but i am not
able to walkthru clusterTable. can anybody tell me
what is the problem with this code. i generated the
code using mib2c create.dataset.conf


void
initialize_table_prominenceMibDataClusterTable(void)
{
    static oid     
prominenceMibDataClusterTable_oid[] =
        { 1, 3, 6, 1, 4, 1, 7363, 1, 1, 1, 1, 2 };
    size_t         
prominenceMibDataClusterTable_oid_len =
        OID_LENGTH(prominenceMibDataClusterTable_oid);
    netsnmp_table_data_set *table_set;
    netsnmp_table_row *row;


    /*
     * create the table structure itself
     */
    table_set =
       
netsnmp_create_table_data_set("prominenceMibDataClusterTable");

    /*
     * comment this out or delete if you don't support
creation of new rows
     */
    table_set->allow_creation = 1;

   
/***************************************************
     * Adding indexes
     */
   
DEBUGMSGTL(("initialize_table_prominenceMibDataClusterTable",
                "adding indexes to table
prominenceMibDataClusterTable\n"));
    netsnmp_table_set_add_indexes(table_set,
ASN_IPADDRESS,     /* index: ClusterIPAddress */
                                  0);

   
DEBUGMSGTL(("initialize_table_prominenceMibDataClusterTable",
                "adding column types to table
prominenceMibDataClusterTable\n"));
    netsnmp_table_set_multi_add_default_row(table_set,
                                           
COLUMN_CLUSTERIPADDRESS,
                                           
ASN_IPADDRESS, 0, NULL, 0,
                                           
COLUMN_CLUSTERNAME,
                                           
ASN_OCTET_STR, 0, NULL, 0,
                                           
COLUMN_CLUSTERTYPE,
                                           
ASN_INTEGER, 0, NULL, 0,
                                           
COLUMN_CLUSTERSTATE,
                                           
ASN_INTEGER, 0, NULL, 0, 0);

    /*
     * registering the table with the master agent
     */
    /*
     * note: if you don't need a subhandler to deal
with any aspects
     * of the request, change
prominenceMibDataClusterTable_handler to "NULL"
     */
   
netsnmp_register_table_data_set(netsnmp_create_handler_registration
                                   
("prominenceMibDataClusterTable",
                                    
prominenceMibDataClusterTable_handler,
                                    
prominenceMibDataClusterTable_oid,
                                    
prominenceMibDataClusterTable_oid_len,
                                    
HANDLER_CAN_RWRITE), table_set, NULL);
   row = netsnmp_create_table_data_row();
   netsnmp_set_row_column(row, 1,
ASN_IPADDRESS,"192.168.25.9",strlen("192.168.25.9"));
   netsnmp_set_row_column(row, 2,
ASN_OCTET_STR,"lab3md259",strlen("lab3md259"));
   netsnmp_set_row_column(row, 3,
ASN_INTEGER,"1",strlen("1"));
   netsnmp_set_row_column(row, 4,
ASN_INTEGER,"2",strlen("2"));
   netsnmp_table_dataset_add_row(table_set, row);
   netsnmp_register_auto_data_table(table_set, NULL);
}


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to