mteEventNotificationTable.c
上传用户:wxp200602
上传日期:2007-10-30
资源大小:4028k
文件大小:4k
源码类别:

SNMP编程

开发平台:

Unix_Linux

  1. /*
  2.  * Note: this file originally auto-generated by mib2c using
  3.  *        : mib2c.create-dataset.conf,v 5.2 2002/07/17 14:41:53 dts12 Exp $
  4.  */
  5. #include <net-snmp/net-snmp-config.h>
  6. #include <net-snmp/net-snmp-includes.h>
  7. #include <net-snmp/agent/net-snmp-agent-includes.h>
  8. #include "mteEventNotificationTable.h"
  9. netsnmp_table_data_set *mteEventNotif_table_set;
  10. /** Initialize the mteEventNotificationTable table by defining its contents and how it's structured */
  11. void
  12. initialize_table_mteEventNotificationTable(void)
  13. {
  14.     static oid      mteEventNotificationTable_oid[] =
  15.         { 1, 3, 6, 1, 2, 1, 88, 1, 4, 3 };
  16.     size_t          mteEventNotificationTable_oid_len =
  17.         OID_LENGTH(mteEventNotificationTable_oid);
  18.     /*
  19.      * create the table structure itself 
  20.      */
  21.     mteEventNotif_table_set = netsnmp_create_table_data_set("mteEventNotificationTable");
  22.     /*
  23.      * comment this out or delete if you don't support creation of new rows 
  24.      */
  25.     mteEventNotif_table_set->allow_creation = 1;
  26.     /***************************************************
  27.      * Adding indexes
  28.      */
  29.     DEBUGMSGTL(("initialize_table_mteEventNotificationTable",
  30.                 "adding indexes to table mteEventNotificationTablen"));
  31.     netsnmp_table_set_add_indexes(mteEventNotif_table_set,
  32.                                   /* index: mteOwner */
  33.                                   ASN_OCTET_STR,
  34.                                   /* index: mteEventName */
  35.                                   ASN_PRIV_IMPLIED_OCTET_STR,
  36.                                   0);
  37.     DEBUGMSGTL(("initialize_table_mteEventNotificationTable",
  38.                 "adding column types to table mteEventNotificationTablen"));
  39.     netsnmp_table_set_multi_add_default_row(mteEventNotif_table_set,
  40.                                             COLUMN_MTEEVENTNOTIFICATION,
  41.                                             ASN_OBJECT_ID, 1, NULL, 0,
  42.                                             COLUMN_MTEEVENTNOTIFICATIONOBJECTSOWNER,
  43.                                             ASN_OCTET_STR, 1, NULL, 0,
  44.                                             COLUMN_MTEEVENTNOTIFICATIONOBJECTS,
  45.                                             ASN_OCTET_STR, 1, NULL, 0, 0);
  46.     /* keep index values around for comparisons later */
  47.     mteEventNotif_table_set->table->store_indexes = 1;
  48.     /*
  49.      * registering the table with the master agent 
  50.      */
  51.     /*
  52.      * note: if you don't need a subhandler to deal with any aspects
  53.      * of the request, change mteEventNotificationTable_handler to "NULL" 
  54.      */
  55.     netsnmp_register_table_data_set(netsnmp_create_handler_registration
  56.                                     ("mteEventNotificationTable",
  57.                                      mteEventNotificationTable_handler,
  58.                                      mteEventNotificationTable_oid,
  59.                                      mteEventNotificationTable_oid_len,
  60.                                      HANDLER_CAN_RWRITE), mteEventNotif_table_set, NULL);
  61. }
  62. /** Initializes the mteEventNotificationTable module */
  63. void
  64. init_mteEventNotificationTable(void)
  65. {
  66.     /*
  67.      * here we initialize all the tables we're planning on supporting 
  68.      */
  69.     initialize_table_mteEventNotificationTable();
  70. }
  71. /** handles requests for the mteEventNotificationTable table, if anything else needs to be done */
  72. int
  73. mteEventNotificationTable_handler(netsnmp_mib_handler *handler,
  74.                                   netsnmp_handler_registration *reginfo,
  75.                                   netsnmp_agent_request_info *reqinfo,
  76.                                   netsnmp_request_info *requests)
  77. {
  78.     /*
  79.      * perform anything here that you need to do.  The requests have
  80.      * already been processed by the master table_dataset handler, but
  81.      * this gives you chance to act on the request in some other way
  82.      * if need be. 
  83.      */
  84.     return SNMP_ERR_NOERROR;
  85. }