On Mon, 10 Oct 2005 10:59:59 -0300 Jordan wrote:
JJLDS> I´ve developed a agent with 2 tables(control table and result table).
JJLDS> When I query the agent with snmpget or snmpset everything goes fine.
JJLDS> The problem is when I use snmptable. If the control table is empty, a
JJLDS> segmentation fault error happens when I return NULL(row not found). The
JJLDS> same happens with result table.

The agent segfaults?  What happens if you do snmpgetnext  with multiple
varbinds?

JJLDS> Another problem is when I put data in the result table. When I try to
JJLDS> query the data with snmpget, the data is shown in the format HEX-STRING.

Do you have a DISPLAY-HINT for the object in the MIB? If not, the agent will
print a string unless there are unprintable characters, in which case it uses
hex.

JJLDS> 
/******************************GET_FIRST************************************/
JJLDS> marca*   ptMarcaTemp = NULL;
JJLDS>     netsnmp_variable_list *vptr;
JJLDS>     
JJLDS>     //Get the first node (line) of the structure (linked list)
JJLDS>     ptMarcaTemp = primeiro_no();
JJLDS>     
JJLDS>     *my_loop_context = ptMarcaTemp;
JJLDS>     *my_data_context = ptMarcaTemp;
JJLDS>     
JJLDS>     vptr = put_index_data;
JJLDS>     
JJLDS>     snmp_set_var_value(vptr, (u_char *) &ptMarcaTemp->indice, sizeof(
JJLDS> ptMarcaTemp->indice ));

If the table is empty, won't ptMarcaTmp be NULL? If so, you shouldn't
dereference it!

-- 
NOTE: messages sent directly to me, instead of the lists, will be deleted
      unless they are requests for paid consulting services.

Robert Story; NET-SNMP Junkie
Support: <http://www.net-snmp.org/> <irc://irc.freenode.net/#net-snmp>
Archive: <http://sourceforge.net/mailarchive/forum.php?forum=net-snmp-coders>

You are lost in a twisty maze of little standards, all different. 


-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to