Hello guys, I´ve sent an e-mail last week but I´ve got no answers, so I´m
reporting my problem again. 

I´ve developed a agent with 2 tables(control table and result table). When I
query the agent with snmpget or snmpset everything goes fine. The problem is
when I use snmptable. If the control table is empty, a segmentation fault
error happens when I return NULL(row not found). The same happens with result
table.

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

I don´t know how can I proceed anymore. Any suggestions.

P.S.: I´m sending the code of get_{first, next} of the control table.

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

    return put_index_data; 

/******************************GET_NEXT************************************/
    marca*      ptMarcaTemp;
    
    //Adjust pointer
    ptMarcaTemp = *my_loop_context;
    ptMarcaTemp = ptMarcaTemp->prox;
    
    //Empty table
    if(ptMarcaTemp == NULL)
    {
        return NULL;
    }
        
    netsnmp_variable_list *vptr;

    vptr = put_index_data;
    
    snmp_set_var_value(vptr, (u_char *) &ptMarcaTemp->indice, sizeof(
ptMarcaTemp->indice ));
    vptr = vptr->next_variable;
    
    
    return put_index_data;
}

Jordan Janeiro
Telemídia - PUC-Rio



-------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to