How do I modify the init_XXX(void) function get OIDs use mib2c.table_data.conf template???

"飞飞" <[email protected]>
Newsgroups gmane.network.net-snmp.user
Message-ID <[email protected]>
Hi all:

when I use template mib2c.scalar.conf I get OIDs in init_uit() rightly(My mib data entries are all simply scalars);but when my mib is a simple table,I use mib2c.table_data.conf,I cannot get oids in init_uit() function.

I want to some one tell me where  I am wrong and how to fix it.

TIA

Alex

init_uit() function generated by mib2c.table_data.conf template (a table mib)
void
init_uit(void)
{
  
/* here we initialize all the tables we're planning on supporting */
    initialize_table_diskSystemTable();
}

init_uit() function generated by mib2c.scalar.conf template (a simple mib file are all scalars like above)
void
init_uit(void)
{
    static oid portID_oid[] = { 1,3,6,1,4,1,30901,2090,7000,1,1 };
    static oid encID_oid[] = { 1,3,6,1,4,1,30901,2090,7000,1,2 };
    static oid slotID_oid[] = { 1,3,6,1,4,1,30901,2090,7000,1,3 };
    static oid speed_oid[] = { 1,3,6,1,4,1,30901,2090,7000,1,4 };
    static oid status_oid[] = { 1,3,6,1,4,1,30901,2090,7000,1,5 };
    static oid revNew_oid[] = { 1,3,6,1,4,1,30901,2090,7000,1,6 };
    static oid smtStatus_oid[] = { 1,3,6,1,4,1,30901,2090,7000,1,7 };
    static oid bufStatus_oid[] = { 1,3,6,1,4,1,30901,2090,7000,1,8 };
    static oid dstype_oid[] = { 1,3,6,1,4,1,30901,2090,7000,1,9 };
    static oid uuID_oid[] = { 1,3,6,1,4,1,30901,2090,7000,1,10 };
    static oid size_oid[] = { 1,3,6,1,4,1,30901,2090,7000,1,11 };
    static oid diskID_oid[] = { 1,3,6,1,4,1,30901,2090,7000,1,12 };
    static oid vendor_oid[] = { 1,3,6,1,4,1,30901,2090,7000,1,13 };
    static oid revision_oid[] = { 1,3,6,1,4,1,30901,2090,7000,1,14 };
    static oid product_oid[] = { 1,3,6,1,4,1,30901,2090,7000,1,15 };
    static oid sn_oid[] = { 1,3,6,1,4,1,30901,2090,7000,1,16 };
  
  DEBUGMSGTL(("uit", "Initializing\n"));

    netsnmp_register_scalar(
        netsnmp_create_handler_registration("portID", handle_portID,
                               portID_oid, OID_LENGTH(portID_oid),
                               HANDLER_CAN_RONLY
        ));
    netsnmp_register_scalar(
        netsnmp_create_handler_registration("encID", handle_encID,
                               encID_oid, OID_LENGTH(encID_oid),
                               HANDLER_CAN_RONLY
        ));
    netsnmp_register_scalar(
        netsnmp_create_handler_registration("slotID", handle_slotID,
                               slotID_oid, OID_LENGTH(slotID_oid),
                               HANDLER_CAN_RONLY
        ));
    netsnmp_register_scalar(
        netsnmp_create_handler_registration("speed", handle_speed,
                               speed_oid, OID_LENGTH(speed_oid),
                               HANDLER_CAN_RONLY
        ));
    netsnmp_register_scalar(
        netsnmp_create_handler_registration("status", handle_status,
                               status_oid, OID_LENGTH(status_oid),
                               HANDLER_CAN_RONLY
        ));
    netsnmp_register_scalar(
        netsnmp_create_handler_registration("revNew", handle_revNew,
                               revNew_oid, OID_LENGTH(revNew_oid),
                               HANDLER_CAN_RONLY
        ));
    netsnmp_register_scalar(
        netsnmp_create_handler_registration("smtStatus", handle_smtStatus,
                               smtStatus_oid, OID_LENGTH(smtStatus_oid),
                               HANDLER_CAN_RONLY
        ));
    netsnmp_register_scalar(
        netsnmp_create_handler_registration("bufStatus", handle_bufStatus,
                               bufStatus_oid, OID_LENGTH(bufStatus_oid),
                               HANDLER_CAN_RONLY
        ));
    netsnmp_register_scalar(
        netsnmp_create_handler_registration("dstype", handle_dstype,
                               dstype_oid, OID_LENGTH(dstype_oid),
                               HANDLER_CAN_RONLY
        ));
    netsnmp_register_scalar(
        netsnmp_create_handler_registration("uuID", handle_uuID,
                               uuID_oid, OID_LENGTH(uuID_oid),
                               HANDLER_CAN_RONLY
        ));
    netsnmp_register_scalar(
        netsnmp_create_handler_registration("size", handle_size,
                               size_oid, OID_LENGTH(size_oid),
                               HANDLER_CAN_RONLY
        ));
    netsnmp_register_scalar(
        netsnmp_create_handler_registration("diskID", handle_diskID,
                               diskID_oid, OID_LENGTH(diskID_oid),
                               HANDLER_CAN_RONLY
        ));
    netsnmp_register_scalar(
        netsnmp_create_handler_registration("vendor", handle_vendor,
                               vendor_oid, OID_LENGTH(vendor_oid),
                               HANDLER_CAN_RONLY
        ));
    netsnmp_register_scalar(
        netsnmp_create_handler_registration("revision", handle_revision,
                               revision_oid, OID_LENGTH(revision_oid),
                               HANDLER_CAN_RONLY
        ));
    netsnmp_register_scalar(
        netsnmp_create_handler_registration("product", handle_product,
                               product_oid, OID_LENGTH(product_oid),
                               HANDLER_CAN_RONLY
        ));
    netsnmp_register_scalar(
        netsnmp_create_handler_registration("sn", handle_sn,
                               sn_oid, OID_LENGTH(sn_oid),
                               HANDLER_CAN_RONLY
        ));
}

------------------------------------------------------------------------------
Join us December 9, 2009 for the Red Hat Virtual Experience,
a free event focused on virtualization and cloud computing. 
Attend in-depth sessions from your desk. Your couch. Anywhere.
http://p.sf.net/sfu/redhat-sfdev2dev

_______________________________________________
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.