|
|
@@ -0,0 +1,640 @@
|
|
|
+/*
|
|
|
+ * Note: this file originally auto-generated by mib2c
|
|
|
+ * using mib2c.create-dataset.conf
|
|
|
+ */
|
|
|
+
|
|
|
+#include <net-snmp/net-snmp-config.h>
|
|
|
+#include <net-snmp/net-snmp-includes.h>
|
|
|
+#include <net-snmp/agent/net-snmp-agent-includes.h>
|
|
|
+#include "pduMIB.h"
|
|
|
+
|
|
|
+/** Initialize the pduChannelTable table by defining its contents and how it's structured */
|
|
|
+void
|
|
|
+initialize_table_pduChannelTable(void)
|
|
|
+{
|
|
|
+ const oid pduChannelTable_oid[] = {1,3,6,1,4,1,2024,1,3,9};
|
|
|
+ netsnmp_table_data_set *table_set;
|
|
|
+
|
|
|
+ /* create the table structure itself */
|
|
|
+ table_set = netsnmp_create_table_data_set("pduChannelTable");
|
|
|
+
|
|
|
+ /* comment this out or delete if you don't support creation of new rows */
|
|
|
+ table_set->allow_creation = 1;
|
|
|
+
|
|
|
+ /***************************************************
|
|
|
+ * Adding indexes
|
|
|
+ */
|
|
|
+ DEBUGMSGTL(("initialize_table_pduChannelTable",
|
|
|
+ "adding indexes to table pduChannelTable\n"));
|
|
|
+ netsnmp_table_set_add_indexes(table_set,
|
|
|
+ ASN_INTEGER, /* index: pduChannelID */
|
|
|
+ 0);
|
|
|
+
|
|
|
+ DEBUGMSGTL(("initialize_table_pduChannelTable",
|
|
|
+ "adding column types to table pduChannelTable\n"));
|
|
|
+ netsnmp_table_set_multi_add_default_row(table_set,
|
|
|
+ COLUMN_PDUCHANNELID, ASN_INTEGER, 0,
|
|
|
+ NULL, 0,
|
|
|
+ COLUMN_PDUCHANNELNAME, ASN_OCTET_STR, 0,
|
|
|
+ NULL, 0,
|
|
|
+ COLUMN_PDUCHANNELSTATUS, ASN_INTEGER, 1,
|
|
|
+ NULL, 0,
|
|
|
+ COLUMN_PDUCHANNELVOLTAGE, ASN_OCTET_STR, 0,
|
|
|
+ NULL, 0,
|
|
|
+ COLUMN_PDUCHANNELCURRENT, ASN_OCTET_STR, 0,
|
|
|
+ NULL, 0,
|
|
|
+ COLUMN_PDUCHANNELFREQUENCY, ASN_INTEGER, 0,
|
|
|
+ NULL, 0,
|
|
|
+ COLUMN_PDUCHANNELCONSUMPTION, ASN_OCTET_STR, 0,
|
|
|
+ NULL, 0,
|
|
|
+ COLUMN_PDUCHANNELPOWERFACTOR, ASN_OCTET_STR, 0,
|
|
|
+ NULL, 0,
|
|
|
+ COLUMN_PDUCHANNELPACTIVEPOWER, ASN_OCTET_STR, 0,
|
|
|
+ NULL, 0,
|
|
|
+ COLUMN_PDUCHANNELREACTIVEPOWER, ASN_OCTET_STR, 0,
|
|
|
+ NULL, 0,
|
|
|
+ COLUMN_PDUCHANNELAPPARENTPOWER, ASN_OCTET_STR, 0,
|
|
|
+ NULL, 0,
|
|
|
+ 0);
|
|
|
+
|
|
|
+ /* registering the table with the master agent */
|
|
|
+ /* note: if you don't need a subhandler to deal with any aspects
|
|
|
+ of the request, change pduChannelTable_handler to "NULL" */
|
|
|
+ netsnmp_register_table_data_set(netsnmp_create_handler_registration("pduChannelTable", pduChannelTable_handler,
|
|
|
+ pduChannelTable_oid,
|
|
|
+ OID_LENGTH(pduChannelTable_oid),
|
|
|
+ HANDLER_CAN_RWRITE),
|
|
|
+ table_set, NULL);
|
|
|
+}
|
|
|
+/** Initialize the pduGroupTable table by defining its contents and how it's structured */
|
|
|
+void
|
|
|
+initialize_table_pduGroupTable(void)
|
|
|
+{
|
|
|
+ const oid pduGroupTable_oid[] = {1,3,6,1,4,1,2024,1,3,10};
|
|
|
+ netsnmp_table_data_set *table_set;
|
|
|
+
|
|
|
+ /* create the table structure itself */
|
|
|
+ table_set = netsnmp_create_table_data_set("pduGroupTable");
|
|
|
+
|
|
|
+ /* comment this out or delete if you don't support creation of new rows */
|
|
|
+ table_set->allow_creation = 1;
|
|
|
+
|
|
|
+ /***************************************************
|
|
|
+ * Adding indexes
|
|
|
+ */
|
|
|
+ DEBUGMSGTL(("initialize_table_pduGroupTable",
|
|
|
+ "adding indexes to table pduGroupTable\n"));
|
|
|
+ netsnmp_table_set_add_indexes(table_set,
|
|
|
+ ASN_INTEGER, /* index: pduGroupID */
|
|
|
+ 0);
|
|
|
+
|
|
|
+ DEBUGMSGTL(("initialize_table_pduGroupTable",
|
|
|
+ "adding column types to table pduGroupTable\n"));
|
|
|
+ netsnmp_table_set_multi_add_default_row(table_set,
|
|
|
+ COLUMN_PDUGROUPID, ASN_INTEGER, 0,
|
|
|
+ NULL, 0,
|
|
|
+ COLUMN_PDUGROUPNAME, ASN_OCTET_STR, 1,
|
|
|
+ NULL, 0,
|
|
|
+ COLUMN_PDUGROUPLIST, ASN_OCTET_STR, 1,
|
|
|
+ NULL, 0,
|
|
|
+ COLUMN_PDUGROUPSTATUS, ASN_INTEGER, 1,
|
|
|
+ NULL, 0,
|
|
|
+ 0);
|
|
|
+
|
|
|
+ /* registering the table with the master agent */
|
|
|
+ /* note: if you don't need a subhandler to deal with any aspects
|
|
|
+ of the request, change pduGroupTable_handler to "NULL" */
|
|
|
+ netsnmp_register_table_data_set(netsnmp_create_handler_registration("pduGroupTable", pduGroupTable_handler,
|
|
|
+ pduGroupTable_oid,
|
|
|
+ OID_LENGTH(pduGroupTable_oid),
|
|
|
+ HANDLER_CAN_RWRITE),
|
|
|
+ table_set, NULL);
|
|
|
+}
|
|
|
+/** Initialize the pduSensorTable table by defining its contents and how it's structured */
|
|
|
+void
|
|
|
+initialize_table_pduSensorTable(void)
|
|
|
+{
|
|
|
+ const oid pduSensorTable_oid[] = {1,3,6,1,4,1,2024,1,4,1};
|
|
|
+ netsnmp_table_data_set *table_set;
|
|
|
+
|
|
|
+ /* create the table structure itself */
|
|
|
+ table_set = netsnmp_create_table_data_set("pduSensorTable");
|
|
|
+
|
|
|
+ /* comment this out or delete if you don't support creation of new rows */
|
|
|
+ table_set->allow_creation = 1;
|
|
|
+
|
|
|
+ /***************************************************
|
|
|
+ * Adding indexes
|
|
|
+ */
|
|
|
+ DEBUGMSGTL(("initialize_table_pduSensorTable",
|
|
|
+ "adding indexes to table pduSensorTable\n"));
|
|
|
+ netsnmp_table_set_add_indexes(table_set,
|
|
|
+ ASN_INTEGER, /* index: pduSensorID */
|
|
|
+ 0);
|
|
|
+
|
|
|
+ DEBUGMSGTL(("initialize_table_pduSensorTable",
|
|
|
+ "adding column types to table pduSensorTable\n"));
|
|
|
+ netsnmp_table_set_multi_add_default_row(table_set,
|
|
|
+ COLUMN_PDUSENSORID, ASN_INTEGER, 0,
|
|
|
+ NULL, 0,
|
|
|
+ COLUMN_PDUSENSORNAME, ASN_OCTET_STR, 0,
|
|
|
+ NULL, 0,
|
|
|
+ COLUMN_PDUSENSORTYPE, ASN_INTEGER, 0,
|
|
|
+ NULL, 0,
|
|
|
+ COLUMN_PDUSENSORDATACHENNEL, ASN_OCTET_STR, 0,
|
|
|
+ NULL, 0,
|
|
|
+ COLUMN_PDUSENSORMODBUSADDRESS, ASN_INTEGER, 0,
|
|
|
+ NULL, 0,
|
|
|
+ COLUMN_PDUSENSORSTATUS, ASN_INTEGER, 1,
|
|
|
+ NULL, 0,
|
|
|
+ COLUMN_PDUSENSORVALUENUM, ASN_INTEGER, 0,
|
|
|
+ NULL, 0,
|
|
|
+ COLUMN_PDUSENSORVALUE1, ASN_INTEGER, 0,
|
|
|
+ NULL, 0,
|
|
|
+ COLUMN_PDUSENSORVALUE2, ASN_INTEGER, 0,
|
|
|
+ NULL, 0,
|
|
|
+ 0);
|
|
|
+
|
|
|
+ /* registering the table with the master agent */
|
|
|
+ /* note: if you don't need a subhandler to deal with any aspects
|
|
|
+ of the request, change pduSensorTable_handler to "NULL" */
|
|
|
+ netsnmp_register_table_data_set(netsnmp_create_handler_registration("pduSensorTable", pduSensorTable_handler,
|
|
|
+ pduSensorTable_oid,
|
|
|
+ OID_LENGTH(pduSensorTable_oid),
|
|
|
+ HANDLER_CAN_RWRITE),
|
|
|
+ table_set, NULL);
|
|
|
+}
|
|
|
+/** Initialize the pduSMTPRecMailTable table by defining its contents and how it's structured */
|
|
|
+void
|
|
|
+initialize_table_pduSMTPRecMailTable(void)
|
|
|
+{
|
|
|
+ const oid pduSMTPRecMailTable_oid[] = {1,3,6,1,4,1,2024,1,5,3,4};
|
|
|
+ netsnmp_table_data_set *table_set;
|
|
|
+
|
|
|
+ /* create the table structure itself */
|
|
|
+ table_set = netsnmp_create_table_data_set("pduSMTPRecMailTable");
|
|
|
+
|
|
|
+ /* comment this out or delete if you don't support creation of new rows */
|
|
|
+ table_set->allow_creation = 1;
|
|
|
+
|
|
|
+ /***************************************************
|
|
|
+ * Adding indexes
|
|
|
+ */
|
|
|
+ DEBUGMSGTL(("initialize_table_pduSMTPRecMailTable",
|
|
|
+ "adding indexes to table pduSMTPRecMailTable\n"));
|
|
|
+ netsnmp_table_set_add_indexes(table_set,
|
|
|
+ ASN_OCTET_STR, /* index: pduSMTPRecMail */
|
|
|
+ 0);
|
|
|
+
|
|
|
+ DEBUGMSGTL(("initialize_table_pduSMTPRecMailTable",
|
|
|
+ "adding column types to table pduSMTPRecMailTable\n"));
|
|
|
+ netsnmp_table_set_multi_add_default_row(table_set,
|
|
|
+ COLUMN_PDUSMTPRECMAIL, ASN_OCTET_STR, 1,
|
|
|
+ NULL, 0,
|
|
|
+ 0);
|
|
|
+
|
|
|
+ /* registering the table with the master agent */
|
|
|
+ /* note: if you don't need a subhandler to deal with any aspects
|
|
|
+ of the request, change pduSMTPRecMailTable_handler to "NULL" */
|
|
|
+ netsnmp_register_table_data_set(netsnmp_create_handler_registration("pduSMTPRecMailTable", pduSMTPRecMailTable_handler,
|
|
|
+ pduSMTPRecMailTable_oid,
|
|
|
+ OID_LENGTH(pduSMTPRecMailTable_oid),
|
|
|
+ HANDLER_CAN_RWRITE),
|
|
|
+ table_set, NULL);
|
|
|
+}
|
|
|
+/** Initialize the pduMessageNumTable table by defining its contents and how it's structured */
|
|
|
+void
|
|
|
+initialize_table_pduMessageNumTable(void)
|
|
|
+{
|
|
|
+ const oid pduMessageNumTable_oid[] = {1,3,6,1,4,1,2024,1,5,5,2};
|
|
|
+ netsnmp_table_data_set *table_set;
|
|
|
+
|
|
|
+ /* create the table structure itself */
|
|
|
+ table_set = netsnmp_create_table_data_set("pduMessageNumTable");
|
|
|
+
|
|
|
+ /* comment this out or delete if you don't support creation of new rows */
|
|
|
+ table_set->allow_creation = 1;
|
|
|
+
|
|
|
+ /***************************************************
|
|
|
+ * Adding indexes
|
|
|
+ */
|
|
|
+ DEBUGMSGTL(("initialize_table_pduMessageNumTable",
|
|
|
+ "adding indexes to table pduMessageNumTable\n"));
|
|
|
+ netsnmp_table_set_add_indexes(table_set,
|
|
|
+ ASN_OCTET_STR, /* index: pduMessageRecNum */
|
|
|
+ 0);
|
|
|
+
|
|
|
+ DEBUGMSGTL(("initialize_table_pduMessageNumTable",
|
|
|
+ "adding column types to table pduMessageNumTable\n"));
|
|
|
+ netsnmp_table_set_multi_add_default_row(table_set,
|
|
|
+ COLUMN_PDUMESSAGERECNUM, ASN_OCTET_STR, 1,
|
|
|
+ NULL, 0,
|
|
|
+ 0);
|
|
|
+
|
|
|
+ /* registering the table with the master agent */
|
|
|
+ /* note: if you don't need a subhandler to deal with any aspects
|
|
|
+ of the request, change pduMessageNumTable_handler to "NULL" */
|
|
|
+ netsnmp_register_table_data_set(netsnmp_create_handler_registration("pduMessageNumTable", pduMessageNumTable_handler,
|
|
|
+ pduMessageNumTable_oid,
|
|
|
+ OID_LENGTH(pduMessageNumTable_oid),
|
|
|
+ HANDLER_CAN_RWRITE),
|
|
|
+ table_set, NULL);
|
|
|
+}
|
|
|
+/** Initialize the pduMQTTBrokerTable table by defining its contents and how it's structured */
|
|
|
+void
|
|
|
+initialize_table_pduMQTTBrokerTable(void)
|
|
|
+{
|
|
|
+ const oid pduMQTTBrokerTable_oid[] = {1,3,6,1,4,1,2024,1,5,6,3};
|
|
|
+ netsnmp_table_data_set *table_set;
|
|
|
+
|
|
|
+ /* create the table structure itself */
|
|
|
+ table_set = netsnmp_create_table_data_set("pduMQTTBrokerTable");
|
|
|
+
|
|
|
+ /* comment this out or delete if you don't support creation of new rows */
|
|
|
+ table_set->allow_creation = 1;
|
|
|
+
|
|
|
+ /***************************************************
|
|
|
+ * Adding indexes
|
|
|
+ */
|
|
|
+ DEBUGMSGTL(("initialize_table_pduMQTTBrokerTable",
|
|
|
+ "adding indexes to table pduMQTTBrokerTable\n"));
|
|
|
+ netsnmp_table_set_add_indexes(table_set,
|
|
|
+ ASN_OCTET_STR, /* index: pduMQTTBrokerName */
|
|
|
+ 0);
|
|
|
+
|
|
|
+ DEBUGMSGTL(("initialize_table_pduMQTTBrokerTable",
|
|
|
+ "adding column types to table pduMQTTBrokerTable\n"));
|
|
|
+ netsnmp_table_set_multi_add_default_row(table_set,
|
|
|
+ COLUMN_PDUMQTTBROKERNAME, ASN_OCTET_STR, 1,
|
|
|
+ NULL, 0,
|
|
|
+ COLUMN_PDUMQTTBROKERENABLE, ASN_INTEGER, 1,
|
|
|
+ NULL, 0,
|
|
|
+ COLUMN_PDUMQTTBROKERIPORDOMAIN, ASN_OCTET_STR, 1,
|
|
|
+ NULL, 0,
|
|
|
+ COLUMN_PDUMQTTBROKERPORT, ASN_INTEGER, 1,
|
|
|
+ NULL, 0,
|
|
|
+ COLUMN_PDUMQTTBROKERUSERNAME, ASN_OCTET_STR, 1,
|
|
|
+ NULL, 0,
|
|
|
+ COLUMN_PDUMQTTBROKERUSERPW, ASN_OCTET_STR, 1,
|
|
|
+ NULL, 0,
|
|
|
+ 0);
|
|
|
+
|
|
|
+ /* registering the table with the master agent */
|
|
|
+ /* note: if you don't need a subhandler to deal with any aspects
|
|
|
+ of the request, change pduMQTTBrokerTable_handler to "NULL" */
|
|
|
+ netsnmp_register_table_data_set(netsnmp_create_handler_registration("pduMQTTBrokerTable", pduMQTTBrokerTable_handler,
|
|
|
+ pduMQTTBrokerTable_oid,
|
|
|
+ OID_LENGTH(pduMQTTBrokerTable_oid),
|
|
|
+ HANDLER_CAN_RWRITE),
|
|
|
+ table_set, NULL);
|
|
|
+}
|
|
|
+/** Initialize the pduCloudServerTable table by defining its contents and how it's structured */
|
|
|
+void
|
|
|
+initialize_table_pduCloudServerTable(void)
|
|
|
+{
|
|
|
+ const oid pduCloudServerTable_oid[] = {1,3,6,1,4,1,2024,1,5,7,3};
|
|
|
+ netsnmp_table_data_set *table_set;
|
|
|
+
|
|
|
+ /* create the table structure itself */
|
|
|
+ table_set = netsnmp_create_table_data_set("pduCloudServerTable");
|
|
|
+
|
|
|
+ /* comment this out or delete if you don't support creation of new rows */
|
|
|
+ table_set->allow_creation = 1;
|
|
|
+
|
|
|
+ /***************************************************
|
|
|
+ * Adding indexes
|
|
|
+ */
|
|
|
+ DEBUGMSGTL(("initialize_table_pduCloudServerTable",
|
|
|
+ "adding indexes to table pduCloudServerTable\n"));
|
|
|
+ netsnmp_table_set_add_indexes(table_set,
|
|
|
+ ASN_OCTET_STR, /* index: pduCloudServerName */
|
|
|
+ 0);
|
|
|
+
|
|
|
+ DEBUGMSGTL(("initialize_table_pduCloudServerTable",
|
|
|
+ "adding column types to table pduCloudServerTable\n"));
|
|
|
+ netsnmp_table_set_multi_add_default_row(table_set,
|
|
|
+ COLUMN_PDUCLOUDSERVERNAME, ASN_OCTET_STR, 1,
|
|
|
+ NULL, 0,
|
|
|
+ COLUMN_PDUCLOUDSERVERENABLE, ASN_INTEGER, 1,
|
|
|
+ NULL, 0,
|
|
|
+ COLUMN_PDUCLOUDSERVERIPORDOMAIN, ASN_OCTET_STR, 1,
|
|
|
+ NULL, 0,
|
|
|
+ COLUMN_PDUCLOUDSERVERPORT, ASN_INTEGER, 1,
|
|
|
+ NULL, 0,
|
|
|
+ COLUMN_PDUCLOUDSERVERUSERNAME, ASN_OCTET_STR, 1,
|
|
|
+ NULL, 0,
|
|
|
+ COLUMN_PDUCLOUDSERVERUSERPW, ASN_OCTET_STR, 1,
|
|
|
+ NULL, 0,
|
|
|
+ 0);
|
|
|
+
|
|
|
+ /* registering the table with the master agent */
|
|
|
+ /* note: if you don't need a subhandler to deal with any aspects
|
|
|
+ of the request, change pduCloudServerTable_handler to "NULL" */
|
|
|
+ netsnmp_register_table_data_set(netsnmp_create_handler_registration("pduCloudServerTable", pduCloudServerTable_handler,
|
|
|
+ pduCloudServerTable_oid,
|
|
|
+ OID_LENGTH(pduCloudServerTable_oid),
|
|
|
+ HANDLER_CAN_RWRITE),
|
|
|
+ table_set, NULL);
|
|
|
+}
|
|
|
+/** Initialize the pduAlarmHistoryTable table by defining its contents and how it's structured */
|
|
|
+void
|
|
|
+initialize_table_pduAlarmHistoryTable(void)
|
|
|
+{
|
|
|
+ const oid pduAlarmHistoryTable_oid[] = {1,3,6,1,4,1,2024,1,6,1};
|
|
|
+ netsnmp_table_data_set *table_set;
|
|
|
+
|
|
|
+ /* create the table structure itself */
|
|
|
+ table_set = netsnmp_create_table_data_set("pduAlarmHistoryTable");
|
|
|
+
|
|
|
+ /* comment this out or delete if you don't support creation of new rows */
|
|
|
+ table_set->allow_creation = 1;
|
|
|
+
|
|
|
+ /***************************************************
|
|
|
+ * Adding indexes
|
|
|
+ */
|
|
|
+ DEBUGMSGTL(("initialize_table_pduAlarmHistoryTable",
|
|
|
+ "adding indexes to table pduAlarmHistoryTable\n"));
|
|
|
+ netsnmp_table_set_add_indexes(table_set,
|
|
|
+ ASN_INTEGER, /* index: pduAlarmID */
|
|
|
+ 0);
|
|
|
+
|
|
|
+ DEBUGMSGTL(("initialize_table_pduAlarmHistoryTable",
|
|
|
+ "adding column types to table pduAlarmHistoryTable\n"));
|
|
|
+ netsnmp_table_set_multi_add_default_row(table_set,
|
|
|
+ COLUMN_PDUALARMID, ASN_INTEGER, 0,
|
|
|
+ NULL, 0,
|
|
|
+ COLUMN_PDUALARMTYPE, ASN_INTEGER, 0,
|
|
|
+ NULL, 0,
|
|
|
+ COLUMN_PDUALARMCONTEXT, ASN_OCTET_STR, 0,
|
|
|
+ NULL, 0,
|
|
|
+ COLUMN_PDUALARMACTION, ASN_INTEGER, 0,
|
|
|
+ NULL, 0,
|
|
|
+ COLUMN_PDUALARMACTIONPARA, ASN_INTEGER, 0,
|
|
|
+ NULL, 0,
|
|
|
+ COLUMN_PDUALARMDATE, ASN_OCTET_STR, 0,
|
|
|
+ NULL, 0,
|
|
|
+ COLUMN_PDUALARMTIME, ASN_OCTET_STR, 0,
|
|
|
+ NULL, 0,
|
|
|
+ 0);
|
|
|
+
|
|
|
+ /* registering the table with the master agent */
|
|
|
+ /* note: if you don't need a subhandler to deal with any aspects
|
|
|
+ of the request, change pduAlarmHistoryTable_handler to "NULL" */
|
|
|
+ netsnmp_register_table_data_set(netsnmp_create_handler_registration("pduAlarmHistoryTable", pduAlarmHistoryTable_handler,
|
|
|
+ pduAlarmHistoryTable_oid,
|
|
|
+ OID_LENGTH(pduAlarmHistoryTable_oid),
|
|
|
+ HANDLER_CAN_RWRITE),
|
|
|
+ table_set, NULL);
|
|
|
+}
|
|
|
+/** Initialize the pduChannelLimitTable table by defining its contents and how it's structured */
|
|
|
+void
|
|
|
+initialize_table_pduChannelLimitTable(void)
|
|
|
+{
|
|
|
+ const oid pduChannelLimitTable_oid[] = {1,3,6,1,4,1,2024,1,7,2,6};
|
|
|
+ netsnmp_table_data_set *table_set;
|
|
|
+
|
|
|
+ /* create the table structure itself */
|
|
|
+ table_set = netsnmp_create_table_data_set("pduChannelLimitTable");
|
|
|
+
|
|
|
+ /* comment this out or delete if you don't support creation of new rows */
|
|
|
+ table_set->allow_creation = 1;
|
|
|
+
|
|
|
+ /***************************************************
|
|
|
+ * Adding indexes
|
|
|
+ */
|
|
|
+ DEBUGMSGTL(("initialize_table_pduChannelLimitTable",
|
|
|
+ "adding indexes to table pduChannelLimitTable\n"));
|
|
|
+ netsnmp_table_set_add_indexes(table_set,
|
|
|
+ ASN_INTEGER, /* index: pduChannelLimitID */
|
|
|
+ 0);
|
|
|
+
|
|
|
+ DEBUGMSGTL(("initialize_table_pduChannelLimitTable",
|
|
|
+ "adding column types to table pduChannelLimitTable\n"));
|
|
|
+ netsnmp_table_set_multi_add_default_row(table_set,
|
|
|
+ COLUMN_PDUCHANNELLIMITID, ASN_INTEGER, 0,
|
|
|
+ NULL, 0,
|
|
|
+ COLUMN_PDUCHANNELLIMITNAME, ASN_OCTET_STR, 1,
|
|
|
+ NULL, 0,
|
|
|
+ COLUMN_PDUCHANNELCURRENTLIMITUP, ASN_OCTET_STR, 1,
|
|
|
+ NULL, 0,
|
|
|
+ COLUMN_PDUCHANNELVOLTAGELIMITUP, ASN_OCTET_STR, 1,
|
|
|
+ NULL, 0,
|
|
|
+ COLUMN_PDUCHANNELVOLTAGELIMITDOWN, ASN_OCTET_STR, 1,
|
|
|
+ NULL, 0,
|
|
|
+ COLUMN_PDUCHANNELPOWERLIMITUP, ASN_OCTET_STR, 1,
|
|
|
+ NULL, 0,
|
|
|
+ COLUMN_PDUCHANNELCONSUMPTIONLIMITUP, ASN_OCTET_STR, 1,
|
|
|
+ NULL, 0,
|
|
|
+ 0);
|
|
|
+
|
|
|
+ /* registering the table with the master agent */
|
|
|
+ /* note: if you don't need a subhandler to deal with any aspects
|
|
|
+ of the request, change pduChannelLimitTable_handler to "NULL" */
|
|
|
+ netsnmp_register_table_data_set(netsnmp_create_handler_registration("pduChannelLimitTable", pduChannelLimitTable_handler,
|
|
|
+ pduChannelLimitTable_oid,
|
|
|
+ OID_LENGTH(pduChannelLimitTable_oid),
|
|
|
+ HANDLER_CAN_RWRITE),
|
|
|
+ table_set, NULL);
|
|
|
+}
|
|
|
+/** Initialize the pduSensorLimitTable table by defining its contents and how it's structured */
|
|
|
+void
|
|
|
+initialize_table_pduSensorLimitTable(void)
|
|
|
+{
|
|
|
+ const oid pduSensorLimitTable_oid[] = {1,3,6,1,4,1,2024,1,7,3,1};
|
|
|
+ netsnmp_table_data_set *table_set;
|
|
|
+
|
|
|
+ /* create the table structure itself */
|
|
|
+ table_set = netsnmp_create_table_data_set("pduSensorLimitTable");
|
|
|
+
|
|
|
+ /* comment this out or delete if you don't support creation of new rows */
|
|
|
+ table_set->allow_creation = 1;
|
|
|
+
|
|
|
+ /***************************************************
|
|
|
+ * Adding indexes
|
|
|
+ */
|
|
|
+ DEBUGMSGTL(("initialize_table_pduSensorLimitTable",
|
|
|
+ "adding indexes to table pduSensorLimitTable\n"));
|
|
|
+ netsnmp_table_set_add_indexes(table_set,
|
|
|
+ ASN_INTEGER, /* index: pduSensorLimitID */
|
|
|
+ 0);
|
|
|
+
|
|
|
+ DEBUGMSGTL(("initialize_table_pduSensorLimitTable",
|
|
|
+ "adding column types to table pduSensorLimitTable\n"));
|
|
|
+ netsnmp_table_set_multi_add_default_row(table_set,
|
|
|
+ COLUMN_PDUSENSORLIMITID, ASN_INTEGER, 1,
|
|
|
+ NULL, 0,
|
|
|
+ COLUMN_PDUSENSORLIMITNAME, ASN_OCTET_STR, 1,
|
|
|
+ NULL, 0,
|
|
|
+ COLUMN_PDUSENSORLIMITVALUE1, ASN_INTEGER, 1,
|
|
|
+ NULL, 0,
|
|
|
+ COLUMN_PDUSENSORLIMITVALUE2, ASN_INTEGER, 1,
|
|
|
+ NULL, 0,
|
|
|
+ 0);
|
|
|
+
|
|
|
+ /* registering the table with the master agent */
|
|
|
+ /* note: if you don't need a subhandler to deal with any aspects
|
|
|
+ of the request, change pduSensorLimitTable_handler to "NULL" */
|
|
|
+ netsnmp_register_table_data_set(netsnmp_create_handler_registration("pduSensorLimitTable", pduSensorLimitTable_handler,
|
|
|
+ pduSensorLimitTable_oid,
|
|
|
+ OID_LENGTH(pduSensorLimitTable_oid),
|
|
|
+ HANDLER_CAN_RWRITE),
|
|
|
+ table_set, NULL);
|
|
|
+}
|
|
|
+
|
|
|
+/** Initializes the pduMIB module */
|
|
|
+void
|
|
|
+init_pduMIB(void)
|
|
|
+{
|
|
|
+
|
|
|
+ /* here we initialize all the tables we're planning on supporting */
|
|
|
+ initialize_table_pduChannelTable();
|
|
|
+ initialize_table_pduGroupTable();
|
|
|
+ initialize_table_pduSensorTable();
|
|
|
+ initialize_table_pduSMTPRecMailTable();
|
|
|
+ initialize_table_pduMessageNumTable();
|
|
|
+ initialize_table_pduMQTTBrokerTable();
|
|
|
+ initialize_table_pduCloudServerTable();
|
|
|
+ initialize_table_pduAlarmHistoryTable();
|
|
|
+ initialize_table_pduChannelLimitTable();
|
|
|
+ initialize_table_pduSensorLimitTable();
|
|
|
+}
|
|
|
+
|
|
|
+/** handles requests for the pduChannelTable table, if anything else needs to be done */
|
|
|
+int
|
|
|
+pduChannelTable_handler(
|
|
|
+ netsnmp_mib_handler *handler,
|
|
|
+ netsnmp_handler_registration *reginfo,
|
|
|
+ netsnmp_agent_request_info *reqinfo,
|
|
|
+ netsnmp_request_info *requests) {
|
|
|
+ /* perform anything here that you need to do. The requests have
|
|
|
+ already been processed by the master table_dataset handler, but
|
|
|
+ this gives you chance to act on the request in some other way
|
|
|
+ if need be. */
|
|
|
+ return SNMP_ERR_NOERROR;
|
|
|
+}
|
|
|
+
|
|
|
+/** handles requests for the pduGroupTable table, if anything else needs to be done */
|
|
|
+int
|
|
|
+pduGroupTable_handler(
|
|
|
+ netsnmp_mib_handler *handler,
|
|
|
+ netsnmp_handler_registration *reginfo,
|
|
|
+ netsnmp_agent_request_info *reqinfo,
|
|
|
+ netsnmp_request_info *requests) {
|
|
|
+ /* perform anything here that you need to do. The requests have
|
|
|
+ already been processed by the master table_dataset handler, but
|
|
|
+ this gives you chance to act on the request in some other way
|
|
|
+ if need be. */
|
|
|
+ return SNMP_ERR_NOERROR;
|
|
|
+}
|
|
|
+
|
|
|
+/** handles requests for the pduSensorTable table, if anything else needs to be done */
|
|
|
+int
|
|
|
+pduSensorTable_handler(
|
|
|
+ netsnmp_mib_handler *handler,
|
|
|
+ netsnmp_handler_registration *reginfo,
|
|
|
+ netsnmp_agent_request_info *reqinfo,
|
|
|
+ netsnmp_request_info *requests) {
|
|
|
+ /* perform anything here that you need to do. The requests have
|
|
|
+ already been processed by the master table_dataset handler, but
|
|
|
+ this gives you chance to act on the request in some other way
|
|
|
+ if need be. */
|
|
|
+ return SNMP_ERR_NOERROR;
|
|
|
+}
|
|
|
+
|
|
|
+/** handles requests for the pduSMTPRecMailTable table, if anything else needs to be done */
|
|
|
+int
|
|
|
+pduSMTPRecMailTable_handler(
|
|
|
+ netsnmp_mib_handler *handler,
|
|
|
+ netsnmp_handler_registration *reginfo,
|
|
|
+ netsnmp_agent_request_info *reqinfo,
|
|
|
+ netsnmp_request_info *requests) {
|
|
|
+ /* perform anything here that you need to do. The requests have
|
|
|
+ already been processed by the master table_dataset handler, but
|
|
|
+ this gives you chance to act on the request in some other way
|
|
|
+ if need be. */
|
|
|
+ return SNMP_ERR_NOERROR;
|
|
|
+}
|
|
|
+
|
|
|
+/** handles requests for the pduMessageNumTable table, if anything else needs to be done */
|
|
|
+int
|
|
|
+pduMessageNumTable_handler(
|
|
|
+ netsnmp_mib_handler *handler,
|
|
|
+ netsnmp_handler_registration *reginfo,
|
|
|
+ netsnmp_agent_request_info *reqinfo,
|
|
|
+ netsnmp_request_info *requests) {
|
|
|
+ /* perform anything here that you need to do. The requests have
|
|
|
+ already been processed by the master table_dataset handler, but
|
|
|
+ this gives you chance to act on the request in some other way
|
|
|
+ if need be. */
|
|
|
+ return SNMP_ERR_NOERROR;
|
|
|
+}
|
|
|
+
|
|
|
+/** handles requests for the pduMQTTBrokerTable table, if anything else needs to be done */
|
|
|
+int
|
|
|
+pduMQTTBrokerTable_handler(
|
|
|
+ netsnmp_mib_handler *handler,
|
|
|
+ netsnmp_handler_registration *reginfo,
|
|
|
+ netsnmp_agent_request_info *reqinfo,
|
|
|
+ netsnmp_request_info *requests) {
|
|
|
+ /* perform anything here that you need to do. The requests have
|
|
|
+ already been processed by the master table_dataset handler, but
|
|
|
+ this gives you chance to act on the request in some other way
|
|
|
+ if need be. */
|
|
|
+ return SNMP_ERR_NOERROR;
|
|
|
+}
|
|
|
+
|
|
|
+/** handles requests for the pduCloudServerTable table, if anything else needs to be done */
|
|
|
+int
|
|
|
+pduCloudServerTable_handler(
|
|
|
+ netsnmp_mib_handler *handler,
|
|
|
+ netsnmp_handler_registration *reginfo,
|
|
|
+ netsnmp_agent_request_info *reqinfo,
|
|
|
+ netsnmp_request_info *requests) {
|
|
|
+ /* perform anything here that you need to do. The requests have
|
|
|
+ already been processed by the master table_dataset handler, but
|
|
|
+ this gives you chance to act on the request in some other way
|
|
|
+ if need be. */
|
|
|
+ return SNMP_ERR_NOERROR;
|
|
|
+}
|
|
|
+
|
|
|
+/** handles requests for the pduAlarmHistoryTable table, if anything else needs to be done */
|
|
|
+int
|
|
|
+pduAlarmHistoryTable_handler(
|
|
|
+ netsnmp_mib_handler *handler,
|
|
|
+ netsnmp_handler_registration *reginfo,
|
|
|
+ netsnmp_agent_request_info *reqinfo,
|
|
|
+ netsnmp_request_info *requests) {
|
|
|
+ /* perform anything here that you need to do. The requests have
|
|
|
+ already been processed by the master table_dataset handler, but
|
|
|
+ this gives you chance to act on the request in some other way
|
|
|
+ if need be. */
|
|
|
+ return SNMP_ERR_NOERROR;
|
|
|
+}
|
|
|
+
|
|
|
+/** handles requests for the pduChannelLimitTable table, if anything else needs to be done */
|
|
|
+int
|
|
|
+pduChannelLimitTable_handler(
|
|
|
+ netsnmp_mib_handler *handler,
|
|
|
+ netsnmp_handler_registration *reginfo,
|
|
|
+ netsnmp_agent_request_info *reqinfo,
|
|
|
+ netsnmp_request_info *requests) {
|
|
|
+ /* perform anything here that you need to do. The requests have
|
|
|
+ already been processed by the master table_dataset handler, but
|
|
|
+ this gives you chance to act on the request in some other way
|
|
|
+ if need be. */
|
|
|
+ return SNMP_ERR_NOERROR;
|
|
|
+}
|
|
|
+
|
|
|
+/** handles requests for the pduSensorLimitTable table, if anything else needs to be done */
|
|
|
+int
|
|
|
+pduSensorLimitTable_handler(
|
|
|
+ netsnmp_mib_handler *handler,
|
|
|
+ netsnmp_handler_registration *reginfo,
|
|
|
+ netsnmp_agent_request_info *reqinfo,
|
|
|
+ netsnmp_request_info *requests) {
|
|
|
+ /* perform anything here that you need to do. The requests have
|
|
|
+ already been processed by the master table_dataset handler, but
|
|
|
+ this gives you chance to act on the request in some other way
|
|
|
+ if need be. */
|
|
|
+ return SNMP_ERR_NOERROR;
|
|
|
+}
|