Hi All,

  I am trying to set a boolean mib object in Net-SNMP R5.4.1 agent.
But, the agent is giving the following error when I try to do snmpWalk
on the boolean objects. I have also attached the agent code snippet here.
I am compiling the agent code using VC++ 2008 express edition.

 Please let me know whether my approach for handling boolean object
is correct or not?

C:\usr\bin> snmpd.exe  -DShelf_Table_set
No log handling enabled - turning on stderr logging
registered debug token Shelf_Table_set, 1
netsnmp_assert x failed ..\..\agent\agent_registry.c:535
netsnmp_assert x failed ..\..\agent\agent_registry.c:535
netsnmp_assert x failed ..\..\agent\agent_registry.c:535
NET-SNMP version 5.4.1
Internal error in type switching
snmp_build: unknown failuresend response:  (wrong type in
snmp_realloc_rbuild_var_op: 1)
    -- SNMPv2-SMI::enterprises.9999.2.2.1.1.2.1.1.1.3.1.9.1
Internal error in type switching
snmp_build: unknown failuresend response:  (wrong type in
snmp_realloc_rbuild_var_op: 1)
    -- SNMPv2-SMI::enterprises.9999.2.2.1.1.2.1.1.1.3.1.9.1
Internal error in type switching
snmp_build: unknown failuresend response:  (wrong type in
snmp_realloc_rbuild_var_op: 1)
    -- SNMPv2-SMI::enterprises.9999.2.2.1.1.2.1.1.1.3.1.9.1
Internal error in type switching
snmp_build: unknown failuresend response:  (wrong type in
snmp_realloc_rbuild_var_op: 1)
    -- SNMPv2-SMI::enterprises.9999.2.2.1.1.2.1.1.1.3.1.9.1
Internal error in type switching
snmp_build: unknown failuresend response:  (wrong type in
snmp_realloc_rbuild_var_op: 1)
    -- SNMPv2-SMI::enterprises.9999.2.2.1.1.2.1.1.1.3.1.9.1
Internal error in type switching
snmp_build: unknown failuresend response:  (wrong type in
snmp_realloc_rbuild_var_op: 1)
    -- SNMPv2-SMI::enterprises.9999.2.2.1.1.2.1.1.1.3.1.9.1
Received TERM or STOP signal...  shutting down...

===========================================================

   // agent code Snippet

    oid             my_registration_oid[] =
{1,3,6,1,4,1,9999,2,2,1,1,2,1,1,1,3};
    boolean xxx = TRUE;
    boolean yyy = TRUE;
    ..............
    .............
        netsnmp_table_set_multi_add_default_row(table_set,
                                             2, ASN_OCTET_STR, 1, NULL, 0,
                                            3, ASN_INTEGER, 1, NULL, 0,
                                            4, ASN_BOOLEAN, 1, NULL, 0,
                                            5, ASN_BOOLEAN, 1, NULL, 0,
                                            0 /* done */ );
       ...............

    /*
     * set the index to 1
     */
    netsnmp_table_row_add_index(row, ASN_INTEGER, (u_char *) &index,
                                sizeof(u_long) );

    .................
    ....................

    /*
     * set column 3 - SnmpWalk is able to fetch the assigned integer value
     */
    netsnmp_set_row_column(row, 3, ASN_INTEGER, (u_char *)&aaa,
                           sizeof(u_long) );
    netsnmp_mark_row_column_writable(row, 3, 1);

    /*
     * set column 4 - Snmpwalk timwout with the above error msg
     */
    netsnmp_set_row_column(row, 4, ASN_BOOLEAN, (u_char *) &xxx, 1 );
    netsnmp_mark_row_column_writable(row, 4, 1);

    /*
     * set column 5
     */
    netsnmp_set_row_column(row, 5, ASN_BOOLEAN, (u_char *)&yyy,
                           sizeof(boolean) );
    netsnmp_mark_row_column_writable(row, 5, 1);

     ...............
    netsnmp_table_dataset_add_row(table_set, row);
     ...............


Thanks,

R Srinivasan
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to