I used mib2c.raw-table.conf to generate c file.
But I don't know how to implement the get_next_entry() in the generated c file.
Actually, I don't know how to "Use the 'indexes' parameter to identify the next 
row in the table" and how to "update the 'indexes' parameter with the 
appropriate index values ..."
I searched both in the net-snmp source code, and on internet, and couldn't find 
an example about it.

The following is the generated code:
/** determine the appropriate row for an fuzzy request */
static struct myTable_entry *
myTable_get_next_entry( netsnmp_handler_registration *reginfo,
                     netsnmp_request_info         *request,
                     int                           column,
                     netsnmp_variable_list        *indexes ) {
    struct myTable_entry *row = NULL;
    oid             build_space[MAX_OID_LEN];
    size_t          build_space_len = 0;
    size_t          index_oid_len = 0;


    /* XXX - Use the 'indexes' parameter to identify the
             next row in the table.... */



    /* XXX   .... update the 'indexes' parameter with the
             appropriate index values ... */

    /* ... and update the requested OID to match this instance */
    memcpy(build_space, reginfo->rootoid,   /* registered oid */
                        reginfo->rootoid_len * sizeof(oid));
    build_space_len = reginfo->rootoid_len;
    build_space[build_space_len++] = 1;  /* entry */
    build_space[build_space_len++] = column; /* column */
    build_oid_noalloc(build_space + build_space_len,
                      MAX_OID_LEN - build_space_len, &index_oid_len,
                      NULL, 0, indexes);
    snmp_set_var_objid(request->requestvb, build_space,
                       build_space_len + index_oid_len);

    /*  Finally, return the data structure for this row */
    return row;
}

Could anyone proved a simple example of it?

Thanks a lot!

Best Regards,
Peilong

------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev
_______________________________________________
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