Hello All,
We are trying to extend the Net-SNMP agent to support enterprise specific MIBs.
However we are facing the below issue when trying to implement tables.
1. For static tables (contents of which do not change until system
restart), we can use the below dataset APIs in initialize_table_*() function
itself and a GET and SET on the table objects works fine. We would also like to
know how we can add the SET request verification like netsnmp_check_vb_type and
the value range verification when we add the rows in the initialize_table_*()
function.
row = netsnmp_create_table_data_row();
/* set the index of the table */
netsnmp_table_row_add_index(row, ASN_INTEGER, &index, sizeof(index));
netsnmp_set_row_column(row, COLUMN_SHELFNUM, ASN_INTEGER, &shelfNum,
sizeof(shelfNum) );
sprintf(shelfName, "Shelf%d", shelfNum);
netsnmp_set_row_column(row, SHELFNAME, ASN_OCTET_STR, (char*) shelfName,
strlen(shelfName));
netsnmp_mark_row_column_writable(row, COLUMN_SHELFNAME, 1); /*
make writable via SETs */
netsnmp_table_dataset_add_row(table_set, row);
2. Now we are trying to implement CONNECTION table which is a dynamic
table. When the system starts (when snmpd agent is launched) there may or may
not be any entries in this table and eventually as connections are configured
this table is populated. The initialize_table_() function will be called once
only when the daemon initializes the modules. How do we handle the updation of
Connection Table? We assume that this part has to be specifically handled in
*Table_handler() functions and the row addition (above code snippet) will not
be present in the init function for connection table. Is this assumption
correct? If yes, we would like to know what functions can we use here for
implementing both GET and SET modes? The so far examples posted in different
forums do not address this part.
~Suresh
------------------------------------------------------------------------------
Write once. Port to many.
Get the SDK and tools to simplify cross-platform app development. Create
new or port existing apps to sell to consumers worldwide. Explore the
Intel AppUpSM program developer opportunity. appdeveloper.intel.com/join
http://p.sf.net/sfu/intel-appdev
_______________________________________________
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders