We are in the transition process from 4.2.x to 5.0.6 and are attempthing to develop new mib modules using the "new" approach. We ran the new mib modules through the 5.0.6 mib2c and got the appropriate starting points. Doing scalars in 5.0.6 is fairly straightforward but the table implementation is very different. I can't figure out what to do to table output from mib2c to get it to work. I have "borrowed" some code that I don't understand from vacm_context.c to get the new module to compile, but it still does not work so now I have to figure out what really needs to be done in the new module:
The output file from mib2c has two methods that appear to be roughly the same: netsnmp_variable_list * xxxxxx_get_first_data_point(....) And netsnmp_variable_list * xxxxxx_get_next_data_point(....) My guess is that xxxxxx_get_first_data_point should return the objectID (in the netsnmp_variable_list) of the first element table element (1 (column),1 (row)) for a 2 dimensional table and that given a object id in the "netsnmp_variable_list * put_index_data", xxxxxx_get_next_data_point(....) should return the object id of the next element (for example passing in the oid (1 (column),1 (row)) should possibly return the oid (1 (column),2 (row)). If this is true, how do I set this in the snmp_set_var_value(vptr, (u_char *) /* XXX: oidNumber data */ ,/* XXX: length of oidNumber data */ ); Call? For example if the object id of the (1,1) element in my array is "1.2.3.4.5.6.7.1", do I just do this: oid my_oid[] ={ 1,2,3,4,5,6,7,1}; vptr = put_index_data; snmp_set_var_value(vptr,(u_char *)my_oid,8); vptr = vptr->next_variable; return put_index_data; What is this my_loop_context, my_data_context supposto be? Do I need them at all if all I need to do is return the correct object id in the "put_index_data". In order to get the module to compile I replaced *my_loop_context = /* XXX */ ; *my_data_context = /* XXX */ ; With this code which I copied from vacm_context.c, it does not seem to do anything, should it? subtree_context_cache *context_ptr; context_ptr = get_top_context_cache(); if (!context_ptr) return NULL; *my_loop_context = context_ptr; *my_data_context = context_ptr; ------------------------------------------------------- SF.Net email is sponsored by: Tell us your software development plans! Take this survey and enter to win a one-year sub to SourceForge.net Plus IDC's 2005 look-ahead and a copy of this survey Click here to start! http://www.idcswdc.com/cgi-bin/survey?id5hix _______________________________________________ Net-snmp-coders mailing list Net-snmp-coders@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/net-snmp-coders