table can't be get and set, var_***Table functin is not invoked anyway

ye_cl <[email protected]>
Newsgroups gmane.network.net-snmp.user
Message-ID <[email protected]>
Hi,
I have a question to ask you.
In my mib2c-produced skeleton source files which are style of ucd-snmp, I can't get or set the node of Simple table. It always responds "1: node39param1.1 (nosuchobject) no such object". I find the table's get function "var_node39Table" is not invoked anyway. When I run "snmptable -v2c -c public 200.162.162.190 .1.3.6.1.4.1.19176.1.1.20.9.1.1.2.1", the agent always responds "Was that a table? SNMPv2-SMI::enterprises.19176.1.1.20.9.1.1.2.1". How can I resolve it?
My source code as follows: static long table_1 = 123;static long table_2 = 223;
static long table_3 = 323;
struct variable13 scomcenter_variables[] = {
.....
#define NODE39INDEX  11
    {NODE39INDEX, ASN_INTEGER, RWRITE, var_node39Table, 7,   {1, 1, 20, 9, 1, 1, 1}},
#define NODE39PARAM1  12
    {NODE39PARAM1, ASN_INTEGER, RWRITE, var_node39Table, 7,  {1, 1, 20, 9, 1, 1, 2}},
#define NODE39PARAM2  13
    {NODE39PARAM2, ASN_INTEGER, RWRITE, var_node39Table, 7,  {1, 1, 20, 9, 1, 1, 3}},
};
unsigned char  *
var_node39Table(struct variable *vp,
                oid * name,
                size_t *length,
                int exact, size_t *var_len, WriteMethod ** write_method)
{
    static long     long_ret;
    static u_long   ulong_ret;
    static unsigned char string[SPRINT_MAX_LEN];
    static oid      objid[MAX_OID_LEN];
    static struct counter64 c64;     printf("var_node39Table\n");
    if (header_simple_table
        (vp, name, length, exact, var_len, write_method, TABLE_SIZE)
        == MATCH_FAILED){
        printf("header_simple_table failed\n");
        return NULL;
     }
   printf("header_simple_table ok\n");
     
    switch (vp->magic) {
    case NODE39INDEX:
        *write_method = write_node39index;
        return (u_char *) &table_1;
    case NODE39PARAM1:
        *write_method = write_node39param1;
        return (u_char *)table_2;
    case NODE39PARAM2:
        *write_method = write_node39param2;
        return (u_char *) &table_3;
    default:
        ERROR_MSG("");
    }
    return NULL;
}

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/

_______________________________________________
Net-snmp-users mailing list
[email protected]
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.