I used mib2c to generate a table handler using the table data set
helper. This is working correctly, including row insertion/deletion
via a row status column.

However, I need to be able to implement a side-effect that must occur
when a row is deleted, and I am not sure how to do that. I tried
detecting the deletion from within the table handler function that
mib2c generated, but I was not successful.

/* Test Code */

    int
    myTable_handler(
        netsnmp_mib_handler               *handler,
        netsnmp_handler_registration      *reginfo,
       netsnmp_agent_request_info        *reqinfo,
        netsnmp_request_info              *requests) {

        if (reqinfo->mode == MODE_COMMIT)
        {
            for (netsnmp_request_info* request = requests;
                 request;
                 request = request->next)
            {
                netsnmp_table_data_set_storage *data =
                    netsnmp_extract_table_data_set_column(request,
COLUMN_MYTABLEROWSTATUS);

                if (data == 0)
                    std::cout << "Null ptr" << std::endl;
                else if (*data->data.integer == RS_DESTROY)
                {
                    std::cout << "Destroying row" << std::endl;
                }
            }
        }

        return SNMP_ERR_NOERROR;
    }

The netsnmp_extract_table_data_set_column always seems to return a
null pointer. I've also tried detecting other phases (MODE_RESERVE1,
etc.).

Can someone offer some guidance? Ideally, I would be able to have
access to the complete row before it is deleted so I can examine other
columns within the row.

Thanks.

Gregg

------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are 
consuming the most bandwidth. Provides multi-vendor support for NetFlow, 
J-Flow, sFlow and other flows. Make informed decisions using capacity planning
reports.http://sdm.link/zohodev2dev
_______________________________________________
Net-snmp-users mailing list
Net-snmp-users@lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users

Reply via email to