pduMIB_form.c 50 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069
  1. /*
  2. * Note: this file originally auto-generated by mib2c
  3. * using mib2c.create-dataset.conf
  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 "pduMIB_form.h"
  9. #include "switch_ctrl.h"
  10. #include "sqlite_handle.h"
  11. #include "common.h"
  12. /** Initialize the pduChannelTable table by defining its contents and how it's structured */
  13. void
  14. initialize_table_pduChannelTable(void)
  15. {
  16. const oid pduChannelTable_oid[] = {1,3,6,1,4,1,2024,1,3,9};
  17. netsnmp_table_data_set *table_set;
  18. /* create the table structure itself */
  19. table_set = netsnmp_create_table_data_set("pduChannelTable");
  20. /* comment this out or delete if you don't support creation of new rows */
  21. table_set->allow_creation = 1;
  22. /***************************************************
  23. * Adding indexes
  24. */
  25. DEBUGMSGTL(("initialize_table_pduChannelTable",
  26. "adding indexes to table pduChannelTable\n"));
  27. netsnmp_table_set_add_indexes(table_set,
  28. ASN_INTEGER, /* index: pduChannelID */
  29. 0);
  30. DEBUGMSGTL(("initialize_table_pduChannelTable",
  31. "adding column types to table pduChannelTable\n"));
  32. netsnmp_table_set_multi_add_default_row(table_set,
  33. COLUMN_PDUCHANNELID, ASN_INTEGER, 0,
  34. NULL, 0,
  35. COLUMN_PDUCHANNELNAME, ASN_OCTET_STR, 0,
  36. NULL, 0,
  37. COLUMN_PDUCHANNELSTATUS, ASN_INTEGER, 1,
  38. NULL, 0,
  39. COLUMN_PDUCHANNELVOLTAGE, ASN_OCTET_STR, 0,
  40. NULL, 0,
  41. COLUMN_PDUCHANNELCURRENT, ASN_OCTET_STR, 0,
  42. NULL, 0,
  43. COLUMN_PDUCHANNELFREQUENCY, ASN_INTEGER, 0,
  44. NULL, 0,
  45. COLUMN_PDUCHANNELCONSUMPTION, ASN_OCTET_STR, 0,
  46. NULL, 0,
  47. COLUMN_PDUCHANNELPOWERFACTOR, ASN_OCTET_STR, 0,
  48. NULL, 0,
  49. COLUMN_PDUCHANNELPACTIVEPOWER, ASN_OCTET_STR, 0,
  50. NULL, 0,
  51. COLUMN_PDUCHANNELREACTIVEPOWER, ASN_OCTET_STR, 0,
  52. NULL, 0,
  53. COLUMN_PDUCHANNELAPPARENTPOWER, ASN_OCTET_STR, 0,
  54. NULL, 0,
  55. 0);
  56. /* registering the table with the master agent */
  57. /* note: if you don't need a subhandler to deal with any aspects
  58. of the request, change pduChannelTable_handler to "NULL" */
  59. netsnmp_register_table_data_set(netsnmp_create_handler_registration("pduChannelTable", pduChannelTable_handler,
  60. pduChannelTable_oid,
  61. OID_LENGTH(pduChannelTable_oid),
  62. HANDLER_CAN_RWRITE),
  63. table_set, NULL);
  64. }
  65. /** Initialize the pduGroupTable table by defining its contents and how it's structured */
  66. void
  67. initialize_table_pduGroupTable(void)
  68. {
  69. const oid pduGroupTable_oid[] = {1,3,6,1,4,1,2024,1,3,10};
  70. netsnmp_table_data_set *table_set;
  71. /* create the table structure itself */
  72. table_set = netsnmp_create_table_data_set("pduGroupTable");
  73. /* comment this out or delete if you don't support creation of new rows */
  74. table_set->allow_creation = 1;
  75. /***************************************************
  76. * Adding indexes
  77. */
  78. DEBUGMSGTL(("initialize_table_pduGroupTable",
  79. "adding indexes to table pduGroupTable\n"));
  80. netsnmp_table_set_add_indexes(table_set,
  81. ASN_INTEGER, /* index: pduGroupID */
  82. 0);
  83. DEBUGMSGTL(("initialize_table_pduGroupTable",
  84. "adding column types to table pduGroupTable\n"));
  85. netsnmp_table_set_multi_add_default_row(table_set,
  86. COLUMN_PDUGROUPID, ASN_INTEGER, 0,
  87. NULL, 0,
  88. COLUMN_PDUGROUPNAME, ASN_OCTET_STR, 1,
  89. NULL, 0,
  90. COLUMN_PDUGROUPLIST, ASN_OCTET_STR, 1,
  91. NULL, 0,
  92. COLUMN_PDUGROUPSTATUS, ASN_INTEGER, 1,
  93. NULL, 0,
  94. 0);
  95. /* registering the table with the master agent */
  96. /* note: if you don't need a subhandler to deal with any aspects
  97. of the request, change pduGroupTable_handler to "NULL" */
  98. netsnmp_register_table_data_set(netsnmp_create_handler_registration("pduGroupTable", pduGroupTable_handler,
  99. pduGroupTable_oid,
  100. OID_LENGTH(pduGroupTable_oid),
  101. HANDLER_CAN_RWRITE),
  102. table_set, NULL);
  103. }
  104. /** Initialize the pduSensorTable table by defining its contents and how it's structured */
  105. void
  106. initialize_table_pduSensorTable(void)
  107. {
  108. const oid pduSensorTable_oid[] = {1,3,6,1,4,1,2024,1,4,1};
  109. netsnmp_table_data_set *table_set;
  110. /* create the table structure itself */
  111. table_set = netsnmp_create_table_data_set("pduSensorTable");
  112. /* comment this out or delete if you don't support creation of new rows */
  113. table_set->allow_creation = 1;
  114. /***************************************************
  115. * Adding indexes
  116. */
  117. DEBUGMSGTL(("initialize_table_pduSensorTable",
  118. "adding indexes to table pduSensorTable\n"));
  119. netsnmp_table_set_add_indexes(table_set,
  120. ASN_INTEGER, /* index: pduSensorID */
  121. 0);
  122. DEBUGMSGTL(("initialize_table_pduSensorTable",
  123. "adding column types to table pduSensorTable\n"));
  124. netsnmp_table_set_multi_add_default_row(table_set,
  125. COLUMN_PDUSENSORID, ASN_INTEGER, 0,
  126. NULL, 0,
  127. COLUMN_PDUSENSORNAME, ASN_OCTET_STR, 0,
  128. NULL, 0,
  129. COLUMN_PDUSENSORTYPE, ASN_INTEGER, 0,
  130. NULL, 0,
  131. COLUMN_PDUSENSORDATACHENNEL, ASN_OCTET_STR, 0,
  132. NULL, 0,
  133. COLUMN_PDUSENSORMODBUSADDRESS, ASN_INTEGER, 0,
  134. NULL, 0,
  135. COLUMN_PDUSENSORSTATUS, ASN_INTEGER, 1,
  136. NULL, 0,
  137. COLUMN_PDUSENSORVALUENUM, ASN_INTEGER, 0,
  138. NULL, 0,
  139. COLUMN_PDUSENSORVALUE1, ASN_INTEGER, 0,
  140. NULL, 0,
  141. COLUMN_PDUSENSORVALUE2, ASN_INTEGER, 0,
  142. NULL, 0,
  143. 0);
  144. /* registering the table with the master agent */
  145. /* note: if you don't need a subhandler to deal with any aspects
  146. of the request, change pduSensorTable_handler to "NULL" */
  147. netsnmp_register_table_data_set(netsnmp_create_handler_registration("pduSensorTable", pduSensorTable_handler,
  148. pduSensorTable_oid,
  149. OID_LENGTH(pduSensorTable_oid),
  150. HANDLER_CAN_RWRITE),
  151. table_set, NULL);
  152. }
  153. /** Initialize the pduSMTPRecMailTable table by defining its contents and how it's structured */
  154. void
  155. initialize_table_pduSMTPRecMailTable(void)
  156. {
  157. const oid pduSMTPRecMailTable_oid[] = {1,3,6,1,4,1,2024,1,5,3,4};
  158. netsnmp_table_data_set *table_set;
  159. /* create the table structure itself */
  160. table_set = netsnmp_create_table_data_set("pduSMTPRecMailTable");
  161. /* comment this out or delete if you don't support creation of new rows */
  162. table_set->allow_creation = 1;
  163. /***************************************************
  164. * Adding indexes
  165. */
  166. DEBUGMSGTL(("initialize_table_pduSMTPRecMailTable",
  167. "adding indexes to table pduSMTPRecMailTable\n"));
  168. netsnmp_table_set_add_indexes(table_set,
  169. ASN_OCTET_STR, /* index: pduSMTPRecMail */
  170. 0);
  171. DEBUGMSGTL(("initialize_table_pduSMTPRecMailTable",
  172. "adding column types to table pduSMTPRecMailTable\n"));
  173. netsnmp_table_set_multi_add_default_row(table_set,
  174. COLUMN_PDUSMTPRECMAIL, ASN_OCTET_STR, 1,
  175. NULL, 0,
  176. 0);
  177. /* registering the table with the master agent */
  178. /* note: if you don't need a subhandler to deal with any aspects
  179. of the request, change pduSMTPRecMailTable_handler to "NULL" */
  180. netsnmp_register_table_data_set(netsnmp_create_handler_registration("pduSMTPRecMailTable", pduSMTPRecMailTable_handler,
  181. pduSMTPRecMailTable_oid,
  182. OID_LENGTH(pduSMTPRecMailTable_oid),
  183. HANDLER_CAN_RWRITE),
  184. table_set, NULL);
  185. }
  186. /** Initialize the pduMessageNumTable table by defining its contents and how it's structured */
  187. void
  188. initialize_table_pduMessageNumTable(void)
  189. {
  190. const oid pduMessageNumTable_oid[] = {1,3,6,1,4,1,2024,1,5,5,2};
  191. netsnmp_table_data_set *table_set;
  192. /* create the table structure itself */
  193. table_set = netsnmp_create_table_data_set("pduMessageNumTable");
  194. /* comment this out or delete if you don't support creation of new rows */
  195. table_set->allow_creation = 1;
  196. /***************************************************
  197. * Adding indexes
  198. */
  199. DEBUGMSGTL(("initialize_table_pduMessageNumTable",
  200. "adding indexes to table pduMessageNumTable\n"));
  201. netsnmp_table_set_add_indexes(table_set,
  202. ASN_OCTET_STR, /* index: pduMessageRecNum */
  203. 0);
  204. DEBUGMSGTL(("initialize_table_pduMessageNumTable",
  205. "adding column types to table pduMessageNumTable\n"));
  206. netsnmp_table_set_multi_add_default_row(table_set,
  207. COLUMN_PDUMESSAGERECNUM, ASN_OCTET_STR, 1,
  208. NULL, 0,
  209. 0);
  210. /* registering the table with the master agent */
  211. /* note: if you don't need a subhandler to deal with any aspects
  212. of the request, change pduMessageNumTable_handler to "NULL" */
  213. netsnmp_register_table_data_set(netsnmp_create_handler_registration("pduMessageNumTable", pduMessageNumTable_handler,
  214. pduMessageNumTable_oid,
  215. OID_LENGTH(pduMessageNumTable_oid),
  216. HANDLER_CAN_RWRITE),
  217. table_set, NULL);
  218. }
  219. /** Initialize the pduMQTTBrokerTable table by defining its contents and how it's structured */
  220. void
  221. initialize_table_pduMQTTBrokerTable(void)
  222. {
  223. const oid pduMQTTBrokerTable_oid[] = {1,3,6,1,4,1,2024,1,5,6,3};
  224. netsnmp_table_data_set *table_set;
  225. /* create the table structure itself */
  226. table_set = netsnmp_create_table_data_set("pduMQTTBrokerTable");
  227. /* comment this out or delete if you don't support creation of new rows */
  228. table_set->allow_creation = 1;
  229. /***************************************************
  230. * Adding indexes
  231. */
  232. DEBUGMSGTL(("initialize_table_pduMQTTBrokerTable",
  233. "adding indexes to table pduMQTTBrokerTable\n"));
  234. netsnmp_table_set_add_indexes(table_set,
  235. ASN_OCTET_STR, /* index: pduMQTTBrokerName */
  236. 0);
  237. DEBUGMSGTL(("initialize_table_pduMQTTBrokerTable",
  238. "adding column types to table pduMQTTBrokerTable\n"));
  239. netsnmp_table_set_multi_add_default_row(table_set,
  240. COLUMN_PDUMQTTBROKERNAME, ASN_OCTET_STR, 1,
  241. NULL, 0,
  242. COLUMN_PDUMQTTBROKERENABLE, ASN_INTEGER, 1,
  243. NULL, 0,
  244. COLUMN_PDUMQTTBROKERIPORDOMAIN, ASN_OCTET_STR, 1,
  245. NULL, 0,
  246. COLUMN_PDUMQTTBROKERPORT, ASN_INTEGER, 1,
  247. NULL, 0,
  248. COLUMN_PDUMQTTBROKERUSERNAME, ASN_OCTET_STR, 1,
  249. NULL, 0,
  250. COLUMN_PDUMQTTBROKERUSERPW, ASN_OCTET_STR, 1,
  251. NULL, 0,
  252. 0);
  253. /* registering the table with the master agent */
  254. /* note: if you don't need a subhandler to deal with any aspects
  255. of the request, change pduMQTTBrokerTable_handler to "NULL" */
  256. netsnmp_register_table_data_set(netsnmp_create_handler_registration("pduMQTTBrokerTable", pduMQTTBrokerTable_handler,
  257. pduMQTTBrokerTable_oid,
  258. OID_LENGTH(pduMQTTBrokerTable_oid),
  259. HANDLER_CAN_RWRITE),
  260. table_set, NULL);
  261. }
  262. /** Initialize the pduCloudServerTable table by defining its contents and how it's structured */
  263. void
  264. initialize_table_pduCloudServerTable(void)
  265. {
  266. const oid pduCloudServerTable_oid[] = {1,3,6,1,4,1,2024,1,5,7,3};
  267. netsnmp_table_data_set *table_set;
  268. /* create the table structure itself */
  269. table_set = netsnmp_create_table_data_set("pduCloudServerTable");
  270. /* comment this out or delete if you don't support creation of new rows */
  271. table_set->allow_creation = 1;
  272. /***************************************************
  273. * Adding indexes
  274. */
  275. DEBUGMSGTL(("initialize_table_pduCloudServerTable",
  276. "adding indexes to table pduCloudServerTable\n"));
  277. netsnmp_table_set_add_indexes(table_set,
  278. ASN_OCTET_STR, /* index: pduCloudServerName */
  279. 0);
  280. DEBUGMSGTL(("initialize_table_pduCloudServerTable",
  281. "adding column types to table pduCloudServerTable\n"));
  282. netsnmp_table_set_multi_add_default_row(table_set,
  283. COLUMN_PDUCLOUDSERVERNAME, ASN_OCTET_STR, 1,
  284. NULL, 0,
  285. COLUMN_PDUCLOUDSERVERENABLE, ASN_INTEGER, 1,
  286. NULL, 0,
  287. COLUMN_PDUCLOUDSERVERIPORDOMAIN, ASN_OCTET_STR, 1,
  288. NULL, 0,
  289. COLUMN_PDUCLOUDSERVERPORT, ASN_INTEGER, 1,
  290. NULL, 0,
  291. COLUMN_PDUCLOUDSERVERUSERNAME, ASN_OCTET_STR, 1,
  292. NULL, 0,
  293. COLUMN_PDUCLOUDSERVERUSERPW, ASN_OCTET_STR, 1,
  294. NULL, 0,
  295. 0);
  296. /* registering the table with the master agent */
  297. /* note: if you don't need a subhandler to deal with any aspects
  298. of the request, change pduCloudServerTable_handler to "NULL" */
  299. netsnmp_register_table_data_set(netsnmp_create_handler_registration("pduCloudServerTable", pduCloudServerTable_handler,
  300. pduCloudServerTable_oid,
  301. OID_LENGTH(pduCloudServerTable_oid),
  302. HANDLER_CAN_RWRITE),
  303. table_set, NULL);
  304. }
  305. /** Initialize the pduAlarmHistoryTable table by defining its contents and how it's structured */
  306. void
  307. initialize_table_pduAlarmHistoryTable(void)
  308. {
  309. const oid pduAlarmHistoryTable_oid[] = {1,3,6,1,4,1,2024,1,6,1};
  310. netsnmp_table_data_set *table_set;
  311. /* create the table structure itself */
  312. table_set = netsnmp_create_table_data_set("pduAlarmHistoryTable");
  313. /* comment this out or delete if you don't support creation of new rows */
  314. table_set->allow_creation = 1;
  315. /***************************************************
  316. * Adding indexes
  317. */
  318. DEBUGMSGTL(("initialize_table_pduAlarmHistoryTable",
  319. "adding indexes to table pduAlarmHistoryTable\n"));
  320. netsnmp_table_set_add_indexes(table_set,
  321. ASN_INTEGER, /* index: pduAlarmID */
  322. 0);
  323. DEBUGMSGTL(("initialize_table_pduAlarmHistoryTable",
  324. "adding column types to table pduAlarmHistoryTable\n"));
  325. netsnmp_table_set_multi_add_default_row(table_set,
  326. COLUMN_PDUALARMID, ASN_INTEGER, 0,
  327. NULL, 0,
  328. COLUMN_PDUALARMTYPE, ASN_INTEGER, 0,
  329. NULL, 0,
  330. COLUMN_PDUALARMCONTEXT, ASN_OCTET_STR, 0,
  331. NULL, 0,
  332. COLUMN_PDUALARMACTION, ASN_INTEGER, 0,
  333. NULL, 0,
  334. COLUMN_PDUALARMACTIONPARA, ASN_INTEGER, 0,
  335. NULL, 0,
  336. COLUMN_PDUALARMDATE, ASN_OCTET_STR, 0,
  337. NULL, 0,
  338. COLUMN_PDUALARMTIME, ASN_OCTET_STR, 0,
  339. NULL, 0,
  340. 0);
  341. /* registering the table with the master agent */
  342. /* note: if you don't need a subhandler to deal with any aspects
  343. of the request, change pduAlarmHistoryTable_handler to "NULL" */
  344. netsnmp_register_table_data_set(netsnmp_create_handler_registration("pduAlarmHistoryTable", pduAlarmHistoryTable_handler,
  345. pduAlarmHistoryTable_oid,
  346. OID_LENGTH(pduAlarmHistoryTable_oid),
  347. HANDLER_CAN_RWRITE),
  348. table_set, NULL);
  349. }
  350. /** Initialize the pduChannelLimitTable table by defining its contents and how it's structured */
  351. void
  352. initialize_table_pduChannelLimitTable(void)
  353. {
  354. const oid pduChannelLimitTable_oid[] = {1,3,6,1,4,1,2024,1,7,2,6};
  355. netsnmp_table_data_set *table_set;
  356. /* create the table structure itself */
  357. table_set = netsnmp_create_table_data_set("pduChannelLimitTable");
  358. /* comment this out or delete if you don't support creation of new rows */
  359. table_set->allow_creation = 1;
  360. /***************************************************
  361. * Adding indexes
  362. */
  363. DEBUGMSGTL(("initialize_table_pduChannelLimitTable",
  364. "adding indexes to table pduChannelLimitTable\n"));
  365. netsnmp_table_set_add_indexes(table_set,
  366. ASN_INTEGER, /* index: pduChannelLimitID */
  367. 0);
  368. DEBUGMSGTL(("initialize_table_pduChannelLimitTable",
  369. "adding column types to table pduChannelLimitTable\n"));
  370. netsnmp_table_set_multi_add_default_row(table_set,
  371. COLUMN_PDUCHANNELLIMITID, ASN_INTEGER, 0,
  372. NULL, 0,
  373. COLUMN_PDUCHANNELLIMITNAME, ASN_OCTET_STR, 1,
  374. NULL, 0,
  375. COLUMN_PDUCHANNELCURRENTLIMITUP, ASN_OCTET_STR, 1,
  376. NULL, 0,
  377. COLUMN_PDUCHANNELVOLTAGELIMITUP, ASN_OCTET_STR, 1,
  378. NULL, 0,
  379. COLUMN_PDUCHANNELVOLTAGELIMITDOWN, ASN_OCTET_STR, 1,
  380. NULL, 0,
  381. COLUMN_PDUCHANNELPOWERLIMITUP, ASN_OCTET_STR, 1,
  382. NULL, 0,
  383. COLUMN_PDUCHANNELCONSUMPTIONLIMITUP, ASN_OCTET_STR, 1,
  384. NULL, 0,
  385. 0);
  386. /* registering the table with the master agent */
  387. /* note: if you don't need a subhandler to deal with any aspects
  388. of the request, change pduChannelLimitTable_handler to "NULL" */
  389. netsnmp_register_table_data_set(netsnmp_create_handler_registration("pduChannelLimitTable", pduChannelLimitTable_handler,
  390. pduChannelLimitTable_oid,
  391. OID_LENGTH(pduChannelLimitTable_oid),
  392. HANDLER_CAN_RWRITE),
  393. table_set, NULL);
  394. }
  395. /** Initialize the pduSensorLimitTable table by defining its contents and how it's structured */
  396. void
  397. initialize_table_pduSensorLimitTable(void)
  398. {
  399. const oid pduSensorLimitTable_oid[] = {1,3,6,1,4,1,2024,1,7,3,1};
  400. netsnmp_table_data_set *table_set;
  401. /* create the table structure itself */
  402. table_set = netsnmp_create_table_data_set("pduSensorLimitTable");
  403. /* comment this out or delete if you don't support creation of new rows */
  404. table_set->allow_creation = 1;
  405. /***************************************************
  406. * Adding indexes
  407. */
  408. DEBUGMSGTL(("initialize_table_pduSensorLimitTable",
  409. "adding indexes to table pduSensorLimitTable\n"));
  410. netsnmp_table_set_add_indexes(table_set,
  411. ASN_INTEGER, /* index: pduSensorLimitID */
  412. 0);
  413. DEBUGMSGTL(("initialize_table_pduSensorLimitTable",
  414. "adding column types to table pduSensorLimitTable\n"));
  415. netsnmp_table_set_multi_add_default_row(table_set,
  416. COLUMN_PDUSENSORLIMITID, ASN_INTEGER, 1,
  417. NULL, 0,
  418. COLUMN_PDUSENSORLIMITNAME, ASN_OCTET_STR, 1,
  419. NULL, 0,
  420. COLUMN_PDUSENSORLIMITVALUE1, ASN_INTEGER, 1,
  421. NULL, 0,
  422. COLUMN_PDUSENSORLIMITVALUE2, ASN_INTEGER, 1,
  423. NULL, 0,
  424. 0);
  425. /* registering the table with the master agent */
  426. /* note: if you don't need a subhandler to deal with any aspects
  427. of the request, change pduSensorLimitTable_handler to "NULL" */
  428. netsnmp_register_table_data_set(netsnmp_create_handler_registration("pduSensorLimitTable", pduSensorLimitTable_handler,
  429. pduSensorLimitTable_oid,
  430. OID_LENGTH(pduSensorLimitTable_oid),
  431. HANDLER_CAN_RWRITE),
  432. table_set, NULL);
  433. }
  434. /** Initializes the pduMIB module */
  435. void
  436. init_pduMIB_form(void)
  437. {
  438. /* here we initialize all the tables we're planning on supporting */
  439. initialize_table_pduChannelTable();
  440. initialize_table_pduGroupTable();
  441. initialize_table_pduSensorTable();
  442. initialize_table_pduSMTPRecMailTable();
  443. initialize_table_pduMessageNumTable();
  444. initialize_table_pduMQTTBrokerTable();
  445. initialize_table_pduCloudServerTable();
  446. initialize_table_pduAlarmHistoryTable();
  447. initialize_table_pduChannelLimitTable();
  448. initialize_table_pduSensorLimitTable();
  449. }
  450. /** handles requests for the pduChannelTable table, if anything else needs to be done */
  451. int
  452. pduChannelTable_handler(
  453. netsnmp_mib_handler *handler,
  454. netsnmp_handler_registration *reginfo,
  455. netsnmp_agent_request_info *reqinfo,
  456. netsnmp_request_info *requests) {
  457. /* perform anything here that you need to do. The requests have
  458. already been processed by the master table_dataset handler, but
  459. this gives you chance to act on the request in some other way
  460. if need be. */
  461. netsnmp_request_info *request;
  462. netsnmp_table_request_info *table_info;
  463. GlobalPowerManger* iterator;
  464. //GlobalPowerInfo powerInfo;
  465. char buffer[16];
  466. switch(reqinfo->mode)
  467. {
  468. case MODE_GET:
  469. for (request = requests; request; request = request->next)
  470. {
  471. table_info = netsnmp_extract_table_info(request);
  472. int nIndex=1;
  473. list_for_each_entry(iterator, &__globalDeviceManage._globalPowerManger.list, list)
  474. {
  475. //查询数据库总电源信息 传给所申请的参数结构体
  476. //if(dev_search_power_trend_info(__globalDeviceManage.db,iterator->product_id,0,iterator)!=0)
  477. //{
  478. // log_e("search total power consumption err at pduChannelTable_handler from db.");
  479. //}
  480. //传值给总管理结构体
  481. // for(int i=0;i< TOTAL_COUNT;i++)
  482. // {
  483. // strcpy(_over_all_pwr_back_info._Power_Trend_Info.xAxis[i],__PowerTrendInfo._power_trend_info.xAxis[i]);
  484. // _over_all_pwr_back_info._Power_Trend_Info.ydata[POWER_MERITORIOUS_TYPE][i] = __PowerTrendInfo._power_trend_info.ydata[POWER_MERITORIOUS_TYPE][i];
  485. // _over_all_pwr_back_info._Power_Trend_Info.ydata[POWER_REACTIVE_TYPE][i] = __PowerTrendInfo._power_trend_info.ydata[POWER_REACTIVE_TYPE][i];
  486. // _over_all_pwr_back_info._Power_Trend_Info.ydata[POWER_APPARENT_TYPE][i] = __PowerTrendInfo._power_trend_info.ydata[POWER_APPARENT_TYPE][i];
  487. // }
  488. //if(dev_search_latest_power_info(__globalDeviceManage.db,__globalDeviceManage._globalDevInfo.product_id,iterator->product_ch_id,&powerInfo)!=0)
  489. //{
  490. // log_e("search total pwr err at pduChannelTable_handler from db.");
  491. //}
  492. //else
  493. //{
  494. if (nIndex<table_info->index_oid[0])
  495. {
  496. nIndex++;
  497. continue;
  498. }
  499. memset(buffer,0,sizeof(buffer));
  500. switch (table_info->colnum)
  501. {
  502. case COLUMN_PDUCHANNELID:
  503. if (!iterator)
  504. {
  505. netsnmp_set_request_error(reqinfo, request, SNMP_NOSUCHINSTANCE);
  506. continue;
  507. }
  508. snmp_set_var_typed_integer(request->requestvb, ASN_INTEGER, iterator->product_ch_id);
  509. break;
  510. case COLUMN_PDUCHANNELNAME:
  511. if (!iterator)
  512. {
  513. netsnmp_set_request_error(reqinfo, request, SNMP_NOSUCHINSTANCE);
  514. continue;
  515. }
  516. snmp_set_var_typed_value(request->requestvb, ASN_OCTET_STR, iterator->product_ch_name, strlen(iterator->product_ch_name));
  517. break;
  518. case COLUMN_PDUCHANNELSTATUS:
  519. if (!iterator)
  520. {
  521. netsnmp_set_request_error(reqinfo, request, SNMP_NOSUCHINSTANCE);
  522. continue;
  523. }
  524. snmp_set_var_typed_integer(request->requestvb, ASN_INTEGER, iterator->_PowerInfo.status);
  525. break;
  526. case COLUMN_PDUCHANNELVOLTAGE:
  527. if (!iterator)
  528. {
  529. netsnmp_set_request_error(reqinfo, request, SNMP_NOSUCHINSTANCE);
  530. continue;
  531. }
  532. sprintf(buffer,"%0.3f",iterator->_PowerInfo.voltage);
  533. snmp_set_var_typed_value(request->requestvb, ASN_OCTET_STR, buffer, strlen(buffer));
  534. break;
  535. case COLUMN_PDUCHANNELCURRENT:
  536. if (!iterator)
  537. {
  538. netsnmp_set_request_error(reqinfo, request, SNMP_NOSUCHINSTANCE);
  539. continue;
  540. }
  541. sprintf(buffer,"%0.3f",iterator->_PowerInfo.current);
  542. snmp_set_var_typed_value(request->requestvb, ASN_OCTET_STR, buffer, strlen(buffer));
  543. break;
  544. case COLUMN_PDUCHANNELFREQUENCY:
  545. if (!iterator)
  546. {
  547. netsnmp_set_request_error(reqinfo, request, SNMP_NOSUCHINSTANCE);
  548. continue;
  549. }
  550. sprintf(buffer,"%0.3f",iterator->_PowerInfo.freq);
  551. snmp_set_var_typed_value(request->requestvb, ASN_OCTET_STR, buffer, strlen(buffer));
  552. break;
  553. case COLUMN_PDUCHANNELCONSUMPTION:
  554. if (!iterator)
  555. {
  556. netsnmp_set_request_error(reqinfo, request, SNMP_NOSUCHINSTANCE);
  557. continue;
  558. }
  559. sprintf(buffer,"%0.3f",iterator->_PowerInfo.consumption);
  560. snmp_set_var_typed_value(request->requestvb, ASN_OCTET_STR, buffer, strlen(buffer));
  561. break;
  562. case COLUMN_PDUCHANNELPOWERFACTOR:
  563. if (!iterator)
  564. {
  565. netsnmp_set_request_error(reqinfo, request, SNMP_NOSUCHINSTANCE);
  566. continue;
  567. }
  568. sprintf(buffer,"%0.3f",iterator->_PowerInfo.factor);
  569. snmp_set_var_typed_value(request->requestvb, ASN_OCTET_STR, buffer, strlen(buffer));
  570. break;
  571. case COLUMN_PDUCHANNELPACTIVEPOWER:
  572. if (!iterator)
  573. {
  574. netsnmp_set_request_error(reqinfo, request, SNMP_NOSUCHINSTANCE);
  575. continue;
  576. }
  577. sprintf(buffer,"%0.3f",iterator->_PowerInfo.power);
  578. snmp_set_var_typed_value(request->requestvb, ASN_OCTET_STR, buffer, strlen(buffer));
  579. break;
  580. case COLUMN_PDUCHANNELREACTIVEPOWER:
  581. if (!iterator)
  582. {
  583. netsnmp_set_request_error(reqinfo, request, SNMP_NOSUCHINSTANCE);
  584. continue;
  585. }
  586. if (iterator->_PowerInfo.factor>0&&iterator->_PowerInfo.factor<=1)
  587. {
  588. sprintf(buffer,"%0.3f",(iterator->_PowerInfo.power/iterator->_PowerInfo.factor)-iterator->_PowerInfo.power);
  589. }else{
  590. sprintf(buffer,"0");
  591. }
  592. snmp_set_var_typed_value(request->requestvb, ASN_OCTET_STR, buffer, strlen(buffer));
  593. break;
  594. case COLUMN_PDUCHANNELAPPARENTPOWER:
  595. if (!iterator)
  596. {
  597. netsnmp_set_request_error(reqinfo, request, SNMP_NOSUCHINSTANCE);
  598. continue;
  599. }
  600. if (iterator->_PowerInfo.factor>0)
  601. {
  602. sprintf(buffer,"%0.3f",iterator->_PowerInfo.power/iterator->_PowerInfo.factor);
  603. }else{
  604. sprintf(buffer,"0");
  605. }
  606. snmp_set_var_typed_value(request->requestvb, ASN_OCTET_STR, buffer, strlen(buffer));
  607. break;
  608. default:
  609. netsnmp_set_request_error(reqinfo, request, SNMP_NOSUCHOBJECT);
  610. break;
  611. }
  612. //}
  613. break;
  614. }
  615. }
  616. break;
  617. case MODE_SET_RESERVE1:
  618. break;
  619. case MODE_SET_RESERVE2:
  620. break;
  621. case MODE_SET_FREE:
  622. break;
  623. case MODE_SET_ACTION:
  624. break;
  625. case MODE_SET_UNDO:
  626. break;
  627. case MODE_SET_COMMIT:
  628. /* XXX: delete temporary storage */
  629. // if (/* XXX: error? */) {
  630. // /* try _really_really_ hard to never get to this point */
  631. // netsnmp_set_request_error(reqinfo, requests, SNMP_ERR_COMMITFAILED);
  632. // }
  633. for (request = requests; request; request = request->next)
  634. {
  635. table_info = netsnmp_extract_table_info(request);
  636. int nIndex = 1;
  637. list_for_each_entry(iterator, &__globalDeviceManage._globalPowerManger.list, list)
  638. {
  639. if (nIndex < table_info->index_oid[0])
  640. {
  641. nIndex++;
  642. continue;
  643. }
  644. memset(buffer, 0, sizeof(buffer));
  645. switch (table_info->colnum)
  646. {
  647. case COLUMN_PDUCHANNELSTATUS:
  648. if (!iterator)
  649. {
  650. netsnmp_set_request_error(reqinfo, request, SNMP_NOSUCHINSTANCE);
  651. continue;
  652. }
  653. int nCHOpertype = *request->requestvb->val.integer;
  654. if (nCHOpertype!= iterator->_PowerInfo.status)
  655. {
  656. log_d("SNMP Remote switch ctrl:%d", iterator->product_ch_id);
  657. g_switch_set_all_chn_ctrl(&__globalDeviceManage._globalRelaySampManger,
  658. iterator,
  659. iterator->product_saddr,
  660. iterator->product_ch_addr, // 多版端口余8
  661. nCHOpertype,false);
  662. }
  663. break;
  664. }
  665. break;
  666. }
  667. }
  668. break;
  669. default:
  670. /* we should never get here, so this is a really bad error */
  671. snmp_log(LOG_ERR, "unknown mode (%d) in handle_pduType\n", reqinfo->mode );
  672. return SNMP_ERR_GENERR;
  673. }
  674. return SNMP_ERR_NOERROR;
  675. }
  676. /** handles requests for the pduGroupTable table, if anything else needs to be done */
  677. int
  678. pduGroupTable_handler(
  679. netsnmp_mib_handler *handler,
  680. netsnmp_handler_registration *reginfo,
  681. netsnmp_agent_request_info *reqinfo,
  682. netsnmp_request_info *requests) {
  683. /* perform anything here that you need to do. The requests have
  684. already been processed by the master table_dataset handler, but
  685. this gives you chance to act on the request in some other way
  686. if need be. */
  687. netsnmp_request_info *request=NULL;
  688. netsnmp_table_request_info *table_info;
  689. GroupInfo *_GroupInfoTemp = NULL;
  690. GroupInfo group_list;
  691. INIT_LIST_HEAD(&group_list.list);
  692. if (0 != dev_get_group_info(__globalDeviceManage.db, &group_list))
  693. {
  694. netsnmp_set_request_error(reqinfo, request, SNMP_NOSUCHOBJECT);
  695. return SNMP_ERR_GENERR;
  696. }
  697. char buffer[16];
  698. switch (reqinfo->mode)
  699. {
  700. case MODE_GET:
  701. for (request = requests; request; request = request->next)
  702. {
  703. table_info = netsnmp_extract_table_info(request);
  704. int nIndex = 1;
  705. list_for_each_entry(_GroupInfoTemp, &group_list.list, list)
  706. {
  707. if (nIndex < table_info->index_oid[0])
  708. {
  709. nIndex++;
  710. continue;
  711. }
  712. memset(buffer, 0, sizeof(buffer));
  713. switch (table_info->colnum)
  714. {
  715. case COLUMN_PDUGROUPID:
  716. if (!_GroupInfoTemp)
  717. {
  718. netsnmp_set_request_error(reqinfo, request, SNMP_NOSUCHINSTANCE);
  719. continue;
  720. }
  721. snmp_set_var_typed_integer(request->requestvb, ASN_INTEGER, _GroupInfoTemp->GroupID);
  722. break;
  723. case COLUMN_PDUGROUPNAME:
  724. if (!_GroupInfoTemp)
  725. {
  726. netsnmp_set_request_error(reqinfo, request, SNMP_NOSUCHINSTANCE);
  727. continue;
  728. }
  729. snmp_set_var_typed_value(request->requestvb, ASN_OCTET_STR, _GroupInfoTemp->GroupName, strlen(_GroupInfoTemp->GroupName));
  730. break;
  731. case COLUMN_PDUGROUPLIST:
  732. if (!_GroupInfoTemp)
  733. {
  734. netsnmp_set_request_error(reqinfo, request, SNMP_NOSUCHINSTANCE);
  735. continue;
  736. }
  737. snmp_set_var_typed_value(request->requestvb, ASN_OCTET_STR, _GroupInfoTemp->GroupChList, strlen(_GroupInfoTemp->GroupChList));
  738. break;
  739. case COLUMN_PDUGROUPSTATUS:
  740. if (!_GroupInfoTemp)
  741. {
  742. netsnmp_set_request_error(reqinfo, request, SNMP_NOSUCHINSTANCE);
  743. continue;
  744. }
  745. //判断分组状态
  746. int nStatus = 0;
  747. char *pCHlist;
  748. char *pCHListSave;
  749. pCHlist = strtok_r(_GroupInfoTemp->GroupChList, ",", &pCHListSave);
  750. while(pCHlist!=NULL)
  751. {
  752. GlobalPowerManger *_globalPowerMangerTemp = NULL;
  753. list_for_each_entry(_globalPowerMangerTemp, &__globalDeviceManage._globalPowerManger.list, list)
  754. {
  755. if (_globalPowerMangerTemp == NULL)
  756. break;
  757. if (atoi(pCHlist) == _globalPowerMangerTemp->product_ch_id)
  758. {
  759. if (_globalPowerMangerTemp->_PowerInfo.status == 1)
  760. {
  761. nStatus = 1;
  762. break;
  763. }
  764. }
  765. }
  766. pCHlist = strtok_r(NULL, ",",&pCHListSave);
  767. }
  768. snmp_set_var_typed_integer(request->requestvb, ASN_INTEGER, nStatus);
  769. break;
  770. default:
  771. netsnmp_set_request_error(reqinfo, request, SNMP_NOSUCHOBJECT);
  772. break;
  773. }
  774. //}
  775. break;
  776. }
  777. }
  778. break;
  779. case MODE_SET_RESERVE1:
  780. break;
  781. case MODE_SET_RESERVE2:
  782. break;
  783. case MODE_SET_FREE:
  784. break;
  785. case MODE_SET_ACTION:
  786. break;
  787. case MODE_SET_UNDO:
  788. break;
  789. case MODE_SET_COMMIT:
  790. for (request = requests; request; request = request->next)
  791. {
  792. table_info = netsnmp_extract_table_info(request);
  793. int nIndex = 1;
  794. list_for_each_entry(_GroupInfoTemp, &group_list.list, list)
  795. {
  796. if (nIndex < table_info->index_oid[0])
  797. {
  798. nIndex++;
  799. continue;
  800. }
  801. memset(buffer, 0, sizeof(buffer));
  802. switch (table_info->colnum)
  803. {
  804. case COLUMN_PDUGROUPSTATUS:
  805. if (!_GroupInfoTemp)
  806. {
  807. netsnmp_set_request_error(reqinfo, request, SNMP_NOSUCHINSTANCE);
  808. continue;
  809. }
  810. bool nGroupOpertype = *request->requestvb->val.integer;
  811. char *pCHlist;
  812. char *pCHListSave;
  813. pCHlist = strtok_r(_GroupInfoTemp->GroupChList, ",", &pCHListSave);
  814. if (__globalDeviceManage._globalDevInfo.product_pwr_type == 1)
  815. {
  816. unsigned short pAddrCtrl[50];
  817. memset(pAddrCtrl, 0, sizeof(pAddrCtrl));
  818. int ret = 0;
  819. while(pCHlist!=NULL)
  820. {
  821. GlobalPowerManger *_globalPowerMangerTemp = NULL;
  822. list_for_each_entry(_globalPowerMangerTemp, &__globalDeviceManage._globalPowerManger.list, list)
  823. {
  824. if (_globalPowerMangerTemp == NULL)
  825. break;
  826. if (atoi(pCHlist) == _globalPowerMangerTemp->product_ch_id)
  827. {
  828. log_d("SNMP Group switch ctrl:%d", _globalPowerMangerTemp->product_ch_id);
  829. pAddrCtrl[(int)_globalPowerMangerTemp->product_saddr] |= 1 << (_globalPowerMangerTemp->product_ch_addr - 1);
  830. break;
  831. }
  832. }
  833. pCHlist = strtok_r(NULL, ",",&pCHListSave);
  834. }
  835. for (size_t i = 0; i < 50; i++)
  836. {
  837. if (pAddrCtrl[i] != 0)
  838. {
  839. ret = g_switch_set_dcpdu_chns_ctrl(&__globalDeviceManage._globalRelaySampManger,
  840. i,
  841. pAddrCtrl[i],
  842. nGroupOpertype);
  843. if (ret < 0)
  844. {
  845. ret = g_switch_set_dcpdu_chns_ctrl(&__globalDeviceManage._globalRelaySampManger,
  846. i,
  847. pAddrCtrl[i],
  848. nGroupOpertype);
  849. /* code */
  850. }
  851. }
  852. }
  853. }
  854. else
  855. {
  856. while(pCHlist!=NULL)
  857. {
  858. GlobalPowerManger *_globalPowerMangerTemp = NULL;
  859. list_for_each_entry(_globalPowerMangerTemp, &__globalDeviceManage._globalPowerManger.list, list)
  860. {
  861. if (_globalPowerMangerTemp == NULL)
  862. break;
  863. if (atoi(pCHlist) == _globalPowerMangerTemp->product_ch_id)
  864. {
  865. log_d("SNMP Group switch ctrl:%d", _globalPowerMangerTemp->product_ch_id);
  866. g_switch_set_all_chn_ctrl(&__globalDeviceManage._globalRelaySampManger,
  867. _globalPowerMangerTemp,
  868. _globalPowerMangerTemp->product_saddr,
  869. _globalPowerMangerTemp->product_ch_addr, // 多版端口余8
  870. nGroupOpertype,true);
  871. break;
  872. }
  873. }
  874. pCHlist = strtok_r(NULL, ",",&pCHListSave);
  875. }
  876. }
  877. }
  878. break;
  879. }
  880. }
  881. break;
  882. default:
  883. /* we should never get here, so this is a really bad error */
  884. snmp_log(LOG_ERR, "unknown mode (%d) in handle_pduType\n", reqinfo->mode);
  885. return SNMP_ERR_GENERR;
  886. }
  887. return SNMP_ERR_NOERROR;
  888. }
  889. /** handles requests for the pduSensorTable table, if anything else needs to be done */
  890. int
  891. pduSensorTable_handler(
  892. netsnmp_mib_handler *handler,
  893. netsnmp_handler_registration *reginfo,
  894. netsnmp_agent_request_info *reqinfo,
  895. netsnmp_request_info *requests) {
  896. /* perform anything here that you need to do. The requests have
  897. already been processed by the master table_dataset handler, but
  898. this gives you chance to act on the request in some other way
  899. if need be. */
  900. return SNMP_ERR_NOERROR;
  901. }
  902. /** handles requests for the pduSMTPRecMailTable table, if anything else needs to be done */
  903. int
  904. pduSMTPRecMailTable_handler(
  905. netsnmp_mib_handler *handler,
  906. netsnmp_handler_registration *reginfo,
  907. netsnmp_agent_request_info *reqinfo,
  908. netsnmp_request_info *requests) {
  909. /* perform anything here that you need to do. The requests have
  910. already been processed by the master table_dataset handler, but
  911. this gives you chance to act on the request in some other way
  912. if need be. */
  913. return SNMP_ERR_NOERROR;
  914. }
  915. /** handles requests for the pduMessageNumTable table, if anything else needs to be done */
  916. int
  917. pduMessageNumTable_handler(
  918. netsnmp_mib_handler *handler,
  919. netsnmp_handler_registration *reginfo,
  920. netsnmp_agent_request_info *reqinfo,
  921. netsnmp_request_info *requests) {
  922. /* perform anything here that you need to do. The requests have
  923. already been processed by the master table_dataset handler, but
  924. this gives you chance to act on the request in some other way
  925. if need be. */
  926. return SNMP_ERR_NOERROR;
  927. }
  928. /** handles requests for the pduMQTTBrokerTable table, if anything else needs to be done */
  929. int
  930. pduMQTTBrokerTable_handler(
  931. netsnmp_mib_handler *handler,
  932. netsnmp_handler_registration *reginfo,
  933. netsnmp_agent_request_info *reqinfo,
  934. netsnmp_request_info *requests) {
  935. /* perform anything here that you need to do. The requests have
  936. already been processed by the master table_dataset handler, but
  937. this gives you chance to act on the request in some other way
  938. if need be. */
  939. return SNMP_ERR_NOERROR;
  940. }
  941. /** handles requests for the pduCloudServerTable table, if anything else needs to be done */
  942. int
  943. pduCloudServerTable_handler(
  944. netsnmp_mib_handler *handler,
  945. netsnmp_handler_registration *reginfo,
  946. netsnmp_agent_request_info *reqinfo,
  947. netsnmp_request_info *requests) {
  948. /* perform anything here that you need to do. The requests have
  949. already been processed by the master table_dataset handler, but
  950. this gives you chance to act on the request in some other way
  951. if need be. */
  952. return SNMP_ERR_NOERROR;
  953. }
  954. /** handles requests for the pduAlarmHistoryTable table, if anything else needs to be done */
  955. int
  956. pduAlarmHistoryTable_handler(
  957. netsnmp_mib_handler *handler,
  958. netsnmp_handler_registration *reginfo,
  959. netsnmp_agent_request_info *reqinfo,
  960. netsnmp_request_info *requests) {
  961. /* perform anything here that you need to do. The requests have
  962. already been processed by the master table_dataset handler, but
  963. this gives you chance to act on the request in some other way
  964. if need be. */
  965. return SNMP_ERR_NOERROR;
  966. }
  967. /** handles requests for the pduChannelLimitTable table, if anything else needs to be done */
  968. int
  969. pduChannelLimitTable_handler(
  970. netsnmp_mib_handler *handler,
  971. netsnmp_handler_registration *reginfo,
  972. netsnmp_agent_request_info *reqinfo,
  973. netsnmp_request_info *requests) {
  974. /* perform anything here that you need to do. The requests have
  975. already been processed by the master table_dataset handler, but
  976. this gives you chance to act on the request in some other way
  977. if need be. */
  978. return SNMP_ERR_NOERROR;
  979. }
  980. /** handles requests for the pduSensorLimitTable table, if anything else needs to be done */
  981. int
  982. pduSensorLimitTable_handler(
  983. netsnmp_mib_handler *handler,
  984. netsnmp_handler_registration *reginfo,
  985. netsnmp_agent_request_info *reqinfo,
  986. netsnmp_request_info *requests) {
  987. /* perform anything here that you need to do. The requests have
  988. already been processed by the master table_dataset handler, but
  989. this gives you chance to act on the request in some other way
  990. if need be. */
  991. return SNMP_ERR_NOERROR;
  992. }